/* ============================================
   40TV - Design Streaming Pro Twitch
   Theme: Dark Mode avec accents Violet/Electrique
   ============================================ */

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

:root {
    /* Couleurs principales - Streaming */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.3);

    --secondary: #ec4899;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Backgrounds */
    --bg-dark: #0b0b0f;
    --bg-darker: #050508;
    --bg-card: rgba(15, 15, 20, 0.85);
    --bg-card-hover: rgba(25, 25, 35, 0.95);
    --bg-glass: rgba(10, 10, 15, 0.7);

    /* Textes */
    --text-primary: #fafafa;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Bordures */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.2);

    /* Gradients */
    --gradient-hero: linear-gradient(
        135deg,
        #1e1b4b 0%,
        #312e81 50%,
        #8b5cf6 100%
    );
    --gradient-card: linear-gradient(
        145deg,
        rgba(139, 92, 246, 0.1) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    --gradient-button: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-admin: linear-gradient(135deg, #1f2937 0%, #111827 100%);

    /* Espacements */
    --radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 20px;

    /* Shadows */
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.2);
    --shadow-glow-strong: 0 0 60px rgba(139, 92, 246, 0.4);

    /* Typographie */
    --font-primary: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    min-height: 100vh;
    background: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(
            ellipse at 20% 30%,
            rgba(139, 92, 246, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 80% 70%,
            rgba(236, 72, 153, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 50% 50%,
            rgba(6, 182, 212, 0.05) 0%,
            transparent 70%
        );
    pointer-events: none;
    z-index: -1;
}

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

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
}
h2 {
    font-size: clamp(1.8rem, 5vw, 3rem);
}
h3 {
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
}
h4 {
    font-size: 1.2rem;
}

.text-primary {
    color: var(--primary);
}
.text-secondary {
    color: var(--text-secondary);
}
.text-muted {
    color: var(--text-muted);
}
.text-success {
    color: var(--success);
}
.text-danger {
    color: var(--danger);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: -0.03em;
    background: var(--gradient-button);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-button);
    opacity: 0;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link:hover::before {
    opacity: 0.1;
}

.nav-link.active {
    color: var(--primary);
    background: var(--gradient-button);
}

.nav-link.active::before {
    opacity: 0.2;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.menu-toggle:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-button);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn:hover::before {
    opacity: 0.15;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-button);
    color: var(--text-primary);
    border-color: transparent;
}

.btn-primary::before {
    opacity: 0.3;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-strong);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--bg-card);
}

.btn-green {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-green:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.btn-red {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-red:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-dark {
    background: var(--bg-darker);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-dark:hover {
    border-color: var(--primary);
}

.btn-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow:
            0 0 40px rgba(139, 92, 246, 0.6),
            0 0 60px rgba(139, 92, 246, 0.2);
    }
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: badge-pulse 3s ease-in-out infinite;
}

.badge.live {
    background: var(--danger);
    animation: live-pulse 1.5s ease-in-out infinite;
}

.badge.live .live-dot {
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.badge.green {
    background: var(--success);
}

.badge.outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

@keyframes badge-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

@keyframes live-pulse {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

@keyframes dot-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.15);
    }
    75% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--gradient-hero);
    color: var(--text-primary);
    min-height: 500px;
    display: grid;
    align-items: end;
    padding: 80px 24px 60px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse at 30% 50%,
            rgba(255, 255, 255, 0.03) 0%,
            transparent 40%
        ),
        linear-gradient(180deg, transparent 0%, rgba(5, 5, 8, 0.4) 100%);
    pointer-events: none;
}

.hero-inner {
    width: min(1400px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 32px;
    align-items: end;
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin: 16px 0 20px;
    max-width: 700px;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
    max-width: 600px;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions .btn {
    min-height: 48px;
    padding: 0 28px;
    font-size: 1rem;
}

/* Hero Panel (Right Side) */
.hero-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.now-card {
    display: grid;
    gap: 16px;
}

.now-card strong {
    font-size: 1.3rem;
    display: block;
    color: var(--text-primary);
}

.now-card p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
}

.now-card .btn {
    width: 100%;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 56px 0;
}

.section.full {
    width: 100%;
    max-width: none;
    background: transparent;
    border: none;
}

.section-inner {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 56px 0;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.section-header h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.1;
    font-weight: 900;
    color: var(--text-primary);
}

.section-header p,
.section-subtitle {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   CARDS & GRIDS
   ============================================ */
.vod-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.vod-card,
.content-card,
.program-card,
.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.vod-card::before,
.content-card::before,
.program-card::before,
.stats-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: var(--transition);
}

.vod-card:hover,
.content-card:hover,
.program-card:hover,
.stats-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.vod-card:hover::before,
.content-card:hover::before,
.program-card:hover::before,
.stats-card:hover::before {
    opacity: 1;
}

.vod-thumbnail,
.vod-thumb,
.poster {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(
        135deg,
        var(--primary-dark) 0%,
        var(--primary) 100%
    );
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 900;
    object-fit: cover;
    position: relative;
    overflow: hidden;
}

.vod-thumbnail::after,
.vod-thumb::after,
.poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(5, 5, 8, 0.8) 100%
    );
    pointer-events: none;
}

