/*!
 * KEAR AI - Futuristic AI Theme
 * Professional AI Review & Guide Platform
 * Optimized for reading experience with futuristic AI aesthetics
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors - Light Mode */
    --color-bg: #E4E3D4;
    --color-bg-alt: #dbd9ca;
    --color-bg-elevated: #f5f4eb;
    --color-surface: #d4d2c3;
    
    --color-text: #1a1a1a;
    --color-text-secondary: #444444;
    --color-text-muted: #6a6a6a;
    
    --color-border: #c9c7b8;
    --color-border-light: #d6d4c5;
    
    /* Brand Colors - Cyber Accent */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-primary-bg: rgba(99, 102, 241, 0.1);
    
    --color-accent: #8b5cf6;
    --color-accent-cyan: #22d3ee;
    --color-accent-pink: #ec4899;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    /* Code Colors - Optimized for light mode readability */
    --color-code: #0d9488;              /* Teal - high contrast on cream */
    --color-code-bg: #f5f5f0;           /* Subtle off-white */
    --color-code-border: #d4d2c3;
    
    /* Gradients - Enhanced */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-hero: linear-gradient(135deg, #1a1a1f 0%, #252530 50%, #1a1a1f 100%);
    --gradient-text: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-cyber: linear-gradient(135deg, #6366f1 0%, #22d3ee 50%, #8b5cf6 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    
    /* Shadows - Enhanced with Glow */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);
    --shadow-glow-lg: 0 0 60px rgba(99, 102, 241, 0.2);
    --shadow-neon: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.2);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: 20px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Layout */
    --container-max: 1280px;
    --container-narrow: 900px;
    --header-height: 72px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Mode - Futuristic #1D1D20 Base */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1D1D20;
        --color-bg-alt: #232328;
        --color-bg-elevated: #28282d;
        --color-surface: #2d2d33;
        
        --color-text: #e8e8ea;
        --color-text-secondary: #b8b8c0;
        --color-text-muted: #9090a0;
        
        --color-border: #3a3a42;
        --color-border-light: #2f2f36;
        
        --color-primary-bg: rgba(99, 102, 241, 0.15);
        
        /* Code Colors - Optimized for dark mode readability */
        --color-code: #34d399;              /* Emerald green - vibrant on dark */
        --color-code-bg: #1a1a1f;           /* Darker than surface */
        --color-code-border: #3a3a42;
        
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
        
        /* Dark Glass Effect */
        --glass-bg: rgba(29, 29, 32, 0.75);
        --glass-border: rgba(99, 102, 241, 0.15);
    }
}

/* JS-controlled theme support */
[data-theme="light"] {
    --color-bg: #E4E3D4;
    --color-bg-alt: #dbd9ca;
    --color-bg-elevated: #f5f4eb;
    --color-surface: #d4d2c3;
    --color-text: #1a1a1a;
    --color-text-secondary: #444444;
    --color-text-muted: #6a6a6a;
    --color-border: #c9c7b8;
    --color-border-light: #d6d4c5;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --color-code: #0d9488;
    --color-code-bg: #f5f5f0;
    --color-code-border: #d4d2c3;
}

[data-theme="dark"] {
    --color-bg: #1D1D20;
    --color-bg-alt: #232328;
    --color-bg-elevated: #28282d;
    --color-surface: #2d2d33;
    --color-text: #e8e8ea;
    --color-text-secondary: #b8b8c0;
    --color-text-muted: #9090a0;
    --color-border: #3a3a42;
    --color-border-light: #2f2f36;
    --glass-bg: rgba(29, 29, 32, 0.75);
    --glass-border: rgba(99, 102, 241, 0.15);
    --color-code: #34d399;
    --color-code-bg: #1a1a1f;
    --color-code-border: #3a3a42;
}

/* ========================================
   BASE STYLES
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: var(--color-primary);
    color: white;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Wider article on large screens */
@media (min-width: 1200px) {
    .container-narrow {
        max-width: min(960px, 55vw);
    }
}

@media (min-width: 1600px) {
    .container-narrow {
        max-width: min(1100px, 50vw);
    }
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    z-index: 10000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 10001;
    transition: width 50ms linear;
}

/* ========================================
   HEADER - Glass Effect Navigation
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-base);
}

/* Glass Header Glow Effect */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(99, 102, 241, 0.03) 50%, 
        transparent 100%);
    pointer-events: none;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--color-primary) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.site-header:hover::after {
    opacity: 0.5;
}

