/* --- DESIGN SYSTEM (VARIABLES) --- */
:root {
    --primary: #6c5ce7;
    --primary-hover: #5b4cc4;
    --secondary: #a29bfe;
    --bg-body: #f8f9fa;
    --bg-surface: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border: #dfe6e9;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --radius: 16px;
    --header-height: 70px;
    --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --danger: #d63031;
    --meet-color: #ea4335;
}

[data-bs-theme="dark"] {
    --primary: #a29bfe;
    --primary-hover: #8e84f5;
    --bg-body: #1e1e1e;
    --bg-surface: #2d2d2d;
    --text-main: #dfe6e9;
    --text-muted: #b2bec3;
    --border: #4a4a4a;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; outline: none; }

/* CONTRAINTE DE PAGE SANS SCROLL */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    height: 100vh; /* Contraint la hauteur au viewport */
    overflow: hidden; /* Empêche le scroll global */
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* --- NAVIGATION SUPÉRIEURE --- */
.top-nav {
    flex-shrink: 0; /* Empêche la nav de rétrécir */
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
}
[data-bs-theme="dark"] .top-nav { background: rgba(45, 45, 45, 0.90); }

.nav-left { display: flex; align-items: center; gap: 1rem; }
.nav-logo { display: flex; align-items: center; text-decoration: none; gap: 0.5rem; transition: opacity 0.2s; }
.nav-logo svg { height: 32px; width: 32px; }
.nav-title { font-size: 1.2rem; font-weight: 800; color: var(--primary); margin: 0; letter-spacing: -0.5px; }

.nav-live-btn {
    text-decoration: none;
    font-size: 0.85rem;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid rgba(108, 92, 231, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}
.nav-live-btn:hover { background: rgba(108, 92, 231, 0.2); transform: translateY(-1px); }

.live-counter {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    display: inline-block;
    line-height: 1;
}

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
    background: none; border: none; color: var(--text-main); cursor: pointer;
    font-size: 1.1rem; padding: 0.5rem; border-radius: 50%; transition: 0.2s;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(0,0,0,0.05); color: var(--primary); }
[data-bs-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,0.05); }

/* --- CONTENEUR PRINCIPAL SCROLLABLE (SI TROP PETIT) --- */
.main-container {
    flex: 1;
    overflow-y: auto; /* Permet le scroll UNIQUEMENT ici si l'écran est minuscule */
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* --- EN-TÊTE DU DASHBOARD --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.dash-title-section { text-align: left; }
.welcome-text {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}
.sub-text { color: var(--text-muted); font-size: 1rem; margin: 0; }

/* --- WRAPPER DES CARTES --- */
.cards-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
    animation: slideUp 0.6s ease-out 0.2s both;
}

/* --- CARTES CARRÉES + HOVER --- */
.action-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 1 / 1; /* Force la carte à être un carré parfait */
    cursor: pointer;
}

/* Face avant de la carte */
.card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.action-icon-large {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: var(--primary);
    margin-bottom: 1.2rem;
    transition: all 0.4s;
}

.action-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin: 0; }

/* Calque qui apparait au survol */
.card-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.action-desc { font-size: 0.95rem; line-height: 1.6; font-weight: 500; margin: 0; }

/* Animations au survol de la carte globale */
.action-card:hover { border-color: var(--primary); box-shadow: 0 15px 35px rgba(108, 92, 231, 0.2); }
.action-card:hover .card-front { opacity: 0; transform: scale(0.8) translateY(-20px); }
.action-card:hover .card-overlay { opacity: 1; transform: translateY(0); }

/* Surcharge spécifique pour l'effet de survol de la carte Planification orange */
.action-card.card-orange:hover {
    border-color: #ff9f43;
    box-shadow: 0 15px 35px rgba(255, 159, 67, 0.2);
}

.footer { margin-top: auto; text-align: center; padding: 1rem; color: var(--text-muted); font-size: 0.75rem; flex-shrink: 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVE: Si l'écran est vraiment trop petit, on passe sur 2 colonnes ou 1 colonne */
@media (max-width: 900px) {
    .actions-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .dashboard-header { flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; }
    .dash-title-section { text-align: center; }
}
@media (max-width: 500px) {
    .actions-grid { grid-template-columns: 1fr; }
}
