@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6; /* Blanc très légèrement grisé/sable */
    color: #2c3e50;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lux-header {
    text-align: center;
    margin-bottom: 30px;
}

.lux-header h1 {
    font-family: 'Playfair Display', serif;
    color: #0f4c81; /* Bleu Égée */
    font-size: 2.5em;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.subtitle {
    color: #c5a059; /* Or doux */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9em;
}

/* Boutons flottants */
#auth-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 30px;
    color: white;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
    background-color: #0f4c81;
}

.floating-btn:hover {
    transform: translateY(-2px);
}

/* NOUVEAU: Style Calendrier type Google Agenda */
#calendar-wrapper {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 700px; /* Hauteur fixe pour scroller */
    overflow-y: scroll;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#time-labels {
    width: 60px;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-right: 1px solid #ddd;
    padding-top: 50px; /* Espace pour s'aligner sous le titre des jours */
}

.time-label {
    height: 60px;
    min-height: 60px; /* NOUVEAU : Empêche Flexbox de rétrécir l'élément */
    flex-shrink: 0; /* NOUVEAU : Sécurité supplémentaire */
    text-align: right;
    padding-right: 10px;
    font-size: 12px;
    color: #777;
    box-sizing: border-box;
    position: relative;
}

.time-label span {
    position: absolute;
    top: 0;
    right: 10px;
    background-color: #f9f9f9;
    padding: 0 4px;
    line-height: 1;
    transform: translateY(-50%); /* NOUVEAU : Centre parfaitement le texte sur la ligne */
}

#planning-container {
    display: flex;
    flex: 1;
    position: relative;
    /* NOUVEAU : Calcul exact pour 17h (7h à 23h) * 60px + 50px d'en-tête */
    min-height: 1070px; 
    background-image: linear-gradient(#eee 1px, transparent 1px);
    background-size: 100% 60px; 
    /* NOUVEAU : Aligne la première ligne de fond avec la ligne de 7h00 */
    background-position: 0 50px;
}

.day-column {
    flex: 1;
    border-right: 1px solid #eee;
    position: relative;
}

.day-title {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    font-weight: bold;
    color: #005b9f;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
    box-sizing: border-box; /* NOUVEAU : Intègre le pixel de bordure dans les 50px */
}

.activity-card {
    position: absolute; /* Placement absolu selon l'heure */
    width: 90%;
    left: 5%;
    background: #ffb74d; /* Couleur de fond par défaut (Orange) */
    border: 1px solid #f57c00;
    padding: 5px;
    border-radius: 4px;
    overflow: hidden;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.2s;
}

.activity-card:hover:not(.disabled) {
    transform: scale(1.02);
    z-index: 5;
}

.activity-card.selected {
    background: #81c784; /* Vert */
    border-color: #388e3c;
    color: #000;
}

.activity-card.disabled {
    background: #e0e0e0;
    border-color: #bdbdbd;
    color: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.7;
}

/* NOUVEAU: Styles améliorés pour le modal d'administration */
dialog {
    border-radius: 12px;
    border: none;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 350px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#admin-form {
    padding: 25px;
}

dialog::backdrop {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
}

dialog h3 {
    margin-top: 0;
    color: #005b9f;
    text-align: center;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.input-group input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #005b9f;
    outline: none;
}

.time-group {
    display: flex;
    gap: 15px;
}

.time-group .input-group {
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.btn-cancel {
    padding: 10px 15px;
    background: #f1f3f4;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #333;
    font-weight: bold;
}

.btn-submit {
    padding: 10px 15px;
    background: #005b9f;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: bold;
}

.btn-submit:hover {
    background: #00467a;
}

/* NOUVEAU: Ajustements pour les activités très courtes (30 min ou moins) */
.activity-card.short-act {
    padding: 2px 5px; /* On réduit le padding vertical pour laisser respirer le texte */
    min-height: 25px; /* Sécurité pour éviter d'avoir une carte trop écrasée */
}

/* Styles pour les images de fond des cartes */
.activity-card.has-image {
    background-size: cover;
    background-position: center;
    color: white !important;
    border: none;
}

/* Overlay sombre pour lire le texte par-dessus l'image */
.card-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 5px;
    height: 100%;
    box-sizing: border-box;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Styles du modal de luxe et d'aperçu */
.lux-modal {
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
}

.preview-style {
    background: #fff;
}

.preview-hero {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.preview-content {
    padding: 25px;
}

#preview-title {
    font-family: 'Playfair Display', serif;
    color: #0f4c81;
    margin-top: 0;
    margin-bottom: 5px;
}

.preview-subtitle {
    color: #c5a059;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
}

.preview-text {
    line-height: 1.5;
    white-space: pre-wrap; /* Permet les retours à la ligne */
    margin-bottom: 20px;
    color: #555;
}

.gps-container {
    display: flex;
    gap: 10px;
}

.gps-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    color: white;
}

