/* ================================================ */
/*  WHITE LABEL DESIGN SYSTEM - THEME AWARE        */
/*  Uses CSS variables from theme-system.css       */
/*  Supports both Light and Dark themes            */
/* ================================================ */

/* ===== TYPOGRAPHY - ITALICS FOR TITLES ===== */
h1, h2, h3, h4, h5, h6 {
    font-style: italic;
}

/* ===== BASE STYLES - FIXED OVERFLOW ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* ===== TYPOGRAPHY - THEME AWARE ===== */
h1, h2, h3, h4, h5, h6, p, span, a, li, label, input, button {
    color: var(--text-primary);
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.3;
}

h4 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
}

p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* ===== DOT PATTERN SYSTEM ===== */
.dot-pattern {
    position: relative;
}

.dot-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.dot-pattern-dense::before {
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
}

.dot-pattern-sparse::before {
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
}

/* Accent variants — slightly more visible */
.dot-pattern-accent-primary::before {
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
}

.dot-pattern-accent-secondary::before {
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
}

/* Ensure content appears above dot pattern */
.dot-pattern > * {
    position: relative;
    z-index: 2;
}

/* ===== CARD SYSTEM - BENTO BOXES ===== */
.card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 5%, transparent) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.card > * {
    position: relative;
    z-index: 2;
}

.card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== GRADIENT ACCENT CARDS ===== */
.card-gradient {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 1.5rem;
    overflow: hidden;
}

/* Gradient overlay */
.card-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-soft);
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.card-gradient:hover::after {
    opacity: 0.12;
}

/* Primary accent variant */
.card-gradient-primary::after {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent-primary) 20%, transparent) 0%,
        color-mix(in srgb, var(--accent-primary) 0%, transparent) 100%);
}

/* Secondary accent variant */
.card-gradient-secondary::after {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent-secondary) 20%, transparent) 0%,
        color-mix(in srgb, var(--accent-secondary) 0%, transparent) 100%);
}

/* Radial glow for gradient cards */
.card-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 8%, transparent) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
}

.card-gradient > * {
    position: relative;
    z-index: 3;
}

/* ===== FADE OVERLAYS (Theme-aware) ===== */
.fade-to-bg-bottom {
    position: relative;
}

.fade-to-bg-bottom::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--gradient-fade);
    pointer-events: none;
    z-index: 1;
}

.fade-to-bg-top {
    position: relative;
}

.fade-to-bg-top::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, var(--bg-primary) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Primary button with gradient */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: var(--glow-effect);
}

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

/* Ghost button */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-ghost:hover {
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    border-color: var(--accent-primary);
}

/* Gradient accent button */
.btn-accent {
    background: var(--bg-tertiary);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
    color: var(--text-primary);
    position: relative;
}

.btn-accent::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-accent:hover::before {
    opacity: 0.1;
}

.btn-accent:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 50%, transparent);
    box-shadow: var(--glow-effect);
}

/* ===== FLOATING ELEMENTS ===== */
.floating-card {
    position: relative;
    background: color-mix(in srgb, var(--bg-tertiary) 80%, transparent);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.floating-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    opacity: 0.6;
}

.floating-card > * {
    position: relative;
    z-index: 2;
}

/* ===== GRADIENT BORDERS ===== */
.border-gradient {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 1.5rem;
    padding: 2px;
}

.border-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    border-radius: inherit;
    padding: 2px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.border-gradient-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: calc(1.5rem - 2px);
    padding: 2rem;
    z-index: 1;
}

/* ===== GLOW EFFECTS ===== */
.glow-primary {
    box-shadow: var(--glow-effect);
}

.glow-soft {
    box-shadow: var(--shadow-xl);
}

