/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #131829;
    --bg-card: #1a1f3a;
    --bg-card-hover: #232947;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #ec4899;
    --border-color: #27273a;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.brand-name {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    margin-top: 60px;
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.8;
}

.search-bar {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar button {
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.search-bar button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.search-bar button:active {
    transform: translateY(0);
}

.search-hint {
    margin-top: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Search Results Info */
.search-results-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.search-results-info.hidden {
    display: none;
}

.search-results-info.has-results {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.search-results-info.no-results {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.waveform {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-primary) 25%, 
        var(--accent-secondary) 50%, 
        var(--accent-tertiary) 75%, 
        transparent 100%);
    opacity: 0.1;
    clip-path: polygon(
        0% 50%, 2% 45%, 4% 55%, 6% 40%, 8% 60%, 10% 35%, 12% 65%, 14% 50%, 16% 45%, 18% 55%,
        20% 40%, 22% 60%, 24% 35%, 26% 65%, 28% 50%, 30% 45%, 32% 55%, 34% 40%, 36% 60%, 38% 35%,
        40% 65%, 42% 50%, 44% 45%, 46% 55%, 48% 40%, 50% 60%, 52% 35%, 54% 65%, 56% 50%, 58% 45%,
        60% 55%, 62% 40%, 64% 60%, 66% 35%, 68% 65%, 70% 50%, 72% 45%, 74% 55%, 76% 40%, 78% 60%,
        80% 35%, 82% 65%, 84% 50%, 86% 45%, 88% 55%, 90% 40%, 92% 60%, 94% 35%, 96% 65%, 98% 50%,
        100% 50%, 100% 100%, 0% 100%
    );
}

/* ===================================
   Filters
   =================================== */
.filters {
    padding: var(--spacing-lg) 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 999;
    backdrop-filter: blur(12px);
}

.filters .container {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
}

.filters .container::-webkit-scrollbar {
    height: 4px;
}

.filters .container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.filters .container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

.filter-tag {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-primary);
}

.filter-tag:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-tag.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
}

/* ===================================
   Main Content & Sections
   =================================== */
.main-content {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-secondary);
}

.resource-section {
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title .icon {
    font-size: 2.5rem;
}

/* ===================================
   Resource Cards
   =================================== */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.card-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-beginner {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-intermediate {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-advanced {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.resource-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: auto;
}

.card-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.card-link:hover {
    color: var(--accent-secondary);
}

.tag {
    padding: 0.25rem 0.625rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
    font-family: var(--font-mono);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-note {
    margin-top: var(--spacing-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* High-contrast Contact link in footer Connect section */
.footer .footer-section .footer-contact {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer .footer-section .footer-contact:hover,
.footer .footer-section .footer-contact:focus {
    color: #ffffff;
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.copyright {
    margin-top: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero {
        padding: var(--spacing-xl) 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar button {
        width: 100%;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .filters .container {
        gap: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-card {
    animation: fadeInUp 0.5s ease forwards;
}

.resource-card:nth-child(1) { animation-delay: 0.1s; }
.resource-card:nth-child(2) { animation-delay: 0.15s; }
.resource-card:nth-child(3) { animation-delay: 0.2s; }
.resource-card:nth-child(4) { animation-delay: 0.25s; }
.resource-card:nth-child(5) { animation-delay: 0.3s; }
.resource-card:nth-child(6) { animation-delay: 0.35s; }

/* Hidden state for filtering */
.resource-card.hidden {
    display: none !important;
}

/* ===================================
   Utility Classes
   =================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
