/* =========================================
   VARIABLES GLOBALES
   ========================================= */
:root {
    --bg-color: #f0f2f5;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --border-color: #e2e8f0;

    /* Palette d'accents */
    --blue-accent: #4a90e2;
    --green-accent: #50e3c2;
    --orange-accent: #ff9f43;
    --purple-accent: #9b59b6;
    --red-accent: #e74c3c;

    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* =========================================
   RESET & BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* =========================================
   NAVIGATION (Navbar)
   ========================================= */
.navbar {
    background-color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--blue-accent);
    text-decoration: none;
}

.navbar .logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    background-color: var(--bg-color);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.user-profile-btn:hover { background-color: #e1e4e8; }

.logout-btn {
    text-decoration: none;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-color);
}

.logout-btn:hover {
    background-color: #ffebee;
    color: var(--red-accent);
}

.login-btn {
    text-decoration: none;
    color: white;
    background-color: var(--blue-accent);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 500;
    transition: background 0.2s;
}

.login-btn:hover {
    background-color: #357abd;
}

/* =========================================
   LAYOUT GÉNÉRAL
   ========================================= */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-light);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.7;
    margin-bottom: 1.5rem;
    transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; color: var(--blue-accent); }

/* =========================================
   COMPOSANT : ASTUCE DU JOUR (Dashboard)
   ========================================= */
.daily-tip-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    position: relative;
}

.tip-content h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tip-content p {
    font-size: 1.1rem;
    font-weight: 500;
    padding-right: 40px;
}

.refresh-tip {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-tip:hover {
    transform: rotate(180deg);
    background: rgba(255,255,255,0.3);
}

/* =========================================
   COMPOSANT : GRILLE DASHBOARD
   ========================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.dash-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-top: 4px solid transparent;
    height: 100%;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.dash-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.dash-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.dash-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

.dash-card.blue { border-top-color: var(--blue-accent); }
.dash-card.blue .icon { color: var(--blue-accent); }
.dash-card.green { border-top-color: var(--green-accent); }
.dash-card.green .icon { color: var(--green-accent); }
.dash-card.orange { border-top-color: var(--orange-accent); }
.dash-card.orange .icon { color: var(--orange-accent); }
.dash-card.purple { border-top-color: var(--purple-accent); }
.dash-card.purple .icon { color: var(--purple-accent); }

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: auto;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES
   ========================================= */

/* Mobiles (max 768px) */
@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 0.8rem 1rem;
        gap: 10px;
    }
    .navbar .logo {
        font-size: 1.1rem;
    }
    .nav-actions {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    .user-profile-btn .user-name {
        display: none; /* Masque le nom d'utilisateur sur petit écran */
    }
    .main-container {
        padding: 1rem;
    }
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    .daily-tip-banner {
        padding: 1rem;
    }
    .tip-content p {
        font-size: 1rem;
        padding-right: 30px;
    }
    .refresh-tip {
        top: 1rem;
        right: 1rem;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
    }
    .dash-card {
        padding: 1.5rem;
        align-items: center;
        text-align: center;
    }
    .dash-card .icon {
        font-size: 2rem;
    }
    .dash-card h2 {
        font-size: 1.1rem;
    }
    .dash-card p {
        font-size: 0.85rem;
    }
    .back-link {
        margin-bottom: 1rem;
    }
}

/* Très petits écrans (max 480px) */
@media screen and (max-width: 480px) {
    .main-container {
        padding: 0.5rem;
    }
    .hero-banner { /* Si utilisé sur d'autres pages */
        padding: 2rem 1rem;
    }
    .hero-content h1 {
        font-size: 1.8rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .tip-card-standalone {
        padding: 1rem;
    }
    .tip-card-standalone h3 {
        font-size: 0.8rem;
    }
    .tip-card-standalone p {
        font-size: 0.9rem;
    }
    .refresh-tip-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    .features-grid {
        gap: 1rem;
    }
    .feature-card {
        padding: 2rem 1.5rem;
    }
    .feature-icon {
        font-size: 2.5rem;
    }
    .feature-card h3 {
        font-size: 1.1rem;
    }
    .feature-card p {
        font-size: 0.8rem;
    }
}