/* ================================================ */
/*  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-image: radial-gradient(
        circle at 2px 2px,
        var(--border-color) 1px,
        transparent 0
    );
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    opacity: 0.6;
}

.dot-pattern-dense::before {
    background-size: 15px 15px;
}

.dot-pattern-sparse::before {
    background-size: 30px 30px;
}

/* Dot pattern with accent color */
.dot-pattern-accent-primary::before {
    background-image: radial-gradient(
        circle at 2px 2px,
        color-mix(in srgb, var(--accent-primary) 8%, transparent) 1px,
        transparent 0
    );
}

.dot-pattern-accent-secondary::before {
    background-image: radial-gradient(
        circle at 2px 2px,
        color-mix(in srgb, var(--accent-secondary) 8%, transparent) 1px,
        transparent 0
    );
}

/* 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 color-mix(in srgb, var(--accent-primary) 50%, transparent);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle at 2px 2px,
        var(--border-color) 1px,
        transparent 0
    );
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    opacity: 0.5;
}

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

.card:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 100%, transparent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

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

/* 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%);
}

/* Dot pattern for gradient cards */
.card-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle at 2px 2px,
        var(--border-color) 1px,
        transparent 0
    );
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
    opacity: 0.5;
}

.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(--border-color);
    color: var(--text-primary);
}

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

/* 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);
}

/* ===== GRADIENT TEXT ===== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 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-image: radial-gradient(
        circle at 2px 2px,
        var(--border-color) 1px,
        transparent 0
    );
    background-size: 15px 15px;
    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-image: radial-gradient(
        circle at 2px 2px,
        var(--border-color) 1px,
        transparent 0
    );
    background-size: 25px 25px;
    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;
    }
}