/* ===== HERO GRADIENT BACKGROUND - FIXED ===== */
.hero-gradient {
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

.hero-gradient::before {
    content: "";
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 120%;
    background: radial-gradient(
        circle at center top,
        color-mix(in srgb, var(--accent-primary) 8%, transparent) 0%,
        color-mix(in srgb, var(--accent-secondary) 4%, transparent) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
}

.hero-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
}

.hero-gradient > * {
    position: relative;
    z-index: 3;
}

/* ===== UTILITY CLASSES ===== */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }

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

.rounded-xl { border-radius: 1rem; }
.rounded-2xl { border-radius: 1.5rem; }
.rounded-3xl { border-radius: 2rem; }

/* ===== IMAGE CONTAINERS ===== */
.image-gradient-overlay {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.image-gradient-overlay img {
    display: block;
    width: 100%;
    height: auto;
}

.image-gradient-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-primary) 20%, transparent) 0%,
        transparent 50%,
        color-mix(in srgb, var(--accent-secondary) 20%, transparent) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-gradient-overlay:hover::after {
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .card,
    .card-gradient {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    /* Ensure no overflow on mobile */
    .hero-gradient::before {
        width: 100%;
        left: 0;
    }
}

/* ===== SCROLL ENTRANCE ANIMATIONS ===== */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.55s ease;
}
.fade-in.visible {
    opacity: 1;
}

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.stagger-children.visible > *:nth-child(1) { opacity:1; transform:none; transition-delay:0ms; }
.stagger-children.visible > *:nth-child(2) { opacity:1; transform:none; transition-delay:60ms; }
.stagger-children.visible > *:nth-child(3) { opacity:1; transform:none; transition-delay:120ms; }
.stagger-children.visible > *:nth-child(4) { opacity:1; transform:none; transition-delay:180ms; }
.stagger-children.visible > *:nth-child(5) { opacity:1; transform:none; transition-delay:240ms; }
.stagger-children.visible > *:nth-child(6) { opacity:1; transform:none; transition-delay:300ms; }


/* ===== SKELETON LOADING STATES ===== */
@keyframes skeleton-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--bg-tertiary) 80%, transparent) 25%,
        color-mix(in srgb, var(--accent-primary) 8%, var(--bg-tertiary)) 50%,
        color-mix(in srgb, var(--bg-tertiary) 80%, transparent) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
    border-radius: 0.5rem;
}

.skeleton-card {
    background: var(--bg-secondary);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 10%, transparent);
    border-radius: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
}

.skeleton-line {
    height: 0.875rem;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
}

.skeleton-line.wide  { width: 80%; }
.skeleton-line.mid   { width: 55%; }
.skeleton-line.short { width: 35%; }
.skeleton-line.full  { width: 100%; }

.skeleton-circle {
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-badge {
    height: 1.5rem;
    width: 5rem;
    border-radius: 9999px;
}

/* Empty state with skeleton background hint */
.empty-state-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid color-mix(in srgb, var(--accent-primary) 12%, transparent);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-skeleton::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(
        ellipse at 0% 100%,
        color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%,
        transparent 65%
    );
    pointer-events: none;
}

.empty-state-icon {
    width: 4rem; height: 4rem;
    border-radius: 0.875rem;
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    border: 2px solid color-mix(in srgb, var(--accent-primary) 25%, transparent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--accent-primary);
    font-size: 1.25rem;
    position: relative; z-index: 1;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    position: relative; z-index: 1;
}

.empty-state-desc {
    color: var(--text-tertiary);
    font-size: 0.925rem;
    max-width: 28rem;
    margin: 0 auto;
    position: relative; z-index: 1;
    line-height: 1.6;
}

/* Inline skeleton rows (for loading lists) */
.skeleton-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--accent-primary) 3%, transparent);
}
.skeleton-row:last-child { border-bottom: none; }

/* Multi-category player badge */
.multi-cat-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--accent-secondary) 15%, transparent);
    color: var(--accent-secondary);
    border: 1px solid color-mix(in srgb, var(--accent-secondary) 30%, transparent);
    letter-spacing: 0.03em;
    vertical-align: middle;
    flex-shrink: 0;
}
