/* ============================================================
   WIKI PERSONNEL — TAILADMIN INSPIRED THEME
   Modern Dark, Tailwind-inspired, Rich animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Base colors - Dark mode */
    --bg-primary:    #0f0f1a;
    --bg-secondary:  #141829;
    --bg-tertiary:   #1a1f35;
    --bg-card:       #1e2541;
    --bg-hover:      #252d47;
    
    /* Accents - Vibrant */
    --accent-blue:   #3b82f6;
    --accent-cyan:   #06b6d4;
    --accent-purple: #a855f7;
    --accent-pink:   #ec4899;
    
    /* Text */
    --text-primary:  #f8fafc;
    --text-secondary:#cbd5e1;
    --text-tertiary: #94a3b8;
    
    /* Borders & Shadows */
    --border:        #2d3748;
    --border-light:  #3f4555;
    
    /* Status colors */
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #3b82f6;
    
    /* Fonts */
    --font-sans:     'Inter', sans-serif;
    --font-mono:     'JetBrains Mono', monospace;
    
    /* Animations */
    --transition-fast: 0.15s ease-in-out;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(88, 166, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   CONTAINER & LAYOUT
   ============================================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

main {
    min-height: calc(100vh - 300px);
    margin-top: 30px;
    margin-bottom: 30px;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
header {
    background: rgba(20, 24, 41, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all var(--transition);
}

header > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    transition: all var(--transition);
}

header h1:hover {
    letter-spacing: 0px;
}

header > div > div {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.user-info span {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
}

.logout-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ff6b7a;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.logout-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.2);
}

/* Navigation Menu */
nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(88, 166, 255, 0.1), transparent);
    transition: left var(--transition-fast);
    z-index: -1;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

nav a.active {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    padding: 60px 0;
    margin-bottom: 50px;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ============================================================
   CARDS GRID
   ============================================================ */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 24px;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    group: hover;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 0;
}

.card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

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

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform var(--transition);
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* ============================================================
   CONTENT
   ============================================================ */
.content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 40px;
    transition: all var(--transition);
}

.content:hover {
    border-color: var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}

.content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--accent-blue);
}

.content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.content p {
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.8;
}

.content ul,
.content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.content li {
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.6;
}

.content a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.content a:hover {
    border-bottom-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 4px;
    border-radius: 2px;
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.code-block,
.command {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    color: var(--accent-cyan);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 500;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.command::before {
    content: '$ ';
    color: var(--success);
    font-weight: 700;
    margin-right: 8px;
}

/* ============================================================
   TIP BOXES
   ============================================================ */
.tip-box {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent-blue);
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.tip-box:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateX(4px);
}

.tip-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
}

.tip-box.warning:hover {
    background: rgba(245, 158, 11, 0.15);
}

.tip-box.success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
}

.tip-box.success:hover {
    background: rgba(16, 185, 129, 0.15);
}

.tip-box strong {
    color: var(--accent-blue);
}

.tip-box.warning strong {
    color: var(--warning);
}

.tip-box.success strong {
    color: var(--success);
}

/* ============================================================
   DASHBOARD COMPONENTS
   ============================================================ */
.dashboard-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 40px 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}

.dashboard-grid,
.stats-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card,
.stat-box,
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all var(--transition);
}

.metric-card:hover,
.stat-box:hover,
.service-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
}