@media (prefers-color-scheme: dark) {
    .site-header {
        background: rgba(29, 29, 32, 0.85);
        border-bottom-color: rgba(99, 102, 241, 0.1);
    }
}

[data-theme="light"] .site-header {
    background: rgba(228, 227, 212, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .site-header {
    background: rgba(29, 29, 32, 0.85);
    border-bottom-color: rgba(99, 102, 241, 0.1);
}

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

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    position: relative;
}

.site-logo:hover {
    opacity: 0.85;
}

.site-logo-img {
    height: 28px;
    width: auto;
    display: block;
    transition: transform var(--transition-base);
}

.site-logo:hover .site-logo-img {
    transform: scale(1.03);
}

@media (min-width: 768px) {
    .site-logo-img {
        height: 36px;
    }
}

/* Navigation */
.main-nav {
    display: none;
    align-items: center;
    gap: var(--space-1);
}

@media (min-width: 1024px) {
    .main-nav {
        display: flex;
    }
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-item:hover,
.nav-item.active {
    color: var(--color-text);
    background: var(--color-surface);
}

.nav-icon {
    font-size: 1rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.search-toggle,
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-toggle:hover,
.theme-toggle:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }

@media (prefers-color-scheme: dark) {
    .theme-toggle .sun-icon { display: none; }
    .theme-toggle .moon-icon { display: block; }
}

[data-theme="light"] .theme-toggle .sun-icon { display: none; }
[data-theme="light"] .theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* Language Switcher */
.language-switcher {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.lang-toggle:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    min-width: 140px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    list-style: none;
    z-index: 100;
}

.language-switcher:hover .lang-dropdown,
.language-switcher:focus-within .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown li a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.lang-dropdown li a:hover,
.lang-dropdown li.active a {
    color: var(--color-text);
    background: var(--color-surface);
}

/* Mobile Toggle */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

@media (min-width: 1024px) {
    .mobile-toggle {
        display: none;
    }
}

/* ========================================
   SEARCH MODAL
   ======================================== */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    width: 100%;
    max-width: 640px;
    margin: 0 var(--space-4);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(-20px);
    transition: transform var(--transition-fast);
}

.search-modal.active .search-modal-content {
    transform: scale(1) translateY(0);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-border-light);
}

.search-input-wrapper .search-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    font-size: 1.125rem;
    color: var(--color-text);
    background: transparent;
    border: none;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--color-text-muted);
}

.search-kbd {
    padding: var(--space-1) var(--space-2);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-footer {
    display: flex;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
}

.search-footer kbd {
    padding: 2px 6px;
    font-family: var(--font-mono);
    background: var(--color-surface);
    border-radius: 4px;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */
.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-bg-elevated);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 2000;
    overflow-y: auto;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-title {
    font-weight: 600;
}

.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
}

.mobile-nav-links {
    padding: var(--space-4);
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    font-size: 1rem;
    color: var(--color-text);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.mobile-nav-item:hover {
    background: var(--color-surface);
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1999;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   HERO SECTION - Clean Futuristic Design
   ======================================== */
.hero {
    position: relative;
    padding: var(--space-16) 0 var(--space-20);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0a0a0f 0%, #1D1D20 50%, #1a1a1f 100%);
    z-index: -2;
}

/* Subtle Gradient Background */
.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99, 102, 241, 0.15), transparent 60%);
    z-index: -1;
}

/* Visible Grid */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.12) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 50%, black 30%, transparent 80%);
}

/* Particle Canvas Container */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary-light);
    background: var(--color-primary-bg);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-6);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

/* Hero Animations */
.hero-badge {
    animation: fadeInUp 0.6s ease-out;
}

