/* ============================================
   40TV+ - Professional Streaming Identity
   ============================================ */

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

:root {
    /* Colors - Cinematic Dark Theme */
    --bg-main: #0f0f0f;
    --bg-header: rgba(15, 15, 15, 0.95);
    --bg-card: #1a1a1a;
    --bg-card-hover: #2a2a2a;

    --primary: #ffffff;
    --primary-alt: #e5e5e5;
    --accent: #1a4623; /* TF1+ Blue inspired */
    --live-red: #25b318; /* Netflix Red inspired */

    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --text-dim: #737373;

    --border: rgba(255, 255, 255, 0.1);

    /* Spacing & Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Fonts */
    --font-sans:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;

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

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

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

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.text-accent {
    color: var(--accent);
}
.text-live {
    color: var(--live-red);
}
.text-muted {
    color: var(--text-muted);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
    border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 10%, transparent);
    transition: background 0.3s ease;
}

.site-header.scrolled {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
}

.topbar {
    max-width: 1600px;
    margin: 0 auto;
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 4%;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand img {
    height: 32px;
}

.brand-mark {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--accent);
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Billboard (Hero) */
.hero {
    position: relative;
    height: 80vh;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 4%;
    overflow: hidden;
    background:
        linear-gradient(to right, rgba(0, 0, 0, 0.8) 30%, transparent 70%),
        url("../img/hero-placeholder.jpg") center/cover no-repeat;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, var(--bg-main), transparent);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

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

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-alt);
}

.btn-secondary {
    background: rgba(109, 109, 110, 0.7);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(109, 109, 110, 0.4);
}

/* Rows & Rails */
.section {
    padding: 40px 0;
    margin: 0 4%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-behavior: smooth;
}

.rail::-webkit-scrollbar {
    display: none;
}

/* Cards */
.content-card {
    flex: 0 0 auto;
    width: 250px;
    aspect-ratio: 16/9;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.content-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.content-card .poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
}

.content-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-live {
    background: var(--live-red);
    color: #fff;
}

/* Player Area */
.player-container {
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    padding: 80px 4% 40px;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    color: var(--text-dim);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 0.85rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
}

/* Auth / Forms */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        url("../img/login-bg.jpg") center/cover;
}

.auth-card {
    background: rgba(0, 0, 0, 0.75);
    padding: 60px;
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-sm);
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 16px;
    background: #333;
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
}

.btn-large {
    width: 100%;
    padding: 16px;
    background: var(--live-red);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .topbar {
        gap: 16px;
    }
    .nav-menu {
        display: none;
    } /* Mobile menu simplified for now */
    .hero {
        height: 60vh;
    }
}

/* ============================================
   PROFILES - Choice & Management
   ============================================ */
.profiles-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 4%;
}

.profiles-brand {
    margin-bottom: 40px;
}

.profiles-panel {
    text-align: center;
    width: 100%;
    max-width: 1000px;
}

.profiles-panel h1 {
    font-size: 3rem;
    margin-bottom: 32px;
}

.profile-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    margin-bottom: 60px;
}

.profile-tile {
    width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.profile-avatar-large {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-sm);
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    transition: var(--transition);
    border: 3px solid transparent;
}

.profile-tile:hover .profile-avatar-large {
    border-color: #fff;
}

.profile-tile strong {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 500;
}

.profile-tile:hover strong {
    color: #fff;
}

.profile-actions-row {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.profile-actions-row .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

.profile-actions-row .btn:hover {
    color: #fff;
    border-color: #fff;
}

/* Profile Modal & Editor */
.profile-editor {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-colors {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-choice {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-choice.active {
    border: 2px solid #fff;
    transform: scale(1.1);
}

.add-profile-main {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
}

.add-profile-main:hover {
    border-color: #fff;
    color: #fff;
}

/* Utilities */
.modal.hidden {
    display: none !important;
}
.w-full {
    width: 100%;
}
