/**
 * PBG PWA - Navigation & Écrans
 * Version: 1.0.0
 */

/* ============================
   BOTTOM NAVIGATION BAR
   ============================ */
.pbg-pwa-nav {
    display: none; /* Caché par défaut, visible en PWA */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, #2C2C2C 0%, #3A3A3A 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Afficher en mode standalone (PWA installée) */
@media (display-mode: standalone) {
    .pbg-pwa-nav {
        display: flex;
    }
    
    /* Ajouter du padding en bas du contenu pour ne pas cacher derrière la nav */
    body.pbg-pwa-active {
        padding-bottom: 80px;
    }
}

/* Aussi afficher sur mobile même sans PWA pour preview */
@media (max-width: 768px) {
    .pbg-pwa-nav.always-show {
        display: flex;
    }
}

.pbg-pwa-nav-inner {
    display: flex;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    height: 100%;
}

.pbg-pwa-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    padding: 8px;
    position: relative;
}

.pbg-pwa-nav-item:hover,
.pbg-pwa-nav-item:focus {
    color: rgba(255, 255, 255, 0.9);
}

.pbg-pwa-nav-item.active {
    color: #8A9A7B;
}

.pbg-pwa-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #8A9A7B;
    border-radius: 0 0 3px 3px;
}

.pbg-pwa-nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.pbg-pwa-nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================
   ÉCRAN NON CONNECTÉ
   ============================ */
.pbg-pwa-login-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2C2C2C 0%, #3A3A3A 100%);
    padding: 30px;
    text-align: center;
}

.pbg-pwa-login-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.pbg-pwa-login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pbg-pwa-login-title {
    color: #8A9A7B;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.pbg-pwa-login-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin: 0 0 40px 0;
    line-height: 1.5;
}

.pbg-pwa-login-btn {
    display: inline-block;
    background: linear-gradient(135deg, #8A9A7B 0%, #6B7A5F 100%);
    color: #2C2C2C;
    padding: 16px 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(138, 154, 123, 0.3);
}

.pbg-pwa-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 154, 123, 0.4);
}

.pbg-pwa-login-features {
    margin-top: 50px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.pbg-pwa-login-feature {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.pbg-pwa-login-feature-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.pbg-pwa-login-feature-text {
    font-size: 13px;
}

/* ============================
   HEADER PWA (optionnel)
   ============================ */
.pbg-pwa-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2C2C2C 0%, #3A3A3A 100%);
    z-index: 9997;
    padding-top: env(safe-area-inset-top, 0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (display-mode: standalone) {
    .pbg-pwa-header {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    body.pbg-pwa-active {
        padding-top: 70px;
    }
}

.pbg-pwa-header-title {
    color: #8A9A7B;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pbg-pwa-header-icon {
    font-size: 24px;
}

/* ============================
   AJUSTEMENTS RESPONSIVE
   ============================ */
@media (max-width: 480px) {
    .pbg-pwa-nav {
        height: 65px;
    }
    
    .pbg-pwa-nav-icon {
        font-size: 22px;
    }
    
    .pbg-pwa-nav-label {
        font-size: 10px;
    }
    
    .pbg-pwa-login-features {
        gap: 20px;
    }
}

/* Safe area pour iPhone X+ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pbg-pwa-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