.vod-info,
.vod-content,
.card-body {
    padding: 24px;
}

.vod-title,
.card-body h3 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    line-height: 1.25;
    font-weight: 900;
    color: var(--text-primary);
}

.vod-meta,
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.vod-meta span,
.meta span {
    background: var(--bg-darker);
    padding: 4px 10px;
    border-radius: 999px;
}

.vod-description,
.card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 20px;
}

.card-body .btn {
    width: 100%;
}

/* ============================================
   TWITCH PLAYER SECTION
   ============================================ */
.twitch-section {
    background: var(--bg-darker);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.twitch-header {
    min-height: 56px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--text-primary);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.twitch-header strong {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.twitch-header .status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.twitch-embed-container {
    aspect-ratio: 16 / 9;
    background: #0e0e10;
    position: relative;
    overflow: hidden;
}

.twitch-embed-container #twitch-embed {
    width: 100% !important;
    height: 100% !important;
}

.twitch-embed-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.twitch-offline {
    aspect-ratio: 16 / 9;
    background: linear-gradient(
        135deg,
        var(--bg-darker) 0%,
        var(--bg-dark) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    text-align: center;
}

.twitch-offline i {
    font-size: 4rem;
    color: var(--text-muted);
}

.twitch-offline strong {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.twitch-offline p {
    color: var(--text-secondary);
    max-width: 400px;
}

/* ============================================
   INFO STRIP
   ============================================ */
.info-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.info-item {
    padding: 24px;
    border-right: 1px solid var(--border-color);
}

.info-item:last-child {
    border-right: 0;
}

.info-item span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.info-item strong {
    display: block;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 900;
}

/* ============================================
   PLAYER (pour replays)
   ============================================ */
.player-shell {
    overflow: hidden;
    background: var(--bg-darker);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.player-top {
    min-height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--text-primary);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.player-top strong {
    font-size: 1rem;
    font-weight: 700;
}

.player-top span {
    font-size: 0.85rem;
    color: var(--success);
}

.player-frame {
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
}

.player-frame iframe,
.player-frame video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ============================================
   RAIL (Horizontal Scroll)
   ============================================ */
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding: 4px 4px 24px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    position: relative;
}

.rail::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent 0%, var(--bg-darker) 100%);
    pointer-events: none;
}

.rail::-webkit-scrollbar {
    height: 6px;
}

.rail::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 999px;
}

.rail::-webkit-scrollbar-track {
    background: transparent;
}

/* ============================================
   SCHEDULE / PROGRAMMES
   ============================================ */
.schedule {
    display: grid;
    grid-template-columns: repeat(7, minmax(180px, 1fr));
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.day {
    min-width: 180px;
    border-right: 1px solid var(--border-color);
}

.day:last-child {
    border-right: 0;
}

.day-title {
    padding: 16px;
    background: var(--primary-dark);
    color: var(--text-primary);
    font-weight: 900;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slot {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.slot time {
    display: block;
    color: var(--primary);
    font-weight: 900;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.slot strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
}

.slot p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.category-btn {
    min-height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-darker);
}

.category-btn.active {
    background: var(--gradient-button);
    border-color: transparent;
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   AUTH PAGES (Login, Register, Profile)
   ============================================ */
.form-page {
    min-height: calc(100vh - 72px);
    display: grid;
    grid-template-columns: 1fr 440px;
    background: var(--bg-darker);
}

.form-visual {
    display: flex;
    align-items: end;
    padding: 80px;
    background: var(--gradient-hero);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.form-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse at 70% 30%,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 40%
        ),
        linear-gradient(180deg, transparent 0%, rgba(5, 5, 8, 0.4) 100%);
    pointer-events: none;
}

.form-visual h1 {
    margin: 0;
    max-width: 600px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    font-weight: 900;
}

.form-visual p {
    max-width: 500px;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
}

.auth-card {
    align-self: center;
    width: min(440px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
}

.auth-card p {
    color: var(--text-secondary);
    margin: 0 0 28px;
}

.form-group {
    margin-top: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-darker);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-divider::before,
.form-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ============================================
   PROFILES
   ============================================ */
.profiles-page {
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 40px;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0;
}

.profiles-brand {
    justify-self: center;
    text-align: center;
}

.profiles-brand .brand-mark span:first-child {
    color: var(--text-primary);
}

.profiles-brand .brand-mark span:last-child {
    color: var(--primary);
}

.profiles-panel {
    display: grid;
    gap: 32px;
}

.profiles-panel .section-header {
    align-items: center;
    text-align: center;
}

.profiles-panel h1 {
    margin: 12px 0 8px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
    color: var(--text-primary);
}

.profiles-panel p {
    color: var(--text-secondary);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-content: center;
}

.profile-tile {
    min-height: 260px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 16px;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.profile-tile:hover {
    transform: translateY(-6px);
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.profile-tile.admin {
    border-color: var(--secondary);
}

.profile-tile.admin:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.3);
}

.profile-avatar-large {
    width: 120px;
    aspect-ratio: 1;
    border: 4px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 900;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-tile:hover .profile-avatar-large {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow-strong);
}

.profile-tile.admin .profile-avatar-large {
    border-color: var(--secondary);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.3);
}

.profile-tile strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.profile-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.profile-actions-row .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.85rem;
}

.add-profile-main {
    justify-self: center;
}

/* Profile Modal */
#profileModal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 5, 8, 0.95);
    backdrop-filter: blur(10px);
}