.hero-title {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-description {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-search {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-categories {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    color: white;
    margin-bottom: var(--space-6);
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 6s ease infinite;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

/* Hero Search */
.hero-search {
    max-width: 560px;
    margin: 0 auto var(--space-8);
}

.hero-search-input {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.hero-search-input svg {
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.hero-search-input input {
    flex: 1;
    font-size: 1rem;
    color: white;
    background: transparent;
    border: none;
    outline: none;
}

.hero-search-input input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.hero-search-input button {
    padding: var(--space-3) var(--space-6);
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-search-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Hero Categories */
.hero-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.category-pill {
    transition: all var(--transition-fast);
    animation: fadeInScale 0.5s ease-out both;
}

.category-pill:nth-child(1) { animation-delay: 0.5s; }
.category-pill:nth-child(2) { animation-delay: 0.55s; }
.category-pill:nth-child(3) { animation-delay: 0.6s; }
.category-pill:nth-child(4) { animation-delay: 0.65s; }
.category-pill:nth-child(5) { animation-delay: 0.7s; }
.category-pill:nth-child(6) { animation-delay: 0.75s; }
.category-pill:nth-child(7) { animation-delay: 0.8s; }

.category-pill:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.6s; }
.stat-item:nth-child(2) { animation-delay: 0.7s; }
.stat-item:nth-child(3) { animation-delay: 0.8s; }

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   SECTION STYLES
   ======================================== */
.posts-section {
    padding: var(--space-16) 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

.section-link:hover {
    color: var(--color-primary-dark);
}

/* ========================================
   POSTS GRID - Auto-fill No Blank Space
   ======================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Featured card spans 2 columns */
    .post-card.featured {
        grid-column: span 2;
    }
}

/* Post Card - Futuristic Style */
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-spring);
    position: relative;
}

/* Card Glow Effect */
.post-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.3) 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

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

.post-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.posts-grid .post-card:nth-child(1) { animation-delay: 0.05s; }
.posts-grid .post-card:nth-child(2) { animation-delay: 0.1s; }
.posts-grid .post-card:nth-child(3) { animation-delay: 0.15s; }
.posts-grid .post-card:nth-child(4) { animation-delay: 0.2s; }
.posts-grid .post-card:nth-child(5) { animation-delay: 0.25s; }
.posts-grid .post-card:nth-child(6) { animation-delay: 0.3s; }
.posts-grid .post-card:nth-child(7) { animation-delay: 0.35s; }
.posts-grid .post-card:nth-child(8) { animation-delay: 0.4s; }
.posts-grid .post-card:nth-child(9) { animation-delay: 0.45s; }
.posts-grid .post-card:nth-child(10) { animation-delay: 0.5s; }

.post-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.15);
    transform: translateY(-8px);
}

.post-card.featured {
    grid-column: span 1;
}

@media (min-width: 1024px) {
    .post-card.featured {
        grid-column: span 2;
        flex-direction: row;
    }
    
    .post-card.featured .post-image {
        width: 50%;
        aspect-ratio: 4/3;
    }
    
    .post-card.featured .post-content {
        flex: 1;
        padding: var(--space-8);
    }
}

.post-image {
    position: relative;
    overflow: hidden;
    background: var(--color-surface);
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-image img {
    transform: scale(1.02);
}

.post-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: var(--space-4);
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

.post-category {
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-6);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: 0.8125rem;
}

.meta-category {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-primary);
    font-weight: 500;
}

.meta-date {
    color: var(--color-text-muted);
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-3);
}

.post-title a {
    color: var(--color-text);
}

.post-title a:hover {
    color: var(--color-primary);
}

.post-excerpt {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex: 1;
}

.post-footer {
    margin-top: auto;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

.read-more:hover {
    color: var(--color-primary-dark);
}

.read-more svg {
    transition: transform var(--transition-fast);
}

.read-more:hover svg {
    transform: translateX(4px);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
}

.page-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-primary);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.page-num:hover {
    color: var(--color-text);
    background: var(--color-surface);
}

.page-num.current {
    color: white;
    background: var(--gradient-primary);
}

.page-dots {
    color: var(--color-text-muted);
    padding: 0 var(--space-2);
}

/* ========================================
   ARTICLE STYLES
   ======================================== */
.article {
    padding-bottom: var(--space-16);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.breadcrumbs a:hover {
    color: var(--color-primary);
}

.breadcrumbs .separator {
    color: var(--color-border);
}

.breadcrumbs .current {
    color: var(--color-text);
    font-weight: 500;
}

.article-header {
    padding: var(--space-8) 0;
}

.article-category {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.article-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

.article-excerpt {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-6);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.meta-item svg {
    color: var(--color-text-muted);
}

.article-languages {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-light);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.lang-btn {
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
}

.lang-btn.active,
.lang-btn:hover {
    color: white;
    background: var(--color-primary);
}

/* Article Image */
.article-image {
    margin: var(--space-8) 0;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: inline-block;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Article Body / Entry Content */
.article-body {
    padding: var(--space-8) 0;
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: var(--space-10) 0 var(--space-4);
}

.entry-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin: var(--space-8) 0 var(--space-3);
}

.entry-content p {
    margin-bottom: var(--space-6);
}

.entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--color-primary-dark);
}

