/* ========================================
   DESIGN SYSTEM & VISUAL POLISH
   Spacing, typography, colors, components
   ======================================== */

:root {
    /* ========== SPACING SCALE ========== */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 128px;

    /* ========== TYPOGRAPHY SCALE ========== */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */

    /* ========== ANIMATION TIMING ========== */
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* ========== SHADOWS ========== */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(100, 255, 218, 0.3);
    --shadow-glow-lg: 0 0 40px rgba(100, 255, 218, 0.4);

    /* ========== BORDER RADIUS ========== */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* ========== Z-INDEX SCALE ========== */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-notification: 9999;
    --z-max: 10000;
}

/* ========================================
   ENHANCED BUTTON SYSTEM
   ======================================== */

/* Primary Button */
.btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 14px 28px;
    font-size: var(--text-base);
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--color-secondary);
    color: var(--color-primary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--easing-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn:hover,
.btn-primary:hover {
    background: #52e3c2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
    background: rgba(100, 255, 218, 0.1);
    border-color: #52e3c2;
    color: #52e3c2;
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-text-main);
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-secondary);
}

/* Button Sizes */
.btn-sm {
    padding: 10px 20px;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 18px 36px;
    font-size: var(--text-lg);
}

.btn-xl {
    padding: 22px 44px;
    font-size: var(--text-xl);
}

/* Button with Icon */
.btn i {
    font-size: 1.1em;
}

/* Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   ENHANCED CARD SYSTEM
   ======================================== */

.card,
.glass-card {
    background: rgba(17, 34, 64, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--duration-normal) var(--easing-smooth);
    box-shadow: var(--shadow-md);
}

.card:hover,
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(100, 255, 218, 0.3);
}

/* Card Variants */
.card-flat {
    background: var(--color-primary-light);
    backdrop-filter: none;
}

.card-bordered {
    border: 2px solid rgba(100, 255, 218, 0.2);
}

.card-elevated {
    box-shadow: var(--shadow-xl);
}

/* Card Header */
.card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0;
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* Card Body */
.card-body {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Card Footer */
.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* ========================================
   ENHANCED LINK STYLES
   ======================================== */

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: all var(--duration-fast) var(--easing-smooth);
}

a:hover {
    color: #52e3c2;
}

/* Underline Link */
.link-underline {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

.link-underline:hover {
    text-decoration-thickness: 2px;
}

/* Animated Underline */
.link-animated {
    position: relative;
    text-decoration: none;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width var(--duration-normal) var(--easing-smooth);
}

.link-animated:hover::after {
    width: 100%;
}

/* ========================================
   SECTION SPACING
   ======================================== */

section {
    padding: var(--space-3xl) 0;
}

section.section-sm {
    padding: var(--space-2xl) 0;
}

section.section-lg {
    padding: var(--space-4xl) 0;
}

/* ========================================
   CONTAINER IMPROVEMENTS
   ======================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-sm);
    }
}

/* ========================================
   GRID SYSTEM
   ======================================== */

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   FLEX 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 {
    display: flex;
    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);
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-xs {
    font-size: var(--text-xs);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.text-2xl {
    font-size: var(--text-2xl);
}

.text-3xl {
    font-size: var(--text-3xl);
}

.text-4xl {
    font-size: var(--text-4xl);
}

.text-5xl {
    font-size: var(--text-5xl);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* ========================================
   SPACING UTILITIES
   ======================================== */

.m-0 {
    margin: 0;
}

.mt-xs {
    margin-top: var(--space-xs);
}

.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-xs {
    margin-bottom: var(--space-xs);
}

.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-xs {
    padding: var(--space-xs);
}

.p-sm {
    padding: var(--space-sm);
}

.p-md {
    padding: var(--space-md);
}

.p-lg {
    padding: var(--space-lg);
}

.p-xl {
    padding: var(--space-xl);
}

/* ========================================
   BADGE COMPONENT
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    background: rgba(100, 255, 218, 0.1);
    color: var(--color-secondary);
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.badge-success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

.badge-error {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

/* ========================================
   DIVIDER
   ======================================== */

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.3), transparent);
    margin: var(--space-xl) 0;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-secondary);
    color: var(--color-primary);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    z-index: var(--z-max);
    transition: top var(--duration-fast) var(--easing-smooth);
}

.skip-to-content:focus {
    top: 0;
}

/* Enhanced Focus Indicators */
*:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Focus for interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(100, 255, 218, 0.2);
}

/* Focus for cards */
.glass-card:focus-within {
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-glow);
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    :root {
        --text-5xl: 2.25rem;
        --text-4xl: 1.875rem;
        --text-3xl: 1.5rem;
    }

    section {
        padding: var(--space-2xl) 0;
    }

    .btn {
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
    }
}