/* ============================================
   DESIGN SYSTEM - AURORA GLASS (Vibrant Tech)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Aurora Palette - High Vibrancy */
    --bg-main: #020617; /* Deepest Midnight */
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-header: rgba(2, 6, 23, 0.8);
    
    /* Vibrant Accents */
    --color-primary: #6366f1;   /* Indigo Aurora */
    --color-secondary: #2dd4bf; /* Teal Aurora */
    --color-accent: #f43f5e;    /* Rose Aurora */
    --color-warning: #f59e0b;   /* Amber Aurora */
    --color-success: #10b981;   /* Emerald */
    --color-danger: #ef4444;    /* Red */
    
    /* Text Hierarchy - Modern Sharpness */
    --text-pure: #ffffff;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #475569;
    
    /* Glassmorphism Tokens */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.15);
    --glass-blur: blur(24px);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Layout & Geometry */
    --header-height: 70px;
    --border-radius: 24px; /* Generous Bento Padding */
    --transition-standard: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Animated Aurora Background Blobs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--color-primary), transparent);
    animation: aurora-float-1 20s ease-in-out infinite;
}

body::after {
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--color-secondary), transparent);
    animation: aurora-float-2 25s ease-in-out infinite;
}

@keyframes aurora-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, 100px) scale(1.1); }
}

@keyframes aurora-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, -100px) scale(1.2); }
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Outfit', sans-serif;
    color: var(--text-pure);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-standard);
}

a:hover {
    color: var(--color-secondary);
}

/* ============================================
   MODERN COMPONENTS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-standard);
    border: 1px solid transparent;
    gap: 10px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-pure);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-bright);
}

/* ============================================
   GLOBAL LAYOUT
   ============================================ */

.app-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1100;
    width: 100%;
}

.app-header {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.app-header-left, .app-header-right, .app-header-spacer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.app-header-right {
    justify-content: flex-end;
}

.app-header-spacer {
    flex: 2; /* Pour le centrage du menu sur PC */
}

.user-panel-wrapper {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    transition: var(--transition-standard);
}

.user-panel-wrapper:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-bright);
    transform: translateY(-1px);
}

.user-panel-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.avatar-ring {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.app-user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.logout-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(244, 63, 94, 0.2);
    font-size: 0.9rem;
    transition: var(--transition-standard);
}

.logout-btn:hover {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
    transform: rotate(90deg);
}

.app-top-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    z-index: 20;
    margin: 0;
}

.app-top-nav-item, .nav-dropdown-container {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    transition: var(--transition-standard);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11001;
}

/* Responsive Breakpoints Header */
@media (max-width: 1400px) {
    .app-header-title-name { display: none; }
    .app-header-left { flex: 0; }
}

@media (max-width: 1250px) {
    .user-panel-info, .role-simulator-container span { display: none; }
    
    .mobile-menu-btn { display: flex; margin-left: 10px; }
    .app-header-left, .app-header-right { flex: 1; }

    .app-top-nav {
        display: none;
        position: fixed;
        top: 0 !important;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        background: #0f111a;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        z-index: 11000;
        padding: 80px 20px 40px 20px;
        gap: 16px;
        pointer-events: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-top-nav.active { display: flex; }

    .app-top-nav-item {
        width: 100%;
        max-width: 320px;
        padding: 14px;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1.2rem;
    }

    .nav-dropdown-container { width: 100%; max-width: 320px; }
    .nav-dropdown {
        position: static;
        display: none;
        background: rgba(255, 255, 255, 0.02);
        padding: 10px 0;
        border-radius: 10px;
        margin-top: 8px;
        width: 100%;
        border: 1px dashed rgba(255, 255, 255, 0.1);
    }
    .nav-dropdown-container:hover .nav-dropdown,
    .nav-dropdown-container.is-open .nav-dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

@media (max-width: 600px) {
    .app-header { padding: 0 12px; }
    .role-simulator-container { display: none; }
}
.app-main {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - var(--header-height) - 150px);
    flex: 1;
}

@media (max-width: 768px) {
    .app-main { padding: 16px; }
}

.responsive-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
}

footer {
    padding: 60px 24px;
    text-align: center;
    background: linear-gradient(to top, rgba(99, 102, 241, 0.05), transparent);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-top-nav-item i {
    font-size: 1rem;
    transition: var(--transition-standard);
    opacity: 0.7;
}

.app-top-nav-item:hover {
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.app-top-nav-item:hover i {
    opacity: 1;
    transform: scale(1.1);
    color: var(--color-primary);
}

.app-top-nav-item.active {
    color: white;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.app-top-nav-item.active i {
    color: var(--color-primary);
    opacity: 1;
}

/* Dropdown System */
.nav-dropdown-container {
    position: relative;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    min-width: 220px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
}

.nav-dropdown-container:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding-left: 20px;
}

.dropdown-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
}

/* ============================================
   BENTO SURFACES
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: var(--border-radius);
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-standard);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-bright);
    box-shadow: var(--shadow-xl);
}

/* Card Aurora Glow */
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.05), transparent 70%);
    opacity: 0;
    transition: var(--transition-standard);
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
}

/* Custom Scrollbar for Aurora */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* ============================================
   SHARED WIDGETS - BENTO COMPONSENTS
   ============================================ */

.stat-card {
    background: linear-gradient(145deg, rgba(22, 30, 52, 0.9), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 32px;
    border-radius: 24px;
    backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 24px;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    background: linear-gradient(145deg, rgba(30, 41, 71, 0.95), rgba(22, 30, 52, 0.9));
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--color-primary), transparent 70%);
    opacity: 0.1;
    filter: blur(20px);
    transition: var(--transition-standard);
}

.stat-card:hover::after {
    opacity: 0.2;
    transform: scale(1.5);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: var(--text-pure);
    background: linear-gradient(135deg, #fff 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

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

/* ============================================
   AURORA MODAL SYSTEM
   ============================================ */

.aurora-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aurora-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.aurora-modal {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aurora-modal-overlay.active .aurora-modal {
    transform: scale(1) translateY(0);
}

.aurora-modal-header {
    padding: 32px 32px 16px;
    text-align: center;
}

.aurora-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.aurora-modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.aurora-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    font-family: 'Outfit';
    margin-bottom: 8px;
}

.aurora-modal-body {
    padding: 0 32px 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.aurora-modal-footer {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
}

.aurora-modal-footer button {
    flex: 1;
    padding: 14px;
    border-radius: 16px;
    font-weight: 800;
    font-family: 'Outfit';
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.aurora-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.aurora-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.aurora-modal-btn-confirm {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.aurora-modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
}

.aurora-modal-btn-confirm.danger {
    background: var(--color-accent);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
}

.aurora-modal-btn-confirm.danger:hover {
    box-shadow: 0 12px 24px rgba(244, 63, 94, 0.4);
}

/* ============================================
   ROLE SIMULATION STYLES
   ============================================ */

.role-simulator-container {
    position: relative;
    margin-right: 15px;
}

.simulator-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.simulator-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
    color: white;
}

.simulator-btn.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.simulator-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 16px;
    width: 220px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
    z-index: 1100;
    backdrop-filter: none;
}

.simulator-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.simulator-item {
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.simulator-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.simulator-item.current {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

.simulator-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 10px;
}

.simulation-banner {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.1), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
    margin: 20px 40px 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease-out;
}

.simulation-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fbbf24;
    font-size: 0.95rem;
    font-weight: 500;
}

.simulation-stop-btn {
    background: #fbbf24;
    color: #000;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simulation-stop-btn:hover {
    background: #f59e0b;
    transform: scale(1.05);
}

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