/**
 * PokePlasma - Mobile Styles
 * Styles pour écrans 768px et moins
 */

@media (max-width: 768px) {

    /* Header */
    .header-content {
        flex-direction: column;
        gap: 10px;
        padding: 10px 12px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    /* Hide back button text on mobile */
    .header-back-btn span {
        display: none;
    }

    .header-back-btn {
        padding: 8px;
        margin-right: 8px;
    }

    /* Search bar - more compact */
    .search-container {
        max-width: 100%;
        width: 100%;
        min-width: unset;
        padding: 4px;
        gap: 4px;
    }

    #searchInput {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: 80px;
        flex: 1;
    }

    .search-icon {
        width: 14px;
        height: 14px;
        margin-left: 6px;
    }

    /* Hide stats counter on small screens */
    .search-stats {
        display: none;
    }

    .search-lang .lang-flag {
        width: 18px;
        height: 14px;
    }

    .search-lang .lang-selector {
        padding: 4px;
    }

    /* Smaller toolbar buttons */
    .toolbar-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .toolbar-btn svg {
        width: 16px;
        height: 16px;
    }

    .search-filters-btn.toolbar-btn {
        width: 32px;
        height: 32px;
    }

    .search-filters-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Theme toggle smaller */
    .theme-toggle {
        width: 32px;
        height: 32px;
    }

    .theme-toggle-icon {
        width: 16px;
        height: 16px;
    }

    /* Hide overlay on mobile - use fullscreen instead */
    .filters-overlay {
        display: none;
    }

    /* Filters section - Fullscreen overlay on mobile */
    .filters-section {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 200;
        margin: 0;
        padding: 0;
        background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 62, 0.95) 50%, rgba(15, 15, 35, 0.98) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-right: none;
        opacity: 0;
        visibility: hidden;
        transform: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        overflow-y: auto;
    }

    .filters-section::before {
        display: none;
    }

    .filters-section.mobile-visible {
        opacity: 1;
        visibility: visible;
    }

    .filters-section.sidebar-visible {
        transform: none;
        opacity: 0;
        visibility: hidden;
    }

    .filters-content {
        display: block !important;
        padding: 20px;
        margin: 0;
        border-radius: 0;
        border: none;
        background: transparent;
        min-height: 100vh;
        padding-top: 60px;
        padding-bottom: 100px;
    }

    .filters-close-btn {
        position: fixed;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
        z-index: 201;
    }

    .filter-row {
        flex-direction: column;
        gap: 16px;
    }

    .filter-group {
        margin-bottom: 24px;
    }

    .type-filters,
    .generation-filters,
    .category-filters,
    .region-filters {
        gap: 10px;
    }

    .type-pill,
    .generation-pill,
    .category-pill,
    .region-pill {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .reset-filters {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        margin: 0;
        padding: 16px;
        font-size: 1rem;
        justify-content: center;
        background: rgba(239, 68, 68, 0.2);
        border-color: #ef4444;
        color: #ef4444;
    }

    /* Grid - add margin for header */
    .pokemon-grid-container {
        margin-top: 140px;
        padding: 0 12px 32px;
    }

    .pokemon-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .pokemon-card::after {
        font-size: 4rem;
    }

    /* ===========================================
       Pokemon Detail Page - Fullscreen on Mobile
       =========================================== */

    .pokemon-detail-page {
        padding-top: 60px;
        z-index: 300;
    }

    .pokemon-detail-page.visible~.header {
        display: none;
    }

    /* Detail header bar on mobile */
    .detail-header-bar {
        padding: 12px 16px;
    }

    .detail-back-btn {
        padding: 10px;
        font-size: 0.85rem;
    }

    .detail-back-btn span {
        display: none;
    }

    .detail-back-btn svg {
        width: 20px;
        height: 20px;
    }

    .detail-controls {
        gap: 10px;
    }

    .detail-lang .lang-selector {
        padding: 8px 10px;
    }

    .detail-lang .lang-flag {
        width: 22px;
        height: 16px;
    }

    .detail-theme-toggle {
        width: 38px;
        height: 38px;
    }

    .detail-theme-toggle .theme-toggle-icon {
        width: 18px;
        height: 18px;
    }

    /* Detail content - vertical stack */
    .detail-content {
        display: flex;
        flex-direction: column;
        padding: 16px;
        padding-top: 70px;
        gap: 16px;
    }

    .detail-column {
        width: 100%;
    }

    /* Center column first on mobile */
    .detail-center-column {
        order: -1;
        padding-top: 0;
    }

    .pokemon-detail-name {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .pokemon-detail-category {
        font-size: 0.75rem;
        padding: 4px 12px;
    }

    .pokemon-showcase {
        gap: 10px;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
    }

    .nav-arrow svg {
        width: 22px;
        height: 22px;
    }

    .pokemon-display {
        max-width: 300px;
    }

    .pokemon-detail-image {
        max-width: 270px;
    }

    .pokemon-podium {
        width: 200px;
        height: 20px;
        margin-top: -15px;
    }

    .pokemon-detail-description {
        font-size: 0.85rem;
        padding: 0 10px;
    }

    /* Info cards - vertical stack, not horizontal scroll */
    .detail-info-column {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-x: visible;
    }

    .info-card {
        min-width: unset;
        width: 100%;
    }

    .glass-card {
        padding: 14px;
    }

    /* Stats card full width */
    .stats-card {
        padding: 14px;
    }

    .stats-header {
        justify-content: flex-end;
        gap: 6px;
    }

    .stats-tab {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .stat-row {
        grid-template-columns: 60px 1fr 40px;
        gap: 6px;
    }

    .stat-name {
        font-size: 0.7rem;
    }

    .stat-bar-container {
        height: 8px;
    }

    .stat-value {
        font-size: 0.75rem;
    }

    .stats-total {
        padding-top: 10px;
        margin-top: 10px;
    }

    .stats-total-value {
        font-size: 1rem;
    }

    /* Evolution chain - VERTICAL on mobile */
    .detail-evolution {
        margin: 0 16px 16px;
        padding: 16px;
    }

    .evolution-chain-horizontal {
        flex-direction: column;
        gap: 0;
    }

    .evo-main-chain {
        flex-direction: column;
        gap: 0;
    }

    .evo-stage {
        width: 100%;
    }

    .evo-pokemon {
        padding: 10px 16px;
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }

    .evo-pokemon img {
        width: 60px;
        height: 60px;
    }

    .evo-pokemon .evo-id {
        display: none;
    }

    .evo-pokemon .evo-name {
        font-size: 0.85rem;
    }

    .evo-arrow {
        flex-direction: row;
        padding: 8px 0;
    }

    .evo-arrow svg {
        width: 20px;
        height: 20px;
        transform: rotate(90deg);
    }

    .evo-arrow .evo-level {
        font-size: 0.65rem;
    }

    /* Special forms section - already vertical in desktop */
    .evo-special-forms {
        margin-top: 12px;
        padding-top: 12px;
    }

    .evo-special-list {
        flex-direction: column;
        gap: 8px;
    }

    .evo-pokemon.evo-special {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .evo-pokemon.evo-special img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {

    /* Even smaller header */
    .header-content {
        padding: 8px 10px;
        gap: 8px;
    }

    .logo h1 {
        font-size: 0.95rem;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    /* Even more compact search */
    .search-container {
        padding: 3px;
        gap: 3px;
    }

    #searchInput {
        padding: 5px 6px;
        font-size: 0.75rem;
    }

    .search-icon {
        display: none;
    }

    .toolbar-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }

    .toolbar-btn svg {
        width: 14px;
        height: 14px;
    }

    .theme-toggle {
        width: 28px;
        height: 28px;
    }

    .theme-toggle-icon {
        width: 14px;
        height: 14px;
    }

    /* Grid margin */
    .pokemon-grid-container {
        margin-top: 120px;
    }

    /* Grid 2 columns */
    .pokemon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pokemon-card {
        padding: 12px 12px 10px;
    }

    .pokemon-card::after {
        font-size: 3.5rem;
    }

    .pokemon-name {
        font-size: 0.8rem;
    }

    .podium-type {
        width: 22px;
        height: 22px;
    }

    .podium-type img {
        width: 12px;
        height: 12px;
    }

    .type-icon-badge {
        width: 20px;
        height: 20px;
    }

    .type-icon-badge img {
        width: 16px;
        height: 16px;
    }

    /* Detail page adjustments */
    .detail-content {
        padding: 12px;
        padding-top: 60px;
        gap: 12px;
    }

    .pokemon-detail-name {
        font-size: 1.5rem;
    }

    .pokemon-display {
        max-width: 240px;
    }

    .pokemon-detail-image {
        max-width: 210px;
    }

    .pokemon-podium {
        width: 160px;
        height: 15px;
        margin-top: -10px;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
    }

    .nav-arrow svg {
        width: 18px;
        height: 18px;
    }

    .glass-card {
        padding: 12px;
    }

    .info-row {
        padding: 6px 0;
    }

    .info-label {
        font-size: 0.75rem;
    }

    .info-value {
        font-size: 0.85rem;
    }

    /* Smaller evolution items */
    .evo-pokemon {
        padding: 8px 12px;
    }

    .evo-pokemon img {
        width: 50px;
        height: 50px;
    }

    .evo-pokemon .evo-name {
        font-size: 0.75rem;
    }

    .evolution-title {
        font-size: 0.75rem;
        padding: 6px 14px;
    }

    /* Favorite button on cards - smaller on mobile */
    .card-favorite-btn {
        width: 26px;
        height: 26px;
        top: -2px;
        right: -2px;
    }

    .card-favorite-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Favorites toggle count badge smaller */
    .favorites-count {
        min-width: 14px;
        height: 14px;
        font-size: 0.6rem;
        top: -4px;
        right: -4px;
    }
}