.gmaps { background-color: #34a853; }
.waze { background-color: #33ccff; color: #000; }

.btn-edit {
    padding: 10px 15px;
    background: #f2a900;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: bold;
}

/* NOUVEAU: Styles pour les boutons du diaporama */
.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 50%;
    display: none;
    transition: background 0.2s;
}
.slide-btn:hover { 
    background: rgba(0,0,0,0.8); 
}

/* NOUVEAU: Gestion des dates courtes/longues et masquage des éléments mobiles sur PC */
.long-date { display: none; }
.short-date { display: inline; }

.hamburger-btn {
    display: none;
    position: absolute;
    top: 0px;
    right: -30px;
    background: none;
    border: none;
    font-size: 28px;
    color: #0f4c81;
    cursor: pointer;
    z-index: 1001;
}

.mobile-nav-container {
    display: none;
}

/* NOUVEAU: Responsive - Vue jour par jour parfaite sur mobile */
/* NOUVEAU: Responsive complet (Menu, Navigation, Dates) */
@media (max-width: 768px) {
    /* Inversion de l'affichage des dates */
    .long-date { display: inline; font-size: 0.9em; }
    .short-date { display: none; }

    /* Affichage du bouton hamburger */
    .hamburger-btn { display: block; }

    /* NOUVEAU: Le auth-container se transforme en menu UNIQUEMENT quand le planning est actif */
    body.app-active #auth-container {
        display: none;
        top: 60px;
        bottom: auto;
        background: white;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    body.app-active #auth-container.show {
        display: flex;
    }

    /* Affichage de la barre de navigation en bas */
    .mobile-nav-container {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        gap: 15px;
        z-index: 1000;
        width: 90%;
        justify-content: space-between;
    }

    .nav-btn {
        background: #0f4c81;
        color: white;
        border: none;
        padding: 12px 20px;
        border-radius: 30px;
        font-weight: bold;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        cursor: pointer;
        flex: 1;
        text-align: center;
    }

    /* On remonte un peu le calendrier pour qu'il ne soit pas caché par les boutons */
    #calendar-wrapper {
        overflow-x: hidden; 
        margin-bottom: 70px;
    }

    #time-labels {
        z-index: 20;
        background: #f4f7f6;
        border-right: 2px solid #ddd;
    }

    #planning-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none; 
    }
    
    #planning-container::-webkit-scrollbar {
        display: none;
    }

    .day-column {
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: start;
        border-right: none;
    }

    .lux-modal {
        width: 95%;
        max-width: none;
        padding: 20px;
    }
}


/* =========================================
   NOUVEAU: THÈME SOMBRE (DARK MODE)
   ========================================= */
body {
    background-color: #121212;
    color: #e0e0e0;
}

.lux-header h1 { color: #90caf9; }
.subtitle { color: #ffd54f; }

#calendar-wrapper {
    background: #1e1e1e;
    border-color: #333;
}

#time-labels {
    background: #1e1e1e;
    border-color: #333;
}

.time-label { color: #aaa; }
.time-label span { background-color: #1e1e1e; }

#planning-container {
    /* Grille de fond en version sombre */
    background-image: linear-gradient(#333 1px, transparent 1px);
}

.day-column { border-color: #333; }

.day-title {
    background: #1e1e1e;
    color: #90caf9;
    border-bottom-color: #333;
}

.activity-card.disabled {
    background: #2c2c2c;
    border-color: #444;
    color: #888;
}

/* Modals et aperçus */
.lux-modal, .preview-style {
    background: #1e1e1e;
    color: #e0e0e0;
}

#preview-title { color: #90caf9; }
.preview-subtitle { color: #ffd54f; }
.preview-text { color: #ccc; }

/* Formulaires */
.input-group label { color: #aaa; }
.input-group input, .input-group textarea, .input-group select {
    background: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}
.input-group input:focus, .input-group textarea:focus {
    border-color: #90caf9;
}

/* Écrase les couleurs en ligne (inline) ajoutées dans le HTML */
#preview-alternatives {
    background: #2c2c2c !important;
    border-left-color: #ffd54f !important;
}
#preview-alternatives h4 { color: #90caf9 !important; }
#alternatives-list { color: #ccc !important; }
#current-image-name { color: #90caf9 !important; }

.btn-cancel {
    background: #333;
    color: #e0e0e0;
}

/* Ajustements pour le responsive mobile */
@media (max-width: 768px) {
    #auth-container { background: #1e1e1e; }
    #time-labels {
        background: #121212;
        border-right-color: #333;
    }
    .hamburger-btn { color: #90caf9; }
}

/* =========================================
   NOUVEAU: COMPTEURS PREMIUM (Effet Défilement)
   ========================================= */
.premium-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.timer-box {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px 20px;
    min-width: 60px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden; /* Coupe le chiffre qui arrive du bas */
}

.timer-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #e0e0e0;
    line-height: 1;
    margin-bottom: 5px;
    display: inline-block;
}

.timer-label {
    font-size: 0.75em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Variante plus petite pour le timer d'aide à l'énigme */
.small-timer .timer-box {
    padding: 10px 15px;
    min-width: 45px;
}
.small-timer .timer-value { font-size: 1.5em; }
.small-timer .timer-label { font-size: 0.65em; }

/* L'animation de défilement */
@keyframes rollUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.rolling {
    animation: rollUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@media (max-width: 768px) {
    .premium-timer { gap: 8px; }
    .timer-box { padding: 10px; min-width: 50px; }
    .timer-value { font-size: 1.8em; }
}