/* ==========================================================================
   LS PHOTO - DESIGN SYSTEM & STYLE GLOBAL
   ========================================================================== */

/* Reset universel anti-débordement */
*, *::before, *::after {
    box-sizing: border-box;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-VariableFont_wght.woff2') format('woff2');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-Italic-VariableFont_wght.woff2') format('woff2');
    font-weight: 400 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Great Vibes';
    src: url('../fonts/GreatVibes-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #d4af37; 
    --primary-hover: #e6c55c;
    --bg-body: #f9f9f9;
    --bg-card: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --border-color: #e5e5e5;
    
    --font-ui: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-cursive: 'Great Vibes', cursive;
}

body.dark-mode {
    --bg-body: #0a0a0a;
    --bg-card: #141414;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: #2a2a2a;
}

/* -------------------------------------------------------------------------- */
/* STRUCTURE FIXE APP NATIVE & ANTI SCROLL HORIZONTAL                         */
/* -------------------------------------------------------------------------- */

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh; 
    overflow-x: hidden; /* Empêche strictement le débordement horizontal */
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-ui);
    display: flex; 
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

.scroll-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.scroll-area.has-bottom-nav {
    padding-bottom: 85px; /* Laisse l'espace pour la barre de navigation */
}

/* -------------------------------------------------------------------------- */
/* TYPOGRAPHIE & UTILITAIRES                                                  */
/* -------------------------------------------------------------------------- */

.font-serif { font-family: var(--font-serif); }
.font-cursive { font-family: var(--font-cursive); font-size: 1.8rem; }
.text-primary { color: var(--primary-color); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.font-weight-bold { font-weight: 700; }

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary-color); }

.app-main { max-width: 600px; margin: 0 auto; padding: 20px; width: 100%; flex: 1;}

.card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.m-0 { margin: 0; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 0.5rem; }

/* -------------------------------------------------------------------------- */
/* FORMULAIRES & BOUTONS                                                      */
/* -------------------------------------------------------------------------- */

.form-group { margin-bottom: 1.2rem; text-align: left; }
html[dir="rtl"] .form-group { text-align: right; }
label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }

.input-premium { 
    width: 100%; padding: 14px; background: var(--bg-body); 
    border: 1px solid var(--border-color); color: var(--text-main); 
    border-radius: 8px; font-family: var(--font-ui); transition: all 0.2s ease; 
}
.input-premium:focus { 
    border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.input-dark { 
    width: 100%; padding: 15px; border-radius: 8px; margin-bottom: 20px; 
    font-family: var(--font-ui); outline: none; transition: 0.2s; box-sizing: border-box;
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    color: var(--text-main);
}
body.dark-mode .input-dark { 
    background: #050505; border-color: #333; color: white; 
}
.input-dark:focus { border-color: var(--primary-color); }

.btn { 
    padding: 14px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; 
    text-align: center; border: none; transition: all 0.2s ease; font-family: var(--font-ui);
    display: inline-flex; justify-content: center; align-items: center; font-size: 0.95rem;
}
.btn-primary { background: var(--primary-color); color: #000; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);}
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-outline:hover { border-color: var(--primary-color); color: var(--primary-color);}
.btn-block { width: 100%; display: block; }

.social-btn { 
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; 
    padding: 14px; border-radius: 8px; font-weight: 500; cursor: pointer; border: 1px solid #333; 
    background: #000; color: white; margin-bottom: 10px; font-size: 14px; transition: 0.2s;
}
.social-btn:hover { background: #111; border-color: #555; }

.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; font-size: 0.9rem; font-weight: 500;}
.alert-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid #ef4444; }

/* -------------------------------------------------------------------------- */
/* LOGOS ET HEADER                                                            */
/* -------------------------------------------------------------------------- */

.header-logo-container { 
    height: 55px; 
    display: flex; 
    align-items: center; 
}
.header-logo-container img {
    height: 50px !important; 
    width: auto !important; 
    object-fit: contain;
}

.header-controls { display: flex; align-items: center; gap: 25px; }
.lang-switcher { display: flex; align-items: center; gap: 15px; }
.flag-btn { font-size: 1.6rem; cursor: pointer; transition: 0.2s; user-select: none; text-decoration: none; display: flex; align-items: center;}
.flag-btn:hover { transform: scale(1.1); }
.flag-active { opacity: 1; filter: drop-shadow(0 0 5px rgba(212,175,55,0.6)); }
.flag-inactive { opacity: 0.3; filter: grayscale(100%); }

.auth-logo-wrapper { height: 75px; display: flex; justify-content: center; align-items: center; margin-bottom: 30px; }
.auth-logo-wrapper img { height: 75px !important; width: auto !important; object-fit: contain; }

.logo-light { display: block; }
.logo-dark { display: none; }
body.dark-mode .logo-light { display: none !important; }
body.dark-mode .logo-dark { display: block !important; }

/* -------------------------------------------------------------------------- */
/* PAGES DE CONNEXION / ACCUEIL                                               */
/* -------------------------------------------------------------------------- */

.auth-container { width: 100%; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; flex: 1;}
.auth-card { background: var(--bg-card); padding: 40px 30px; border-radius: 16px; border: 1px solid var(--border-color); width: 100%; max-width: 420px; box-shadow: 0 15px 35px rgba(0,0,0,0.06); text-align: center;}
.auth-title { font-family: var(--font-serif); font-size: 2.2rem; margin: 0 0 5px 0; }

.divider { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 25px 0;}
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-color); }
.divider span { padding: 0 10px; }

/* Système de fenêtres (Modales) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--bg-card); padding: 2rem; border-radius: 1rem; width: 90%; max-width: 500px; border: 1px solid var(--border-color); max-height: 90vh; overflow-y: auto; color: var(--text-main); }


/* -------------------------------------------------------------------------- */
/* BARRE DE NAVIGATION FLOTTANTE (BOTTOM NAV) & MODULES                       */
/* -------------------------------------------------------------------------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* Support Notch iPhone */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.bottom-nav .nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s ease, transform 0.2s ease;
    font-family: var(--font-ui);
    outline: none;
}

.bottom-nav .nav-item:hover, 
.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.bottom-nav .nav-item.active {
    transform: translateY(-2px);
}

.bottom-nav .nav-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    transition: stroke 0.3s ease;
}

.bottom-nav .nav-text {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Gestion de l'affichage des onglets/modules */
.module-tab {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.module-tab.active {
    display: block;
    opacity: 1;
    animation: fadeInTab 0.4s ease-in-out;
}

.module-tab.hidden {
    display: none !important;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 75px !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 9999 !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    background: none;
    color: var(--text-muted);
}

.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

/* -------------------------------------------------------------------------- */
/* ANIMATIONS MUSIQUE                                                         */
/* -------------------------------------------------------------------------- */
.music-btn {
    transition: transform 0.2s ease, opacity 0.2s ease;
    position: relative;
}

.music-btn.playing {
    animation: musicBounce 1s infinite alternate ease-in-out;
}

.music-btn.paused {
    opacity: 0.6;
}

.music-btn.paused::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background-color: #ef4444;
    transform: rotate(45deg);
    border-radius: 2px;
}

@keyframes musicBounce {
    0% { transform: scale(0.95) rotate(-5deg); }
    100% { transform: scale(1.15) rotate(5deg); }
}