.entry-content ul,
.entry-content ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

.entry-content li {
    margin-bottom: var(--space-2);
}

.entry-content blockquote {
    margin: var(--space-8) 0;
    padding: var(--space-6);
    padding-left: var(--space-6);
    border-left: 4px solid var(--color-primary);
    background: var(--color-surface);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.entry-content pre {
    margin: var(--space-6) 0;
    padding: var(--space-5);
    background: var(--color-code-bg);
    border: 1px solid var(--color-code-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--color-code);
}

.entry-content pre code {
    color: var(--color-code);
    line-height: 1.6;
}

.entry-content p code {
    padding: 2px 6px;
    background: var(--color-code-bg);
    border: 1px solid var(--color-code-border);
    border-radius: var(--radius-sm);
    color: var(--color-code);
}

/* Global code color override for article-specific styles */
.entry-content .code-example code,
.entry-content [class*="code"] code,
.entry-content pre code {
    color: var(--color-code) !important;
}

.entry-content img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--space-6) auto;
    display: block;
    box-shadow: var(--shadow-sm);
}

.entry-content .lead {
    font-size: 1.375rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* Article Tags - Protected from content style leakage */
.article-tags {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6) 0;
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-8);
    width: 100%;
    text-align: center;
}

@media (min-width: 768px) {
    .article-tags {
        justify-content: flex-start;
        text-align: left;
    }
}

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

.tag {
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    border: 0;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.tag-button {
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.tag:hover {
    background: var(--color-primary);
    color: white;
}

.article-tags .tag {
    cursor: default;
}

.article-tags .tag:hover {
    background: var(--color-primary-bg);
    color: var(--color-primary);
    transform: none;
}

/* Share Section - Protected from content style leakage */
.share-section {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-6) 0;
    margin-top: var(--space-6);
    width: 100%;
    text-align: center;
}

@media (min-width: 768px) {
    .share-section {
        justify-content: flex-start;
        text-align: left;
    }
}

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

.share-buttons {
    display: flex;
    gap: var(--space-2);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.share-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.share-btn:not(.copy) .share-icon path {
    fill: currentColor;
}

.share-btn.copy .share-icon {
    fill: none;
    stroke: currentColor;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.facebook:hover { background: #1877f2; color: white; }
.share-btn.x:hover { background: #000000; color: white; }
.share-btn.reddit:hover { background: #ff4500; color: white; }
.share-btn.whatsapp:hover { background: #25d366; color: white; }
.share-btn.linkedin:hover { background: #0077b5; color: white; }
.share-btn.copy:hover { background: var(--color-primary); color: white; }

/* ========================================
   RELATED POSTS
   ======================================== */
.related-section {
    padding: var(--space-16) 0;
    background: var(--color-bg-alt);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
}

@media (min-width: 640px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.related-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.related-card:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-md);
}

.related-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: var(--space-4);
}

.related-category {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.75rem;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}

.related-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-2);
}

.related-title a {
    color: var(--color-text);
}

.related-title a:hover {
    color: var(--color-primary);
}

.related-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ========================================
   COMMENTS
   ======================================== */
.comments-section {
    padding: var(--space-16) 0;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

.comments-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.comments-count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.comment-form-wrapper {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
}

.comment-form-wrapper h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-5);
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .comment-form .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.form-group label .required {
    color: var(--color-error);
}

.form-group label small {
    color: var(--color-text-muted);
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border-light);
}

/* Comment List */
.comment-list {
    list-style: none;
}

.comment-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.comment-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.comment-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.no-comments {
    text-align: center;
    padding: var(--space-10);
    color: var(--color-text-muted);
}

/* Reply Button */
.comment-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--space-2);
    padding: 2px 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.comment-reply-btn:hover {
    color: var(--color-primary);
}

/* Reply Indicator */
.reply-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
}

.reply-cancel {
    margin-left: auto;
    padding: 0 var(--space-2);
    font-size: 1.25rem;
    line-height: 1;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.reply-cancel:hover {
    color: var(--color-error);
}

/* Nested Replies */
.comment-replies-wrapper {
    list-style: none;
}

.comment-replies {
    list-style: none;
    padding-left: var(--space-8);
    border-left: 2px solid var(--color-border-light);
    margin-left: 24px;
}

.comment-reply-item .comment-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8125rem;
}

/* Cap nesting depth visually */
.comment-replies .comment-replies .comment-replies {
    padding-left: var(--space-4);
    margin-left: 18px;
}

/* ========================================
   CATEGORY PAGE
   ======================================== */
.category-header {
    padding: var(--space-12) 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-light);
}

