/* ==========================================================================
   POLITICAL-QUIZ.COM - MAIN STYLESHEET (GLOBAL STYLES)
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES & CUSTOM PROPERTIES
   ========================================================================== */
:root {
    /* Fluid Typography Scale */
    --text-xs: clamp(0.75rem, calc(0.7rem + 0.25vw), 0.875rem);
    --text-sm: clamp(0.875rem, calc(0.85rem + 0.25vw), 1rem);
    --text-base: clamp(1rem, calc(0.95rem + 0.5vw), 1.125rem);
    --text-lg: clamp(1.125rem, calc(1rem + 0.75vw), 1.5rem);
    --text-xl: clamp(1.25rem, calc(1.1rem + 1vw), 1.75rem);
    --text-2xl: clamp(1.5rem, calc(1.3rem + 1.5vw), 2.25rem);
    --text-3xl: clamp(2rem, calc(1.5rem + 2.5vw), 3rem);
    --text-4xl: clamp(2.5rem, calc(2rem + 3vw), 4rem);
    --text-5xl: clamp(3rem, calc(2.5rem + 4vw), 6rem);
    
    /* Fluid Spacing Scale */
    --space-3xs: clamp(0.25rem, calc(0.2rem + 0.25vw), 0.375rem);
    --space-2xs: clamp(0.5rem, calc(0.45rem + 0.25vw), 0.75rem);
    --space-xs: clamp(0.75rem, calc(0.7rem + 0.5vw), 1rem);
    --space-sm: clamp(1rem, calc(0.9rem + 0.75vw), 1.5rem);
    --space-md: clamp(1.5rem, calc(1.3rem + 1vw), 2.5rem);
    --space-lg: clamp(2rem, calc(1.75rem + 1.5vw), 3.5rem);
    --space-xl: clamp(3rem, calc(2.5rem + 2vw), 5rem);
    --space-2xl: clamp(4rem, calc(3rem + 3vw), 8rem);
    
    /* Container Widths */
    --container-sm: min(90vw, 640px);
    --container-md: min(90vw, 768px);
    --container-lg: min(90vw, 1024px);
    --container-xl: min(90vw, 1280px);
    --container-full: min(90vw, 1400px);
    
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(180deg, #0f0f0f 0%, #1a1a2e 100%);
    --accent-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --color-dark: #0f0f0f;
    --color-darker: #080808;
    --color-light: #ffffff;
    --color-gray: #8b8b8b;
    --color-purple: #667eea;
    --color-pink: #f093fb;
    --color-accent: #fee140;
    --color-success: #4facfe;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--color-darker);
    color: var(--color-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #fee140 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
}

/* ==========================================================================
   4. LAYOUT & CONTAINERS
   ========================================================================== */
.container {
    max-width: var(--container-full);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    overflow: hidden;
}

.section-dark {
    background: var(--color-dark);
}

.section-gradient {
    background: linear-gradient(180deg, var(--color-dark) 0%, var(--color-darker) 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 2rem 4rem;
    transition: var(--transition-smooth);
    background: transparent;
}

.nav.scrolled {
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    padding: 1rem 4rem;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--color-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    position: relative;
    transition: var(--transition-smooth);
    opacity: 0.8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover {
    opacity: 1;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--primary-gradient);
    color: var(--color-light);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.nav-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.nav-cta:hover::before {
    width: 300px;
    height: 300px;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ==========================================================================
   6. BUTTONS & CTA
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: 0.02em;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--color-light);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--color-light);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.footer {
    padding: 60px 20px 30px;
    background: var(--color-darker);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: var(--container-full);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: 3rem;
}

.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    color: var(--color-gray);
    line-height: 1.6;
    max-width: 300px;
}

.footer-column h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gray);
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-link {
    color: var(--color-light);
    text-decoration: none;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    opacity: 1;
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-gray);
    font-size: 0.875rem;
}

/* ==========================================================================
   8. MOBILE MENU
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-light);
    transition: var(--transition-smooth);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==========================================================================
   9. GLOBAL ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(30px, -30px) scale(1.1) rotate(120deg); }
    66% { transform: translate(-20px, 20px) scale(0.9) rotate(240deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ==========================================================================
   10. UTILITY CLASSES
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }

.opacity-80 { opacity: 0.8; }
.opacity-60 { opacity: 0.6; }

/* Animation Utilities */
.animate-fadeIn { animation: fadeIn 1s ease-out; }
.animate-fadeInUp { animation: fadeInUp 1s ease-out; }
.animate-fadeInDown { animation: fadeInDown 1s ease-out; }
.animate-delayed-1 { animation-delay: 0.2s; }
.animate-delayed-2 { animation-delay: 0.4s; }
.animate-delayed-3 { animation-delay: 0.6s; }

/* ==========================================================================
   11. BROWSER SPECIFIC
   ========================================================================== */
::selection {
    background: var(--color-purple);
    color: var(--color-light);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

/* ==========================================================================
   12. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
    .nav {
        padding: 1.5rem 2rem;
    }
    
    .nav.scrolled {
        padding: 1rem 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }

    .section {
        padding: var(--space-lg) var(--space-md);
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }
    
    .nav.scrolled {
        padding: 0.75rem 1.5rem;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 15, 15, 0.98);
        backdrop-filter: blur(20px);
        padding: 6rem 2rem 2rem;
        flex-direction: column;
        gap: 1.5rem;
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        font-size: 1.125rem;
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
    }

    .nav-cta {
        width: 100%;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .section {
        padding: var(--space-lg) var(--space-sm);
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        margin: 0 auto;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .hide-mobile { display: none; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none; }
}

/* ==========================================================================
   13. PRINT STYLES
   ========================================================================== */
@media print {
    .nav,
    .footer,
    .mobile-menu-toggle,
    .btn {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }
}

/* ==========================================================================
   14. ACCESSIBILITY
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-purple);
    outline-offset: 2px;
}