.metric-card h3,
.stat-box h3 {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value,
.stat-number {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar {
    background: var(--bg-primary);
    height: 6px;
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ============================================================
   TABLES
   ============================================================ */
.pve-table,
.torrent-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.pve-table th,
.torrent-table th {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 16px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pve-table td,
.torrent-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.pve-table tr:hover td,
.torrent-table tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

.pve-table tr:last-child td,
.torrent-table tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    transition: all var(--transition-fast);
}

.badge-running {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-running:hover {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.badge-stopped {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-stopped:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.status-running {
    color: var(--success);
    font-weight: 700;
}

.status-stopped,
.status-stopped-t {
    color: var(--text-secondary);
}

.status-downloading {
    color: var(--accent-blue);
    font-weight: 700;
}

.status-seeding {
    color: var(--success);
    font-weight: 700;
}

.status-error {
    color: var(--danger);
    font-weight: 700;
}

/* ============================================================
   SERVICES GRID
   ============================================================ */
.service-card {
    text-align: center;
    padding: 24px;
}

.service-card.running {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.service-card.stopped {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
    transition: transform var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card > div:nth-child(2) {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* ============================================================
   MISC ELEMENTS
   ============================================================ */
.empty-msg {
    text-align: center;
    color: var(--text-tertiary);
    padding: 40px 20px;
    font-style: italic;
}

.offline-banner,
.pve-offline-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--warning);
    color: var(--warning);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.quick-link-btn,
.plex-link {
    display: inline-block;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid var(--border);
    color: var(--accent-blue);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 24px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.quick-link-btn:hover,
.plex-link:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
    border-color: var(--accent-blue);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.plex-info {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-left: 4px solid #d97706;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.mini-bar-wrap {
    background: var(--bg-primary);
    height: 6px;
    border-radius: 3px;
    min-width: 80px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.mini-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.mini-bar.warn {
    background: var(--warning);
}

.mini-bar.crit {
    background: var(--danger);
}

.torrent-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-wrap {
    background: var(--bg-primary);
    height: 6px;
    border-radius: 3px;
    min-width: 80px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--border);
}

.progress-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.progress-inner.done {
    background: linear-gradient(90deg, var(--success), #34d399);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 32px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ============================================================
   RECENT SECTION
   ============================================================ */
.recent-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
}

.recent-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent-blue);
}

.recent-section ul {
    list-style: none;
}

.recent-section li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.recent-section li:last-child {
    border-bottom: none;
}

.date {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.85rem;
    margin-right: 12px;
    font-weight: 600;
}

/* ============================================================
   NEWS SECTION
   ============================================================ */
.news-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.news-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-blue);
}

.news-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.news-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    transform: translateX(4px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.1);
}

.news-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.news-content h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.news-date {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* ============================================================
   PLEX SECTION
   ============================================================ */
.plex-info {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.plex-link {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: #f59e0b;
}

.plex-link:hover {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.25), rgba(245, 158, 11, 0.15));
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.2);
}

/* ============================================================
   SUB-MENUS & TABS ANIMATIONS - OPTIMIZED
   ============================================================ */

/* Keyframes fluides et performantes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tabShimmer {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

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

@keyframes contentSlideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Conteneur des onglets */
.tabs-container,
[role="tablist"],
.menu-items,
.sub-menu {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    animation: fadeInDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

/* Boutons onglets */
.tab-button,
.menu-link,
[role="tab"],
.sub-menu-link {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
    
    /* Optimizations */
    transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease;
    
    will-change: color, border-color, background-color, transform;
    transform: translateZ(0);
}

/* Effet shimmer au hover */
.tab-button::before,
.menu-link::before,
[role="tab"]::before,
.sub-menu-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.15) 50%, 
        transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.tab-button:hover::before,
.menu-link:hover::before,
[role="tab"]:hover::before,
.sub-menu-link:hover::before {
    transform: translateX(100%);
}

/* État hover */
.tab-button:hover,
.menu-link:hover,
[role="tab"]:hover,
.sub-menu-link:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12);
}

/* État actif */
.tab-button.active,
.menu-link.active,
[role="tab"][aria-selected="true"],
.sub-menu-link.active {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25),
                inset 0 0 0 1px rgba(6, 182, 212, 0.1);
    transform: translateY(-1px);
    font-weight: 600;
}

/* Contenu des onglets - FLUIDITÉ AMÉLIORÉE */
.tab-content,
.menu-content,
[role="tabpanel"],
.content-section {
    animation: contentFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: auto;
    
    /* GPU acceleration */
    will-change: opacity, transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Variante slide (pour contenu à gauche) */
.tab-content.slide-in,
.menu-content.slide-in,
[role="tabpanel"].slide-in,
.content-section.slide-in {
    animation: contentSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* État caché - transition fluide vers display:none */
.tab-content.hidden,
.menu-content.hidden,
[role="tabpanel"][hidden],
.content-section.hidden {
    display: none;
    animation: none;
}

/* Transition lors du changement de contenu */
.tab-content.leaving,
.menu-content.leaving,
[role="tabpanel"].leaving,
.content-section.leaving {
    animation: contentFadeOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Optimisation pour les sous-menus AJAX */
.submenu-item,
.ajax-content {
    animation: contentFadeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform;
}

/* Variante rapide pour changements fréquents */
.tab-content.fast,
.menu-content.fast {
    animation-duration: 0.2s;
}

/* Désactiver les animations sur les appareils avec préférence réduite */
@media (prefers-reduced-motion: reduce) {
    .tabs-container,
    [role="tablist"],
    .menu-items,
    .sub-menu,
    .tab-button,
    .menu-link,
    [role="tab"],
    .sub-menu-link,
    .tab-content,
    .menu-content,
    [role="tabpanel"],
    .content-section {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.4rem;
    }

    header > div:first-child {
        gap: 12px;
    }

    nav ul {
        gap: 4px;
    }

    nav a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .dashboard-grid,
    .stats-grid,
    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .content {
        padding: 20px;
    }

    .pve-table,
    .torrent-table {
        font-size: 0.85rem;
    }

    .pve-table th,
    .pve-table td,
    .torrent-table th,
    .torrent-table td {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav a {
        width: 100%;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .dashboard-grid,
    .stats-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

    .metric-value,
    .stat-number {
        font-size: 1.8rem;
    }

    .content {
        padding: 16px;
    }
}