#profileModal.hidden {
    display: none !important;
}

.profile-editor {
    width: min(480px, 100%);
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-dark);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.profile-editor h2 {
    margin: 0 0 20px;
    font-size: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.profile-colors {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.color-choice {
    width: 44px;
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.color-choice:hover {
    transform: scale(1.15);
}

.color-choice.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.admin-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    background: var(--bg-darker);
}

.admin-sidebar {
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.admin-brand .brand-mark {
    font-size: 1.5rem;
}

.admin-nav {
    display: grid;
    gap: 4px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.admin-nav a.active {
    color: var(--primary);
    background: var(--bg-card);
    border-left-color: var(--primary);
}

.admin-main {
    padding: 32px;
    overflow-y: auto;
}

.admin-header {
    margin-bottom: 32px;
}

.admin-header h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.admin-header p {
    color: var(--text-secondary);
    margin: 0;
}

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

.stats-card {
    padding: 24px;
}

.stats-card .stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin: 8px 0;
}

.stats-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-card .stat-change {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
}

.stats-card .stat-change.negative {
    color: var(--danger);
}

.admin-section {
    margin-top: 32px;
}

.admin-section h2 {
    margin: 0 0 20px;
    font-size: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table thead {
    background: var(--bg-dark);
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    margin-top: 60px;
    background: var(--bg-darker);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 56px 0;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 32px;
}

.footer h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.footer p,
.footer a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary-light);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}
.max-w-6xl {
    width: min(1400px, calc(100% - 48px));
}
.max-w-md {
    max-width: 460px;
}
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}
.px-4 {
    padding-left: 16px;
    padding-right: 16px;
}
.mt-4 {
    margin-top: 16px;
}
.w-full {
    width: 100%;
}
.text-center {
    text-align: center;
}
.flex {
    display: flex;
}
.gap-3 {
    gap: 12px;
}

/* ============================================
   RESPONSIVE - TABLET & MOBILE
   ============================================ */
@media (max-width: 1200px) {
    .admin-container {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .admin-nav a {
        flex: 1 0 150px;
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: none;
    }

    .form-page {
        grid-template-columns: 1fr;
    }

    .form-visual {
        min-height: 300px;
        padding: 48px 32px;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        order: 2;
    }

    .header-actions {
        margin-left: 0;
        width: 100%;
        order: 3;
    }

    .header-actions .btn {
        flex: 1;
        padding: 0 12px;
    }

    .nav-menu {
        order: 4;
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .nav-menu.open {
        display: grid;
    }

    .hero {
        padding-top: 90px;
        min-height: 450px;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }

    .section,
    .section-inner,
    .footer-content {
        width: min(100% - 24px, 1400px);
    }

    .info-strip {
        grid-template-columns: 1fr 1fr;
    }

    .info-item:nth-child(2) {
        border-right: 0;
    }

    .schedule {
        grid-template-columns: repeat(2, 1fr);
    }

    .day:nth-child(2n) {
        border-right: 0;
    }

    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 480px) {
    .topbar {
        padding: 12px;
    }

    .brand-mark {
        font-size: 1.4rem;
    }

    .brand img {
        height: 32px;
    }

    .hero {
        padding: 80px 16px 48px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .rail {
        grid-auto-columns: minmax(220px, 90vw);
    }

    .vod-grid,
    .card-grid {
        grid-template-columns: 1fr;
    }

    .form-visual {
        padding: 32px 24px;
    }

    .form-visual h1 {
        font-size: 2rem;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-links {
        text-align: center;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   TWITCH CHAT OVERLAY (Optionnel)
   ============================================ */
.twitch-chat-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 350px;
    max-height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.twitch-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.twitch-chat-header strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.twitch-chat-close {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.twitch-chat-close:hover {
    color: var(--danger);
}

.twitch-chat-frame {
    height: calc(100% - 45px);
    background: var(--bg-darker);
}

.twitch-chat-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