.category-info {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.category-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--space-3);
}

.category-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

.category-count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ========================================
   SEARCH PAGE
   ======================================== */
.search-section {
    padding: var(--space-16) 0;
}

.search-page-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-10);
}

.search-page-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-size: 2rem;
    margin-bottom: var(--space-6);
}

.search-form-large {
    width: 100%;
}

.search-input-large {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2);
    background: var(--color-bg-elevated);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast);
}

.search-input-large:focus-within {
    border-color: var(--color-primary);
}

.search-input-large input {
    flex: 1;
    padding: var(--space-4);
    font-size: 1.125rem;
    color: var(--color-text);
    background: transparent;
    border: none;
    outline: none;
}

.search-input-large button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-input-large button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.search-results-info {
    margin-bottom: var(--space-8);
    font-size: 1rem;
    color: var(--color-text-secondary);
}

.search-results-info strong {
    color: var(--color-text);
}

.no-results {
    text-align: center;
    padding: var(--space-16) 0;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-3);
}

.no-results p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
}

.search-explore {
    max-width: 800px;
    margin: 0 auto;
}

.popular-tags,
.browse-categories {
    margin-bottom: var(--space-10);
}

.popular-tags h2,
.browse-categories h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-5);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.tags-list .tag {
    padding: var(--space-2) var(--space-4);
}

.tag-count {
    margin-left: var(--space-2);
    padding: 2px 6px;
    font-size: 0.6875rem;
    background: rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .category-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

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

.category-card-icon {
    font-size: 2rem;
    margin-bottom: var(--space-3);
}

.category-card-name {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.category-card-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ========================================
   404 PAGE
   ======================================== */
.error-section {
    padding: var(--space-24) 0;
    text-align: center;
}

.error-content {
    max-width: 500px;
    margin: 0 auto;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-4);
}

.error-content h1 {
    font-size: 2rem;
    margin-bottom: var(--space-4);
}

.error-content p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
}

/* ========================================
   NEWSLETTER - Dynamic Light Effects
   ======================================== */
.newsletter-section {
    padding: var(--space-16) 0;
}

.newsletter-card {
    position: relative;
    padding: var(--space-12);
    background: linear-gradient(135deg, #1a1a1f 0%, #252530 50%, #1a1a1f 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Animated Glow Effects */
.newsletter-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: newsletterGlow 6s ease-in-out infinite;
}

.newsletter-glow-1 {
    width: 300px;
    height: 300px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -50px;
    animation-delay: 0s;
}

.newsletter-glow-2 {
    width: 250px;
    height: 250px;
    background: rgba(139, 92, 246, 0.25);
    bottom: -80px;
    right: -30px;
    animation-delay: -3s;
}

@keyframes newsletterGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Background Grid */
.newsletter-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

.newsletter-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    text-align: center;
}

@media (min-width: 768px) {
    .newsletter-inner {
        flex-direction: row;
        text-align: left;
    }
}

.newsletter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    color: var(--color-primary-light);
    flex-shrink: 0;
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
    }
}

.newsletter-content {
    flex: 1;
}

.newsletter-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-2);
}

.newsletter-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.newsletter-form {
    width: 100%;
    max-width: 450px;
}

.newsletter-input-group {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.newsletter-input-group:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.newsletter-input-group input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-size: 1rem;
    color: white;
    background: transparent;
    border: none;
    outline: none;
}

.newsletter-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-input-group button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-weight: 600;
    font-size: 0.9375rem;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-spring);
    white-space: nowrap;
}

.newsletter-input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.newsletter-input-group button svg {
    transition: transform var(--transition-fast);
}

.newsletter-input-group button:hover svg {
    transform: translateX(4px);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .newsletter-card {
        padding: var(--space-8);
    }
    
    .newsletter-icon {
        width: 64px;
        height: 64px;
    }
    
    .newsletter-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-input-group button {
        justify-content: center;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
    padding: var(--space-16) 0 var(--space-8);
    overflow: visible;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        text-align: left;
        gap: var(--space-10);
    }
}

