/* =========================================
   TurboNaira - Modern UI Design System
   ========================================= */

/* CSS Variables */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    --accent-cyan: #00d4ff;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-red: #ef4444;

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(139, 92, 246, 0.3);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow-cyan: 0 0 40px rgba(0, 212, 255, 0.15);
    --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 0%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-cyan);
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Header */
header {
    position: sticky;
    top: 0;
    padding: var(--space-md) var(--space-xl);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
}

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

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 44px;
    width: auto;
    transition: var(--transition-normal);
}

.logo:hover {
    transform: scale(1.02);
}

.nav-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.status-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-green);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-2xl);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--space-3xl) 0;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(0, 212, 255, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-purple);
    letter-spacing: 0.5px;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.auto-update-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: fit-content;
    margin: var(--space-lg) auto 0;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
}

.auto-update-notice::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Forex Carousel Section */
.forex-section {
    margin-bottom: var(--space-3xl);
}

.carousel-container {
    overflow: hidden;
    position: relative;
    padding: var(--space-lg) 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
}

.carousel-container::before,
.carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-primary) 0%, transparent 100%);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(-90deg, var(--bg-primary) 0%, transparent 100%);
}

.carousel-track {
    display: flex;
    animation: scroll 25s linear infinite;
    width: max-content;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.forex-card {
    flex-shrink: 0;
    width: 300px;
    margin: 0 var(--space-md);
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    text-align: center;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.forex-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 50%, rgba(0, 212, 255, 0.1) 100%);
    opacity: 0;
    transition: var(--transition-normal);
}

.forex-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow-purple);
}

.forex-card:hover::before {
    opacity: 1;
}

.currency-flag {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.currency-code {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.currency-rate {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.currency-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.currency-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.currency-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.last-updated {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.last-updated::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Calculator Section */
.calculator-section {
    margin-bottom: var(--space-3xl);
}

.calculator-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    padding: var(--space-2xl);
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.calculator-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
}

.calculator-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.currency-display {
    text-align: center;
    flex: 1;
    max-width: 220px;
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-normal);
}

.currency-display:hover {
    border-color: var(--border-accent);
}

.usd-display {
    border-color: rgba(0, 212, 255, 0.2);
}

.ngn-display {
    border-color: rgba(139, 92, 246, 0.2);
}

.currency-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.currency-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    transition: var(--transition-fast);
}

.usd-display .currency-value {
    color: var(--accent-cyan);
}

.ngn-display .currency-value {
    color: var(--accent-purple);
}

.currency-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 300;
}

.slider-container {
    padding: 0 var(--space-sm);
}

#currency-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg,
        rgba(0, 212, 255, 0.2) 0%,
        rgba(139, 92, 246, 0.2) 50%,
        rgba(236, 72, 153, 0.2) 100%);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    position: relative;
}

#currency-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 0 0 4px rgba(139, 92, 246, 0.2),
        0 4px 12px rgba(139, 92, 246, 0.4);
    transition: var(--transition-fast);
}

#currency-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow:
        0 0 0 6px rgba(139, 92, 246, 0.25),
        0 6px 20px rgba(139, 92, 246, 0.5);
}

#currency-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow:
        0 0 0 4px rgba(139, 92, 246, 0.2),
        0 4px 12px rgba(139, 92, 246, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-md);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* News Section */
.news-section {
    margin-top: var(--space-md);
}

.local-news-section {
    margin-top: var(--space-3xl);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.news-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-normal);
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
}

.news-card:hover::before {
    transform: scaleX(1);
}

.news-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-purple);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.news-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition-fast);
}

.news-card:hover .news-title {
    color: var(--accent-cyan);
}

.news-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-md);
    margin-top: auto;
}

.news-source {
    font-weight: 600;
    color: var(--text-secondary);
}

.news-date {
    opacity: 0.8;
}

/* Footer */
footer {
    padding: var(--space-xl) var(--space-2xl);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-subtle);
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.footer-brand {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

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

.data-attribution {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.financial-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 800px;
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.financial-disclaimer strong {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-links .link-divider {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    main {
        padding: var(--space-xl);
    }
}

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

    .hero {
        padding: var(--space-xl) 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .logo {
        height: 36px;
    }

    .forex-card {
        width: 240px;
        padding: var(--space-lg);
    }

    .currency-rate {
        font-size: 1.75rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .calculator-container {
        padding: var(--space-lg);
    }

    .calculator-display {
        flex-direction: column;
        gap: var(--space-md);
    }

    .currency-display {
        max-width: 100%;
        width: 100%;
    }

    .currency-arrow {
        transform: rotate(90deg);
    }

    .currency-value {
        font-size: 1.75rem;
    }

    .carousel-container::before,
    .carousel-container::after {
        width: 40px;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .footer-bottom {
        justify-content: center;
    }

    .nav-status {
        padding: var(--space-xs) var(--space-sm);
    }

    .status-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: var(--space-xs) var(--space-sm);
    }

    .forex-card {
        width: 200px;
        margin: 0 var(--space-sm);
        padding: var(--space-md);
    }

    .currency-flag {
        font-size: 2.5rem;
    }

    .currency-rate {
        font-size: 1.5rem;
    }

    .news-card {
        padding: var(--space-md);
    }

    header {
        padding: var(--space-sm) var(--space-md);
    }
}

/* Loading States */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading {
    background: linear-gradient(90deg,
        var(--bg-card) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}
