/* ============================================================
   GLOBAL.CSS — MediaStream Unified Design System
   Shared across all main site pages (excl. mstplay / mstplay2)
   ============================================================ */

/* ── 1. Design Tokens ────────────────────────────────────── */
:root {
    /* Background */
    --bg-base: #fdfdfd;
    --bg-gradient: radial-gradient(125% 185% at 50% -20%,
            rgba(118, 43, 222, 0.08) 0%,
            rgba(38, 105, 245, 0.06) 45%,
            rgba(10, 16, 32, 0) 100%);
    --glow-gradient: radial-gradient(80% 80% at 10% 10%,
            rgba(118, 43, 222, 0.12) 0%,
            rgba(38, 105, 245, 0.1) 35%,
            rgba(0, 0, 0, 0) 100%);

    /* Glass */
    --glass-surface: rgba(255, 255, 255, 0.82);
    --glass-strong: rgba(255, 255, 255, 0.95);
    --glass-soft: rgba(255, 255, 255, 0.68);
    --glass-border: rgba(17, 33, 77, 0.12);
    --glass-border-soft: rgba(17, 33, 77, 0.08);

    /* Typography colors */
    --text-primary: #111b2b;
    --text-secondary: #36435a;
    --text-muted: #7b8699;

    /* Accent */
    --accent-gradient: url('./imagenes/discord_gradient.png') center/cover no-repeat;
    --accent-gradient-css: linear-gradient(135deg, #762BDE 0%, #3B76C3 40%, #00C1A7 70%, #2669F5 100%);
    --accent-solid: #3B76C3;

    /* Elevation */
    --shadow-xl: 0 40px 80px rgba(27, 44, 94, 0.18);
    --shadow-lg: 0 24px 60px rgba(17, 36, 88, 0.14);
    --shadow-md: 0 18px 42px rgba(23, 30, 70, 0.18);
    --shadow-sm: 0 14px 32px rgba(28, 44, 84, 0.12);

    /* Radius */
    --radius-xl: 32px;
    --radius-lg: 26px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --radius-pill: 999px;

    /* Misc */
    scroll-behavior: smooth;
}

/* ── 2. Typography — @font-face ──────────────────────────── */
@font-face {
    font-family: "ViataRegular";
    src: url("fonts/viata-regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "ViataBold";
    src: url("fonts/viata-bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "ViataExtraBold";
    src: url("fonts/viata-extrabold.ttf") format("truetype");
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: "ViataLight";
    src: url("fonts/viata-light.ttf") format("truetype");
    font-weight: 300;
    font-display: swap;
}

/* ── 3. Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "ViataRegular", "Inter", system-ui, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.4s ease, color 0.3s ease;
}

/* Subtle ambient gradients behind content */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
}

body::before {
    background: var(--bg-gradient);
    opacity: 0.22;
}

body::after {
    background: var(--glow-gradient);
    opacity: 0.45;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "ViataBold", sans-serif;
    color: var(--text-primary);
}

p,
li {
    color: var(--text-secondary);
    line-height: 1.7;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── 4. Shared Layout ────────────────────────────────────── */
.page-container {
    width: min(1200px, 100%);
    padding: 0 24px 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(40px, 6vw, 64px);
}

#footer-container {
    width: 100%;
}

/* ── 5. Shared Section Intro (used on many pages) ────────── */
.section-intro {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    max-width: 680px;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    font-family: "ViataBold", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(40, 52, 176, 0.18), rgba(176, 59, 174, 0.16));
    border: 1px solid rgba(40, 52, 176, 0.24);
    color: #243168;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.section-tag::before,
.section-tag::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.9;
}

.section-title {
    font-family: "ViataExtraBold", sans-serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: clamp(0.95rem, 2.4vw, 1.05rem);
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ── 6. Shared Lightbox ──────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 6vw, 48px);
    background: rgba(10, 16, 32, 0.78);
    backdrop-filter: blur(12px);
    z-index: 1500;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.is-open {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: min(1080px, 92vw);
    max-height: calc(100vh - 152px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #05070f;
    box-shadow: 0 34px 80px rgba(5, 8, 18, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: inherit;
    object-fit: contain;
    background: #05070f;
}

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.92);
    color: #111b2b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 36px rgba(12, 18, 36, 0.24);
    transition: transform 0.2s ease, background 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.98);
}

