/* ═══════════════════════════════════════════════════════════════════
   CortyKids — App Mobile
   Fichier: public/assets/css/mobile-app.css
   
   Bottom navigation 5 onglets + header mobile + safe-area iPhone.
   À charger EN DERNIER (override les autres CSS).
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   1. HEADER MOBILE
   ═══════════════════════════════════════════════════════════════════ */

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ck-navy);
    color: var(--ck-white);
    height: var(--ck-header-height);
    display: none; /* caché par défaut, visible en mobile */
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: var(--ck-safe-top);
    box-shadow: var(--ck-shadow);
}

.mobile-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ck-white);
    font-family: var(--ck-font-title);
    font-weight: 700;
    font-size: 1.1rem;
}

.mobile-header-logo img,
.mobile-header-logo svg {
    width: 32px;
    height: 32px;
}

.mobile-header-logo-text {
    background: linear-gradient(135deg, var(--ck-gold), var(--ck-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--ck-white);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1.1rem;
}

.mobile-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════
   2. BOTTOM NAVIGATION (5 onglets)
   ═══════════════════════════════════════════════════════════════════ */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--ck-navy);
    height: var(--ck-nav-height);
    padding-bottom: var(--ck-safe-bottom);
    display: none; /* caché par défaut, visible en mobile */
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(3, 28, 56, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    min-width: 0;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-icon {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.mobile-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    line-height: 1;
}

.mobile-nav-item.active {
    color: var(--ck-gold);
}

.mobile-nav-item.active .mobile-nav-icon {
    transform: translateY(-2px) scale(1.1);
}

/* Indicateur actif (petit point doré) */
.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ck-gold);
    box-shadow: 0 0 8px var(--ck-gold-glow);
}

/* Ripple au clic */
.mobile-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(210, 154, 43, 0.2), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-nav-item:active::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   3. CONTENU MOBILE
   ═══════════════════════════════════════════════════════════════════ */

.mobile-main {
    /* Espace en bas pour ne pas être caché par la bottom nav */
    padding-bottom: calc(var(--ck-nav-height) + var(--ck-safe-bottom) + 16px);
    min-height: calc(100vh - var(--ck-header-height));
}

/* ═══════════════════════════════════════════════════════════════════
   4. TABLETTE : SIDEBAR LATÉRALE
   ═══════════════════════════════════════════════════════════════════ */

.tablet-sidebar {
    display: none; /* caché par défaut, visible en tablette */
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px;
    background: var(--ck-navy);
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 8px;
    z-index: 150;
    box-shadow: var(--ck-shadow);
    transition: width 0.3s ease;
}

.tablet-sidebar:hover {
    width: 220px;
}

.tablet-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--ck-radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.tablet-sidebar-item:hover,
.tablet-sidebar-item.active {
    background: rgba(210, 154, 43, 0.15);
    color: var(--ck-gold);
}

.tablet-sidebar-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.tablet-sidebar-label {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tablet-sidebar:hover .tablet-sidebar-label {
    opacity: 1;
}

.tablet-main {
    /* Marge à gauche pour ne pas passer sous la sidebar */
    margin-left: 80px;
    transition: margin-left 0.3s ease;
}

.tablet-sidebar:hover ~ .tablet-main {
    margin-left: 220px;
}

/* ═══════════════════════════════════════════════════════════════════
   5. TRANSITIONS DE PAGE (mobile slide)
   ═══════════════════════════════════════════════════════════════════ */

.mobile-page-enter {
    animation: slide-in-right 0.3s var(--ck-ease-out);
}

.mobile-page-exit {
    animation: slide-out-left 0.3s var(--ck-ease);
}

/* ═══════════════════════════════════════════════════════════════════
   6. COMPOSANTS MOBILE SPÉCIFIQUES
   ═══════════════════════════════════════════════════════════════════ */

/* Barre de recherche mobile */
.mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--ck-radius-full);
    padding: 8px 16px;
    margin: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
}

.mobile-search input {
    background: transparent;
    border: none;
    color: var(--ck-white);
    width: 100%;
    font-size: 0.95rem;
}

.mobile-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.mobile-search input:focus {
    outline: none;
}

/* Cartes swipeables */
.mobile-swipe-card {
    background: var(--ck-white);
    border-radius: var(--ck-radius-lg);
    padding: 20px;
    margin: 12px 16px;
    box-shadow: var(--ck-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.mobile-swipe-card:active {
    transform: scale(0.98);
    box-shadow: var(--ck-shadow);
}

/* FAB (Floating Action Button) */
.mobile-fab {
    position: fixed;
    bottom: calc(var(--ck-nav-height) + var(--ck-safe-bottom) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ck-grad-gold);
    color: var(--ck-navy);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--ck-shadow-gold);
    z-index: 150;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-fab:hover {
    transform: scale(1.08);
    box-shadow: var(--ck-shadow-glow);
}

.mobile-fab:active {
    transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════
   7. RESPONSIVE — AFFICHAGE CONDITIONNEL
   ═══════════════════════════════════════════════════════════════════ */

/* Mobile (< 768px) : bottom nav + header mobile */
@media (max-width: 767px) {
    .mobile-header,
    .mobile-bottom-nav {
        display: flex;
    }

    .mobile-fab {
        display: flex;
    }

    .ck-header,
    .ck-footer {
        display: none;
    }
}

/* Tablette (768px - 1023px) : sidebar latérale */
@media (min-width: 768px) and (max-width: 1023px) {
    .tablet-sidebar {
        display: flex;
    }

    .mobile-header,
    .mobile-bottom-nav {
        display: none;
    }

    .mobile-fab {
        display: none;
    }

    .ck-header,
    .ck-footer {
        display: none;
    }
}

/* Desktop (>= 1024px) : header classique */
@media (min-width: 1024px) {
    .mobile-header,
    .mobile-bottom-nav,
    .tablet-sidebar {
        display: none;
    }

    .mobile-fab {
        display: none;
    }

    .tablet-main {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   8. SAFE AREA (iPhone encoche)
   ═══════════════════════════════════════════════════════════════════ */

@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(var(--ck-safe-bottom), 0px);
    }

    .mobile-header {
        padding-top: max(var(--ck-safe-top), 0px);
    }

    .mobile-main {
        padding-bottom: calc(var(--ck-nav-height) + max(var(--ck-safe-bottom), 16px));
    }
}