/**
 * MDRN Unified Design System
 * One brand, different divisions - cohesive visual language
 */

/* ============================================
   DESIGN TOKENS
   ============================================ */

:root {
    /* Spacing Scale - Consistent throughout */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 60px;
    --space-2xl: 80px;

    /* Section Spacing */
    --section-padding: var(--space-lg);
    --section-gap: var(--space-xl);

    /* Border System */
    --border-width: 2px;
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;

    /* Card System */
    --card-padding: var(--space-md);
    --card-bg: rgba(0, 0, 0, 0.4);
    --card-border: 2px solid;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 8px 30px rgba(168, 85, 247, 0.3);

    /* Typography Scale */
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 28px;
    --font-size-2xl: 36px;
    --font-size-3xl: 48px;

    /* Animation Timing */
    --transition-fast: 0.15s;
    --transition-base: 0.2s;
    --transition-slow: 0.3s;
    --easing-smooth: cubic-bezier(0.34, 1.56, 0.64, 1);
    --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);

    /* Division Colors - Each section has accent */
    --division-primary: #FFFF00;    /* MDRN Yellow */
    --division-secondary: #00FFFF;  /* PCC Cyan */
    --division-tertiary: #A855F7;   /* GHST Purple */
    --division-quaternary: #FF00FF; /* Accent Pink */
    --division-quinary: #6B9E78;    /* Meteor Green */
}

/* ============================================
   UNIFIED PAGE LAYOUT
   ============================================ */

/* Page Flow - Consistent spacing */
.container > section,
.container > header,
.container > footer {
    margin-bottom: var(--section-gap);
    position: relative;
}

/* Add breathing room */
.container {
    padding: var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding: var(--space-lg);
    }
}

/* Section Separators - Subtle dividers */
.container > section::after,
.container > header::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--section-gap) / 2);
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(168, 85, 247, 0.3) 50%,
        transparent
    );
    opacity: 0.5;
}

/* Last section doesn't need separator */
.container > footer::after,
.container > section:last-of-type::after {
    display: none;
}

/* ============================================
   UNIFIED HEADER SYSTEM
   ============================================ */

/* Main header upgrade */
header {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6),
        rgba(168, 85, 247, 0.1)
    );
    border: var(--border-width) solid rgba(168, 85, 247, 0.3);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
    backdrop-filter: blur(20px);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-slow) var(--easing-standard);
    position: sticky;
    top: var(--space-sm);
    z-index: 1000;
}

header:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: var(--card-shadow-hover);
}

/* Header scrolled state */
header.header-scrolled {
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(30px);
}

header.header-scrolled .logo {
    font-size: var(--font-size-xl);
}

header.header-scrolled .logo-tagline {
    font-size: var(--font-size-xs);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.logo-container {
    flex: 1;
    min-width: 200px;
}

.logo {
    font-size: var(--font-size-2xl);
    background: linear-gradient(135deg, #FFFF00, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 0, 0.3);
    font-weight: 900;
    letter-spacing: 4px;
    margin: 0;
}

.logo-tagline {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    margin-top: var(--space-xs);
    font-weight: 600;
}

/* ============================================
   UNIFIED SECTION HEADERS
   ============================================ */

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
    position: relative;
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0 0 var(--space-sm) 0;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
    margin: var(--space-sm) auto 0;
    border-radius: 2px;
}

/* ============================================
   UNIFIED CARD SYSTEM
   ============================================ */

.unified-card {
    background: var(--card-bg);
    border: var(--border-width) solid;
    border-radius: var(--border-radius-md);
    padding: var(--card-padding);
    backdrop-filter: blur(10px);
    transition: all var(--transition-slow) var(--easing-smooth);
    position: relative;
    overflow: hidden;
}

.unified-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.unified-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.unified-card:hover::before {
    opacity: 0.15;
}

/* Card Variants - Different divisions */
.unified-card.division-primary {
    border-color: var(--division-primary);
}

.unified-card.division-primary::before {
    background: var(--division-primary);
}

.unified-card.division-secondary {
    border-color: var(--division-secondary);
}

.unified-card.division-secondary::before {
    background: var(--division-secondary);
}

.unified-card.division-tertiary {
    border-color: var(--division-tertiary);
}

.unified-card.division-tertiary::before {
    background: var(--division-tertiary);
}

/* ============================================
   UNIFIED BUTTON SYSTEM
   ============================================ */

.unified-btn {
    padding: 12px 24px;
    border: var(--border-width) solid;
    border-radius: var(--border-radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-base) var(--easing-standard);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.unified-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.unified-btn:hover::after {
    transform: translateX(100%);
}

.unified-btn:active {
    transform: scale(0.98);
}

/* Button Variants */
.unified-btn.btn-primary {
    border-color: var(--division-primary);
    color: var(--division-primary);
}

.unified-btn.btn-primary:hover {
    background: rgba(255, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.3);
}

.unified-btn.btn-secondary {
    border-color: var(--division-secondary);
    color: var(--division-secondary);
}

.unified-btn.btn-secondary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.unified-btn.btn-tertiary {
    border-color: var(--division-tertiary);
    color: var(--division-tertiary);
}

.unified-btn.btn-tertiary:hover {
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* ============================================
   UNIFIED GRID SYSTEM
   ============================================ */

.unified-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 768px) {
    .unified-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
}

/* ============================================
   SMOOTH PAGE TRANSITIONS
   ============================================ */

/* Fade in sections on load */
.container > section,
.container > header {
    animation: fadeInUp 0.6s var(--easing-standard) backwards;
}

.container > header {
    animation-delay: 0.1s;
}

.container > section:nth-of-type(1) { animation-delay: 0.2s; }
.container > section:nth-of-type(2) { animation-delay: 0.3s; }
.container > section:nth-of-type(3) { animation-delay: 0.4s; }
.container > section:nth-of-type(4) { animation-delay: 0.5s; }
.container > section:nth-of-type(5) { animation-delay: 0.6s; }

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

/* ============================================
   SCROLL REVEAL ENHANCEMENTS
   ============================================ */

.scroll-reveal-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--easing-standard);
}

.scroll-reveal-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    :root {
        --section-gap: var(--space-md);
        --section-padding: var(--space-md);
    }

    .section-title {
        font-size: var(--font-size-lg);
    }

    .logo {
        font-size: var(--font-size-xl);
    }

    /* Stack header on mobile */
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .wallet-section {
        width: 100%;
    }

    /* Tighter spacing on mobile */
    .unified-card {
        padding: var(--space-sm);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
.unified-btn:focus,
.unified-card:focus-within {
    outline: 2px solid var(--accent-purple);
    outline-offset: 4px;
}

.unified-btn:focus:not(:focus-visible),
.unified-card:focus-within:not(:focus-visible) {
    outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(0, 0, 0, 0.6);
    }
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 10px rgba(168, 85, 247, 0);
    }
}

.pulse {
    animation: pulse 0.6s ease-out;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Page transition */
.page-transitioning {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .unified-btn,
    .wallet-section,
    .category-filters {
        display: none;
    }

    .unified-card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    header {
        position: static !important;
    }
}