body.no-scroll {
    overflow: hidden;
}

/* ── 7. Dark Mode — Complete System ──────────────────────── */
body.dark-mode {
    --bg-base: #0f172a;
    --bg-gradient: radial-gradient(125% 185% at 50% -20%,
            rgba(118, 43, 222, 0.15) 0%,
            rgba(10, 16, 32, 0.95) 45%,
            #02040a 100%);
    --glow-gradient: radial-gradient(80% 80% at 10% 10%,
            rgba(118, 43, 222, 0.18) 0%,
            rgba(38, 105, 245, 0.15) 35%,
            rgba(0, 0, 0, 0) 100%);
    --glass-surface: rgba(30, 41, 59, 0.75);
    --glass-strong: rgba(30, 41, 59, 0.9);
    --glass-soft: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-soft: rgba(255, 255, 255, 0.05);
    --text-primary: #f0f6fc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    background: var(--bg-base);
}

/* Dark mode - Section components */
body.dark-mode .section-tag {
    background: linear-gradient(135deg, rgba(118, 43, 222, 0.25), rgba(59, 118, 195, 0.2));
    border-color: rgba(118, 43, 222, 0.35);
    color: #c4b5fd;
}

/* Dark mode — Glass surfaces (hero shells, cards, panels) */
body.dark-mode .partner-card,
body.dark-mode .timeline-block,
body.dark-mode .casting-card,
body.dark-mode .magazine-card,
body.dark-mode .program-card,
body.dark-mode .team-category-card,
body.dark-mode .team-member-card,
body.dark-mode .info-card,
body.dark-mode .record-card,
body.dark-mode .card-news,
body.dark-mode .article {
    background: var(--glass-surface) !important;
    border-color: var(--glass-border) !important;
    color: var(--text-primary);
}

/* Dark mode — Meta badges & pills */
body.dark-mode .history-hero-meta,
body.dark-mode .partners-hero-meta,
body.dark-mode .mstplay-hero-meta,
body.dark-mode .participa-hero-meta,
body.dark-mode .team-hero-meta,
body.dark-mode .music-hero-meta,
body.dark-mode .timeline-label,
body.dark-mode .program-card-tag,
body.dark-mode .program-badge {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Dark mode — Partner card media overlay */
body.dark-mode .partner-card-media {
    border-color: rgba(255, 255, 255, 0.06);
}

/* Dark mode — Kickers */
body.dark-mode .history-hero-kicker,
body.dark-mode .partners-hero-kicker,
body.dark-mode .mstplay-hero-kicker,
body.dark-mode .music-hero-kicker,
body.dark-mode .participa-hero-kicker,
body.dark-mode .team-hero-kicker {
    background: linear-gradient(135deg, rgba(118, 43, 222, 0.25), rgba(59, 118, 195, 0.2));
    border-color: rgba(118, 43, 222, 0.35);
    color: #c4b5fd;
}

/* Dark mode — Typography overrides */
body.dark-mode .history-hero-description,
body.dark-mode .partners-hero-description,
body.dark-mode .mstplay-hero-description,
body.dark-mode .music-hero-description,
body.dark-mode .participa-hero-description,
body.dark-mode .team-hero-description,
body.dark-mode .timeline-text,
body.dark-mode .partner-card-description,
body.dark-mode .program-card-description,
body.dark-mode .casting-card-description {
    color: var(--text-secondary);
}

body.dark-mode .history-hero-title,
body.dark-mode .partners-hero-title,
body.dark-mode .partner-card-title,
body.dark-mode .timeline-title,
body.dark-mode .team-hero-title,
body.dark-mode .program-card-title,
body.dark-mode .casting-card-title,
body.dark-mode .magazine-card-title,
body.dark-mode .team-member-name {
    color: var(--text-primary);
}

/* Dark mode — Buttons keep their gradient so they stay vibrant */
body.dark-mode .partner-card-button,
body.dark-mode .mstplay-hero-button,
body.dark-mode .participa-hero-button,
body.dark-mode .casting-card-button,
body.dark-mode .store-highlight-button,
body.dark-mode .team-hero-button,
body.dark-mode .join-highlight-button {
    color: #ffffff !important;
}

/* Dark mode — Disabled/secondary buttons */
body.dark-mode .partner-card-button.disabled {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.7), rgba(51, 65, 85, 0.6));
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Dark mode — Search / filter controls */
body.dark-mode .search-wrap {
    background: var(--glass-surface);
    border-color: var(--glass-border);
}

body.dark-mode .search-input {
    color: var(--text-primary);
}

body.dark-mode .search-input::placeholder {
    color: var(--text-muted);
}

body.dark-mode .chip {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

body.dark-mode .chip.is-active {
    color: #fff;
}

/* Dark mode — Noticias */
body.dark-mode .card-news {
    background: var(--glass-surface) !important;
}

body.dark-mode .card-body .title,
body.dark-mode .article h1,
body.dark-mode .article h2 {
    color: var(--text-primary);
}

body.dark-mode .excerpt,
body.dark-mode .article p {
    color: var(--text-secondary);
}

body.dark-mode .btn-read {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .breadcrumbs {
    color: var(--text-muted);
}

body.dark-mode .page-title {
    color: var(--text-primary);
}

body.dark-mode .news-meta {
    color: var(--text-muted);
}

body.dark-mode .empty {
    background: var(--glass-surface);
    border-color: var(--glass-border);
    color: var(--text-muted);
}

body.dark-mode select.chip,
body.dark-mode input.chip {
    background-color: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .share .chip {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary);
}

/* Dark mode — Legal pages */
body.dark-mode .legal-hero {
    background: var(--glass-surface);
    border-color: var(--glass-border);
}

body.dark-mode .legal-back {
    color: var(--text-muted);
}

body.dark-mode .legal-back:hover {
    color: var(--text-primary);
}

body.dark-mode .legal-tag {
    background: linear-gradient(135deg, rgba(118, 43, 222, 0.25), rgba(59, 118, 195, 0.2));
    border-color: rgba(118, 43, 222, 0.35);
    color: #c4b5fd;
}

body.dark-mode .legal-article h2 {
    color: var(--text-primary);
}

body.dark-mode .legal-article p,
body.dark-mode .legal-article li {
    color: var(--text-secondary);
}

/* Dark mode — PDF viewer */
body.dark-mode .pdf-viewer-card {
    background: var(--glass-surface);
    border-color: var(--glass-border);
}

body.dark-mode .pdf-nav button {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .pdf-nav button:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Dark mode — Join / CTA highlight sections */
body.dark-mode .join-highlight-shell,
body.dark-mode .store-highlight-shell,
body.dark-mode .cta-card {
    /* These have gradient backgrounds, so we darken them slightly */
    filter: brightness(0.85);
}

/* Dark mode — Logos section already has gradient bg, no change needed */

/* Dark mode — FAQ accordion */
body.dark-mode .accordion-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: none;
}

body.dark-mode .accordion-button.collapsed {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .accordion-button:not(.collapsed) {
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)),
        linear-gradient(90deg, #2834b0 0%, #b03bae 55%, #2669f5 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 1px solid transparent;
    color: #fff;
}

body.dark-mode .accordion-body {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

body.dark-mode .accordion-button::after {
    filter: invert(1) brightness(2);
}

/* Dark mode — Lightbox */
body.dark-mode .lightbox-close {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

body.dark-mode .lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dark mode — Staff modal */
body.dark-mode .staff-modal-content {
    background: linear-gradient(145deg, #1a2030, #111625);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .staff-modal-close {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .staff-modal-desc {
    color: #ccc;
}

body.dark-mode .staff-modal-username {
    color: #aaa;
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .btn-roblox {
    background: #333;
    border-color: #444;
    color: #fff;
}

/* Dark mode — Records section (mediamusic) */
body.dark-mode .records-section {
    background: var(--glass-surface);
    border-color: var(--glass-border);
}

/* ── 8. Responsive Defaults ──────────────────────────────── */
@media (max-width: 768px) {
    .page-container {
        padding: 0 18px 56px;
        gap: 40px;
    }
}

@media (max-width: 640px) {
    .lightbox-overlay {
        padding: clamp(16px, 6vw, 28px);
    }

    .lightbox-close {
        width: 38px;
        height: 38px;
    }
}

/* ── 9. Smooth Transitions ───────────────────────────────── */
/* Make dark/light transitions smooth for key elements */
.page-container,
.section-tag,
.section-title,
.section-subtitle {
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}