/**
 * USA Site Theme - Purple, Gold, Black
 * Mobile-First Responsive Design
 */

:root {
    /* Primary Colors */
    --primary-purple: #9333ea;
    --primary-gold: #FFD700;
    --primary-black: #0a0a0f;

    /* Purple Variations */
    --purple-dark: #7e22ce;
    --purple-light: #a855f7;
    --purple-lighter: #c084fc;
    --purple-subtle: #e9d5ff;

    /* Gold Variations */
    --gold-dark: #D4AF37;
    --gold-light: #FFE55C;
    --gold-subtle: #FFF7E0;

    /* Neutral Colors */
    --black: #000000;
    --dark-gray: #1a1a24;
    --medium-gray: #4a4a5a;
    --light-gray: #e5e7eb;
    --white: #ffffff;

    /* Text Colors */
    --text-primary: rgba(255, 255, 255, 1);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(147, 51, 234, 0.1);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-toast: 600;
    --z-notification: 700;

    /* Opacity Scale - for consistent glass effects */
    --opacity-subtle: 0.02;
    --opacity-light: 0.03;
    --opacity-medium: 0.05;
    --opacity-strong: 0.1;
    --opacity-text-muted: 0.6;
    --opacity-text-secondary: 0.8;

    /* Shadow Tokens - for consistent elevation */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(147, 51, 234, 0.08);
    --shadow-purple-glow: 0 4px 15px rgba(147, 51, 234, 0.3);
    --shadow-purple-strong: 0 6px 20px rgba(147, 51, 234, 0.4);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background:
        radial-gradient(circle at 20% 30%, rgba(147, 51, 234, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(99, 91, 255, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 70% 20%, rgba(147, 51, 234, 0.04) 0%, transparent 45%),
        #0a0a0f;
    background-attachment: fixed;
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Main Content */
.main-content {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--white);
}

h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

p {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: color var(--transition-base);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: none;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--purple-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.btn-secondary {
    background: var(--primary-gold);
    color: var(--primary-black);
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

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

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

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* Glass Card Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(147, 51, 234, 0.2);
    box-shadow: 0 12px 40px rgba(147, 51, 234, 0.15);
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: rgba(147, 51, 234, 0.05);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: var(--primary-gold);
    color: var(--primary-black);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    min-width: 20px;
    min-height: 20px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto; /* Center when in flex/grid containers */
}

/* Full-screen spinner overlay */
.spinner-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hero Section Enhancement */
.hero {
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 50%, rgba(147, 51, 234, 0.12) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

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

/* Responsive Breakpoints */
@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

@media (min-width: 768px) {
    .md\:grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .md\:grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .md\:grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .md\:flex {
        display: flex;
    }

    .md\:hidden {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Simplified gradient mesh for mobile performance */
    body {
        background:
            radial-gradient(circle at 20% 30%, rgba(147, 51, 234, 0.06) 0%, transparent 50%),
            radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.04) 0%, transparent 50%),
            #0a0a0f;
        background-attachment: fixed;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .lg\:grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .lg\:grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-gold { color: var(--primary-gold); }
.text-purple { color: var(--primary-purple); }
.text-white { color: var(--white); }
.text-muted { color: rgba(255, 255, 255, 0.6); }

.bg-purple { background-color: var(--primary-purple); }
.bg-gold { background-color: var(--primary-gold); }
.bg-black { background-color: var(--primary-black); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }

.shadow-sm { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1); }