.footer-brand {
    max-width: 100%;
}

@media (min-width: 768px) {
    .footer-brand {
        max-width: 280px;
    }
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
    .footer-logo {
        display: flex;
    }
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--color-primary-light);
    margin-bottom: var(--space-4);
}

.footer-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-5);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .footer-social {
        justify-content: flex-start;
    }
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    color: white;
    background: var(--color-primary);
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-4);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: var(--space-3);
}

.footer-col a {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

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

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-light);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-align: center;
    position: relative;
    overflow: visible;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ========================================
   BACK TO TOP
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ========================================
   UTILITIES
   ======================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

mark {
    padding: 2px 4px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 2px;
}

/* Rating Stars */
.rating-stars {
    color: var(--color-warning);
    letter-spacing: 2px;
}

.rating-stars .half-star {
    display: inline-block;
    width: 0.5em;
    overflow: hidden;
}

/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .container-narrow {
        max-width: 100%;
        padding: 0 var(--space-3);
    }
    
    .hero {
        padding: var(--space-10) 0;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .posts-section {
        padding: var(--space-8) 0;
    }
    
    .article-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .article-header {
        padding: var(--space-4) 0;
    }
    
    .article-body {
        padding: var(--space-4) 0;
    }
    
    .entry-content {
        font-size: 1rem;
    }
    
    .article-image {
        margin: var(--space-4) 0;
    }
    
    .article-image img {
        border-radius: var(--radius-md);
    }
    
    .breadcrumbs {
        padding: var(--space-3) 0;
        font-size: 0.8125rem;
    }
    
    .article-tags {
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    
    .share-section {
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .newsletter-card {
        padding: var(--space-5);
    }
    
    .comments-section {
        padding: var(--space-10) 0;
    }
    
    .related-section {
        padding: var(--space-10) 0;
    }
    
    .site-footer {
        padding: var(--space-10) 0 var(--space-6);
    }
}

/* Extra small screens - maximize content area */
@media (max-width: 480px) {
    .container,
    .container-narrow {
        padding: 0 var(--space-2);
    }
    
    .hero-search {
        margin: 0 0 var(--space-6);
    }
    
    .hero-search-input {
        padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
    }
    
    .hero-categories {
        gap: var(--space-2);
    }
    
    .category-pill {
        padding: var(--space-1) var(--space-3);
        font-size: 0.8125rem;
    }
    
    .post-content {
        padding: var(--space-4);
    }
    
    .section-header {
        margin-bottom: var(--space-5);
    }
}

/* ========================================
   DARK MODE ENHANCEMENTS
   ======================================== */
[data-theme="dark"] {
    --color-primary-bg: rgba(99, 102, 241, 0.18);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .post-card,
[data-theme="dark"] .related-card {
    background: var(--color-bg-elevated);
    border-color: var(--color-border);
}

[data-theme="dark"] .entry-content a {
    color: var(--color-primary-light);
}

[data-theme="dark"] .entry-content blockquote {
    background: var(--color-surface);
    border-left-color: var(--color-primary-light);
}

[data-theme="dark"] .comment-form-wrapper {
    background: var(--color-surface);
}

[data-theme="dark"] .newsletter-card {
    background: linear-gradient(135deg, #1e1e24 0%, #2a2a32 50%, #1e1e24 100%);
}

/* ========================================
   ENHANCED VISUAL ANIMATIONS
   ======================================== */
/* Scroll-triggered fade-in animation */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Card lift animation */
.post-card,
.related-card,
.category-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.post-card:hover,
.category-card:hover {
    transform: translateY(-8px);
}

/* Link underline animation */
.entry-content a {
    position: relative;
    text-decoration: none;
}

.entry-content a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.entry-content a:hover::after {
    width: 100%;
}

/* Gradient text shimmer */
.gradient-text {
    background-size: 200% auto;
    animation: gradientShimmer 3s ease infinite;
}

@keyframes gradientShimmer {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* Image hover glow effect */
.post-image,
.article-image {
    position: relative;
}

.post-image::after,
.article-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0);
    transition: box-shadow 0.3s ease;
    pointer-events: none;
}

.post-card:hover .post-image::after {
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Navigation item hover effect */
.nav-item {
    position: relative;
}

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

.nav-item:hover::after,
.nav-item.active::after {
    width: 80%;
    left: 10%;
}

/* Share button bounce effect */
.share-btn {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease,
                color 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Tag pill hover effect */
.tag,
.category-pill {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tag:hover {
    transform: scale(1.08);
}

/* Smooth focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reading progress bar glow */
.reading-progress {
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Hero search input focus glow - outer only */
.hero-search-input:focus-within {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.hero-search-input:focus-within input {
    outline: none;
}

/* Stat number counter animation placeholder */
.stat-number {
    transition: transform 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
}

/* ========================================
   ADSENSE AUTO AD CONTAINERS
   ======================================== */
.ad-container {
    padding: var(--space-6) 0;
    text-align: center;
}

.ad-container-inline {
    margin: var(--space-8) 0;
    padding: var(--space-4);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    min-height: 100px;
}

.ad-container-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
    padding: var(--space-4);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    min-height: 250px;
}

/* Ad placeholder text (remove in production) */
.ad-placeholder {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   TECH PARTICLES ANIMATION
   ======================================== */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-40px) translateX(-5px);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-20px) translateX(-10px);
        opacity: 0.7;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
    pointer-events: none;
}

/* ========================================
   HERO MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hero {
        padding: var(--space-10) 0 var(--space-12);
    }
    
    /* Reduce animations for mobile performance */
    .hero-grid {
        animation: none;
        opacity: 0.4;
    }
    
    .hero-gradient {
        animation: none;
    }
    
    .gradient-text-glow {
        animation: none;
        filter: none;
    }
    
    .particle {
        animation-duration: 10s !important;
    }
    
    .newsletter-glow {
        animation: none;
        opacity: 0.3;
    }
    
    .newsletter-icon {
        animation: none;
    }
}

/* ========================================
   LIGHT MODE SPECIFIC STYLES
   ======================================== */
[data-theme="light"] .hero-bg {
    background: linear-gradient(180deg, #1a1a1f 0%, #252530 50%, #1f1f25 100%);
}

[data-theme="light"] .ad-container-inline,
[data-theme="light"] .ad-container-sidebar {
    background: var(--color-surface);
}

/* ========================================
   CYBER GLOW TEXT EFFECT
   ======================================== */
.cyber-glow {
    text-shadow: 
        0 0 10px rgba(99, 102, 241, 0.5),
        0 0 20px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(99, 102, 241, 0.2);
}

/* Enhanced gradient text with glow */
.gradient-text-glow {
    background: linear-gradient(135deg, #6366f1, #22d3ee, #8b5cf6, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 6s ease infinite;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

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

/* ========================================
   FOOTER LANGUAGE SWITCHER
   ======================================== */
.footer-lang-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.footer-lang-icon {
    position: absolute;
    left: 14px;
    color: var(--color-primary);
    pointer-events: none;
    z-index: 1;
}

.footer-lang-select {
    padding: 12px 44px 12px 44px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition-base);
    min-width: 180px;
}

.footer-lang-select:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-elevated);
    box-shadow: var(--shadow-glow);
}

.footer-lang-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: var(--shadow-glow);
}

.footer-lang-arrow {
    position: absolute;
    right: 14px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.footer-lang-wrapper:hover .footer-lang-arrow {
    color: var(--color-primary);
}

.footer-lang-select option {
    background: var(--color-bg, #1D1D20);
    color: var(--color-text, #e8e8ea);
    padding: 12px;
}

[data-theme="light"] .footer-lang-select option {
    background: var(--color-bg, #E4E3D4);
    color: var(--color-text, #1a1a1a);
}

/* Mobile Language Section */
.mobile-lang-section {
    padding: var(--space-4);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-2);
}

.mobile-lang-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: var(--space-3);
}

.mobile-lang-title svg {
    color: var(--color-primary);
}

.mobile-lang-select-wrapper {
    position: relative;
}

.mobile-lang-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-right: var(--space-10);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition-fast);
}

.mobile-lang-select:hover,
.mobile-lang-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: var(--shadow-glow);
}

.mobile-lang-select option {
    background: var(--color-bg);
    color: var(--color-text);
    padding: var(--space-2);
}

.mobile-lang-arrow {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

/* RTL Support */
[dir="rtl"] .lang-switcher {
    direction: ltr;
}

[dir="rtl"] .site-wrapper {
    direction: rtl;
}

[dir="rtl"] .main-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-grid {
    direction: rtl;
}

/* ========================================
   CODE BLOCK COPY BUTTON
   GitHub-style copy button for code blocks
   ======================================== */

/* Wrapper for code blocks with copy button */
.code-block-wrapper {
    position: relative;
}

/* Copy button styling - Large and accessible */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    min-width: 90px;
    height: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

/* Show button on hover */
.code-block-wrapper:hover .code-copy-btn,
.code-example:hover .code-copy-btn {
    opacity: 1;
    visibility: visible;
}

/* Always visible on touch devices */
@media (hover: none) {
    .code-copy-btn {
        opacity: 1;
        visibility: visible;
    }
}

/* Hover state */
.code-copy-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* Active state */
.code-copy-btn:active {
    transform: translateY(0);
}

/* Success state */
.code-copy-btn.copied {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
    opacity: 1;
    visibility: visible;
}

/* Copy button icons */
.code-copy-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Copy button text */
.code-copy-btn .btn-text {
    white-space: nowrap;
}

/* Toast notification for copy success */
.copy-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--color-success);
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.copy-toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Adjust pre/code positioning for copy button */
.code-block-wrapper pre,
.entry-content .code-block-wrapper pre {
    margin: 0;
    padding-top: 56px; /* Space for copy button */
}

/* For .code-example blocks that already have structure */
.code-example {
    position: relative;
}

.code-example .code-copy-btn {
    top: auto;
    bottom: auto;
    top: 8px;
}

.code-example .code-header + .code-copy-btn {
    top: 48px; /* Below the header */
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .code-copy-btn {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .code-copy-btn:hover {
        background: var(--color-primary);
        border-color: var(--color-primary);
    }
    
    .copy-toast {
        box-shadow: var(--shadow-xl), 0 0 30px rgba(16, 185, 129, 0.3);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .code-copy-btn {
        padding: 8px 12px;
        min-width: 80px;
        height: 36px;
        font-size: 0.8125rem;
    }
    
    .code-copy-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .copy-toast {
        bottom: 100px;
        padding: 12px 20px;
        font-size: 0.875rem;
        max-width: calc(100vw - 40px);
    }
}

/* ========================================
   AI CHAT PROMO SECTION
   ======================================== */
.chat-promo-section {
    padding: var(--space-16) 0 var(--space-8);
}

.chat-promo-card {
    position: relative;
    padding: var(--space-12);
    background: linear-gradient(135deg, #1a1a1f 0%, #252530 50%, #1a1a1f 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Animated Glow Effects */
.chat-promo-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: chatPromoGlow 8s ease-in-out infinite;
}

.chat-promo-glow-1 {
    width: 350px;
    height: 350px;
    background: rgba(99, 102, 241, 0.25);
    top: -120px;
    right: -80px;
    animation-delay: 0s;
}

.chat-promo-glow-2 {
    width: 280px;
    height: 280px;
    background: rgba(34, 211, 238, 0.2);
    bottom: -100px;
    left: -60px;
    animation-delay: -4s;
}

@keyframes chatPromoGlow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

/* Background Grid */
.chat-promo-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.5;
}

.chat-promo-inner {
    position: relative;
    z-index: 1;
}

/* Header */
.chat-promo-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.chat-promo-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent-cyan);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-6);
}

.chat-promo-badge svg {
    flex-shrink: 0;
}

.chat-promo-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

.chat-promo-desc {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
}

/* Feature Grid */
.chat-promo-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

@media (min-width: 640px) {
    .chat-promo-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chat-promo-feat {
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.chat-promo-feat:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.chat-promo-feat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    color: var(--color-primary-light);
    margin-bottom: var(--space-4);
}

.chat-promo-feat h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-2);
}

.chat-promo-feat p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
}

/* CTA */
.chat-promo-cta {
    text-align: center;
}

.chat-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    font-size: 1.0625rem;
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-spring);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.chat-promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
}

.chat-promo-sub {
    margin-top: var(--space-3);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 640px) {
    .chat-promo-card {
        padding: var(--space-8) var(--space-5);
    }

    .chat-promo-title {
        font-size: 1.5rem;
    }

    .chat-promo-desc {
        font-size: 0.9375rem;
    }

    .chat-promo-btn {
        padding: var(--space-3) var(--space-6);
        font-size: 1rem;
    }
}
