/* --- CONFIGURATION DES VARIABLES --- */
:root {
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --accent: #00d4ff; 
    --accent-glow: rgba(0, 212, 255, 0.3);
    --bg-dark: #0f172a;
    --text-dark: #ffffff;
    
    --bg-light: #f8fafc;
    --text-light: #1e293b;
    --glass-light: rgba(255, 255, 255, 0.6);
    --glass-border-light: rgba(0, 0, 0, 0.1);
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

body.dark-mode {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-dark);
}

body.light-mode {
    background: radial-gradient(circle at top right, #e2e8f0, #f8fafc);
    color: var(--text-light);
}

/* --- COMPOSANTS GLASSMORPHISM --- */
.glass-card, .glass-card-wide, .glass-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.dark-mode .glass-card, .dark-mode .glass-card-wide, .dark-mode .glass-header {
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.light-mode .glass-card, .light-mode .glass-card-wide, .light-mode .glass-header {
    background: var(--glass-light);
    border: 1px solid var(--glass-border-light);
}

/* --- LAYOUT --- */
.app-container {
    width: 100%;
    max-width: 500px; 
    margin: 0 auto;
    padding-bottom: 90px; 
}

.glass-header {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.user-info { display: flex; flex-direction: column; }
.user-info span { font-size: 0.85rem; opacity: 0.8; }
.user-info h2 { margin: 0; font-size: 1.4rem; }

.content { padding: 15px; }

.glass-card-wide {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 20px;
}

.glass-card-wide h3 { font-size: 1.1rem; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }

/* --- FORMULAIRES & BOUTONS --- */
input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    outline: none;
    font-size: 16px; 
    transition: 0.3s;
}

.dark-mode input { background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border); color: white; }
.light-mode input { background: rgba(0, 0, 0, 0.05); border: 1px solid var(--glass-border-light); color: var(--text-light); }
.dark-mode input::placeholder { color: rgba(255, 255, 255, 0.5); }

button {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background: var(--accent);
    color: #000;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

button:active { transform: scale(0.95); }

#theme-toggle { background: transparent; color: inherit; font-size: 22px; padding: 5px; box-shadow: none; }

/* --- FLEXBOX POUR ALIGNER LES LIGNES (La vraie correction est ici) --- */
.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
/* Le champ prend l'espace dispo, le bouton garde sa taille */
.flex-row input { flex: 1; margin: 0; }
.flex-row button { padding: 12px; width: auto; }

.routine-grid { display: flex; flex-direction: column; gap: 10px; }
.routine-item { border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.light-mode .routine-item { border-bottom: 1px solid var(--glass-border-light); }
.routine-label { display: block; font-size: 0.8rem; opacity: 0.7; margin-bottom: 5px; }

/* --- NAVIGATION BASSE --- */
.bottom-nav {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 400px;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 24px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark-mode .bottom-nav { background: rgba(15, 23, 42, 0.85); border: 1px solid var(--glass-border); }
.light-mode .bottom-nav { background: rgba(255, 255, 255, 0.85); border: 1px solid var(--glass-border-light); }

.bottom-nav a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    opacity: 0.5;
    transition: 0.3s;
    padding: 5px 10px;
}

.bottom-nav a.active { opacity: 1; color: var(--accent); }
.bottom-nav i { font-size: 22px; margin-bottom: 4px; }
