/**
 * pc_build.css - Premium Styling for PC Build Pages
 * Version 3.0 - With Light Mode (default) and Dark Mode
 */

/* ============================================
   THEME VARIABLES - LIGHT MODE (DEFAULT)
   ============================================ */
:root {
    /* Light Mode Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-hero: linear-gradient(135deg, #e0e7ff 0%, #f0f5ff 50%, #f8fafc 100%);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --accent-tertiary: #818cf8;
    --accent-success: #16a34a;
    --accent-warning: #d97706;
    --accent-amazon: #ff9900;
    --accent-amazon-hover: #e68a00;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(79, 70, 229, 0.2);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 48px rgba(79, 70, 229, 0.15);
    --gradient-amazon: linear-gradient(135deg, #ff9900 0%, #ff6600 100%);
    --meter-bg: rgba(0, 0, 0, 0.06);
    --specs-bg: rgba(0, 0, 0, 0.03);
    --search-bg: #ffffff;
    --search-border: rgba(0, 0, 0, 0.1);
    --toggle-bg: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a28;
    --bg-hero: linear-gradient(135deg, #1e1b4b 0%, #0f0a19 50%, #0a0a0f 100%);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-tertiary: #a5b4fc;
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 48px rgba(99, 102, 241, 0.2);
    --meter-bg: rgba(255, 255, 255, 0.1);
    --specs-bg: rgba(0, 0, 0, 0.25);
    --search-bg: #1a1a28;
    --search-border: rgba(255, 255, 255, 0.1);
    --toggle-bg: #1e293b;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

/* ============================================
   BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 125px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-tertiary);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    box-shadow: var(--shadow-hover);
}

.theme-toggle-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.theme-toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--toggle-bg);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.theme-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle-switch::after {
    transform: translateX(22px);
}

.theme-icon {
    font-size: 1rem;
}

/* Admin Badge */
.admin-badge {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

.admin-badge a {
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Container */
.pc-build-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.game-search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    background: var(--search-bg);
    border: 2px solid var(--search-border);
    border-radius: 50px;
    padding: 2px 2px 2px 18px;
    transition: all 0.3s ease;
}

.game-search-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.game-search-input {
    flex: 1;
    padding: 12px 18px 12px 8px;
    font-size: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
}

.game-search-input::placeholder {
    color: var(--text-muted);
}

.game-search-icon {
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-search-icon svg {
    width: 20px;
    height: 20px;
}

.game-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.game-search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-result-image {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.search-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    background: var(--bg-hero);
    padding: 40px 40px 60px;
    border-radius: 0 0 24px 24px;
    margin: 0 -20px 0;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--game-image);
    background-size: cover;
    background-position: center;
    opacity: 0.06;
    filter: blur(20px);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
}

.breadcrumbs .current {
    color: var(--text-primary);
}

.hero-flex {
    display: flex;
    gap: 48px;
    align-items: center;
}

.hero-image-wrapper {
    position: relative;
    flex-shrink: 0;
}

.hero-game-image {
    width: 220px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 80px rgba(99, 102, 241, 0.1);
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .hero-game-image {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(99, 102, 241, 0.2);
}

.hero-game-image:hover {
    transform: scale(1.03);
}

.game-meta {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.meta-tag {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-text {
    flex: 1;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.hero-title .game-name {
    display: block;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    max-width: 600px;
}

.hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.badge {
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
}

.badge-fps {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.badge-quality {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.badge-year {
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

.quick-nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--accent-secondary);
    color: white;
    transform: translateY(-2px);
}

.nav-btn-alt {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.nav-btn-alt:hover {
    background: var(--accent-primary);
    color: white;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 24px;
    margin: -30px 0 40px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 3;
    box-shadow: var(--shadow-card);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    color: var(--accent-secondary);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================
   SECTIONS
   ============================================ */
.builds-section,
.laptops-section,
.related-section {
    margin-bottom: 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-header h2 svg {
    width: 28px;
    height: 28px;
    color: var(--accent-secondary);
}

.section-intro {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   BUILD CARDS
   ============================================ */
.builds-grid,
.laptops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.build-card,
.laptop-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.build-card:hover .card-glow {
    opacity: 0.03;
}

.build-card:hover,
.laptop-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-8px);
    border-color: var(--accent-primary);
}

/* Tier Accents */
.build-card[data-tier="1080p"] {
    border-top: 4px solid var(--accent-success);
}

.build-card[data-tier="1440p"] {
    border-top: 4px solid var(--accent-primary);
}

.build-card[data-tier="4k"] {
    border-top: 4px solid var(--accent-warning);
}

.laptop-card[data-tier="value"] {
    border-top: 4px solid var(--accent-success);
}

.laptop-card[data-tier="balanced"] {
    border-top: 4px solid var(--accent-primary);
}

.laptop-card[data-tier="premium"] {
    border-top: 4px solid var(--accent-warning);
}

.build-header,
.laptop-header {
    text-align: center;
    margin-bottom: 20px;
}

.tier-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.build-icon,
.laptop-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.build-header h3,
.laptop-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.build-desc,
.laptop-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   PERFORMANCE METER
   ============================================ */
.performance-meter {
    background: var(--meter-bg);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.meter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.meter-bar {
    height: 8px;
    background: var(--meter-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-success), var(--accent-primary), var(--accent-warning));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.meter-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meter-stats strong {
    color: var(--text-primary);
}

/* ============================================
   SPEC ROWS
   ============================================ */
.build-specs,
.laptop-specs {
    background: var(--specs-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.spec-row {
    display: grid;
    grid-template-columns: 28px 70px 1fr;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-icon {
    color: var(--accent-secondary);
}

.spec-icon svg {
    width: 20px;
    height: 20px;
}

.spec-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.spec-value small,
.wattage {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.build-explanation,
.laptop-usage {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.7;
}

/* ============================================
   AMAZON BUTTONS
   ============================================ */
.amazon-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.amazon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: center;
    border: none;
    cursor: pointer;
}

.amazon-btn-primary {
    background: var(--gradient-amazon);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

.amazon-btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 25px rgba(255, 153, 0, 0.4);
    color: #000;
}

.amazon-btn-primary .btn-icon {
    font-size: 1.2rem;
}

.amazon-btn-primary .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.amazon-btn-primary .btn-text small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.amazon-btn-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.amazon-btn-secondary {
    background: rgba(255, 153, 0, 0.1);
    color: var(--accent-amazon);
    border: 1px solid rgba(255, 153, 0, 0.3);
    padding: 10px 12px;
    font-size: 0.85rem;
}

.amazon-btn-secondary:hover {
    background: var(--accent-amazon);
    color: #000;
}

/* Brand-specific button colors */
.amazon-btn-nvidia {
    background: linear-gradient(135deg, #76b900 0%, #5a8f00 100%) !important;
    border-color: #76b900 !important;
    color: #fff !important;
}

.amazon-btn-nvidia:hover {
    background: linear-gradient(135deg, #8bd400 0%, #76b900 100%) !important;
    color: #fff !important;
}

.amazon-btn-amd {
    background: linear-gradient(135deg, #ed1c24 0%, #b81419 100%) !important;
    border-color: #ed1c24 !important;
    color: #fff !important;
}

.amazon-btn-amd:hover {
    background: linear-gradient(135deg, #ff2d35 0%, #ed1c24 100%) !important;
    color: #fff !important;
}

.amazon-btn-intel {
    background: linear-gradient(135deg, #0071c5 0%, #00559a 100%) !important;
    border-color: #0071c5 !important;
    color: #fff !important;
}

.amazon-btn-intel:hover {
    background: linear-gradient(135deg, #0086e6 0%, #0071c5 100%) !important;
    color: #fff !important;
}

.amazon-btn-brand {
    padding: 12px 16px;
    font-size: 0.9rem;
}

.amazon-btn-brand .btn-icon {
    font-size: 1rem;
}

.amazon-btn-brand .btn-text {
    display: inline;
}

/* ============================================
   RELATED GAMES
   ============================================ */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.related-image-wrapper {
    position: relative;
    overflow: hidden;
}

.related-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-card:hover .related-image {
    transform: scale(1.05);
}

.related-overlay {
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-weight: 600;
}

.related-card:hover .related-overlay {
    opacity: 1;
}

.related-title {
    display: block;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* External Links */
.external-links {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.external-links h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--specs-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.link-card:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.link-icon {
    font-size: 1.5rem;
}

.link-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   FOOTER
   ============================================ */
.pc-footer {
    text-align: center;
    padding: 48px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.affiliate-disclosure {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .hero-flex {
        flex-direction: column;
        text-align: center;
    }

    .hero-game-image {
        width: 180px;
    }

    .hero-intro {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-badges,
    .quick-nav {
        justify-content: center;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 16px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 30px 20px 50px;
    }

    .builds-grid,
    .laptops-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .build-card,
    .laptop-card {
        padding: 24px;
    }

    .quick-nav {
        flex-direction: column;
    }

    .nav-btn {
        justify-content: center;
    }

    .amazon-btn-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pc-build-container {
        padding: 0 12px;
    }

    .hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .stats-bar {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-image {
        height: 120px;
    }

    .theme-toggle-label {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.build-card,
.laptop-card {
    animation: fadeIn 0.5s ease forwards;
}

.build-card:nth-child(2) {
    animation-delay: 0.1s;
}

.build-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================
   PERFORMANCE TIPS SECTION
   ============================================ */
.tips-section {
    margin-bottom: 60px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.tip-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.tip-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.tip-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tip-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-section {
    margin-bottom: 60px;
}

.faq-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--accent-primary);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: var(--bg-card-hover);
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent-primary);
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ============================================
   SIMILAR GAMES BY SPECS SECTION
   ============================================ */
.similar-specs-section {
    margin-bottom: 60px;
}

.similar-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.similar-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.similar-category h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.similar-games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.similar-game-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card-hover);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.similar-game-card:hover {
    background: var(--accent-primary);
    color: white;
}

.similar-game-card img {
    width: 50px;
    height: 65px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.similar-game-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: inherit;
}

@media (max-width: 768px) {
    .tips-grid {
        grid-template-columns: 1fr;
    }

    .similar-specs-grid {
        grid-template-columns: 1fr;
    }

    .faq-question {
        padding: 16px 20px;
        font-size: 0.95rem;
    }

    .faq-answer p {
        padding: 0 20px 16px;
        font-size: 0.9rem;
    }
}

/* ============================================
   HOMEPAGE STYLES
   ============================================ */

/* Hero Section Adjustments */
.homepage-hero {
    border-radius: 24px;
    padding: 60px 40px;
    margin-bottom: 60px;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(118, 185, 0, 0.15), transparent 40%),
        radial-gradient(circle at bottom left, rgba(0, 113, 197, 0.15), transparent 40%),
        var(--bg-card);
    border: 1px solid var(--border-color);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Homepage Search */
.hero-search {
    max-width: 600px;
    margin: 30px auto 0;
}

.search-wrapper {
    position: relative;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(118, 185, 0, 0.2);
    transform: translateY(-2px);
}

.search-icon {
    font-size: 1.2rem;
    padding-left: 16px;
    color: var(--text-secondary);
}

.search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 1.05rem;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-result-image {
    width: 40px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
}

.search-result-info {
    flex-grow: 1;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-result-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.search-loading,
.search-no-results,
.search-error {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Home Section Headers */
.home-section {
    margin-bottom: 80px;
}

.section-intro {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 1.05rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
    border-color: var(--accent-primary);
}

.game-image-wrapper {
    position: relative;
    padding-top: 133%;
    /* 3:4 Aspect Ratio */
    overflow: hidden;
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .game-image {
    transform: scale(1.05);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.view-build-btn {
    background: white;
    color: black;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.game-card:hover .view-build-btn {
    transform: translateY(0);
}

.game-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.game-genre {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Small Game Card Variant */
.games-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.game-card-small .game-title {
    font-size: 0.95rem;
}

.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Genre Grid */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.genre-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-align: center;
}

.genre-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.genre-icon {
    font-size: 2rem;
}

.genre-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* How It Works Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    counter-reset: steps;
}

.step-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-color);
}

.step-card h3 {
    margin: 16px 0 10px;
    font-size: 1.2rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--bg-card-hover);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    color: white;
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2) 75%, transparent 75%, transparent);
    background-size: 60px 60px;
    opacity: 0.1;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    position: relative;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
    position: relative;
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--accent-primary);
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: var(--accent-primary);
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

@media (max-width: 768px) {
    .homepage-hero {
        padding: 40px 20px;
    }

    .hero-stats {
        gap: 20px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .view-build-btn {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .cta-section {
        padding: 40px 20px;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }
}

/* Benchmark Table Styles (Fixed Layout) */
.benchmark-container {
    margin: 1.5rem 0 2rem;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background: #fff;
}

.benchmark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    min-width: 500px;
    /* Ensure check on mobile */
}

.benchmark-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.benchmark-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.benchmark-table tr:last-child td {
    border-bottom: none;
}

/* Specific Columns */
.res-col {
    width: 80px;
}

.res-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.benchmark-table tr:nth-child(2) .res-badge {
    background: #8b5cf6;
}

/* 1440p */
.benchmark-table tr:nth-child(3) .res-badge {
    background: #f59e0b;
}

/* 4K */

.gpu-col {
    font-family: 'Inter', monospace;
    /* Monospace for alignment? No, Inter is fine */
    font-weight: 500;
}

.fps-col strong {
    color: #16a34a;
    font-size: 1.1em;
}

.benchmark-note {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0.5rem 1rem 1rem;
    font-style: italic;
}

[data-theme='dark'] .benchmark-container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
}

[data-theme='dark'] .benchmark-table th {
    background: #0f172a;
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme='dark'] .benchmark-table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}


/* ============================================
   SITE HEADER (Common)
   ============================================ */
.pc-site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    will-change: transform;
    box-sizing: border-box;
}

[data-theme="dark"] .pc-site-header {
    background: rgba(18, 18, 26, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   SECONDARY STICKY SUB-HEADER
   ============================================ */
.pc-sub-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 9997;
    height: 50px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

[data-theme="dark"] .pc-sub-header {
    background: rgba(18, 18, 26, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sub-header-container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Search Icon Button in Header */
.header-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-search-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

/* ============================================
   SEARCH MODAL
   ============================================ */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.search-modal.active {
    opacity: 1;
    pointer-events: all;
}

.search-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 640px;
    margin: 0 16px;
    overflow: hidden;
    transform: translateY(-12px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal.active .search-modal-box {
    transform: translateY(0);
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-modal-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
}

.search-modal-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

#modalSearchInput {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 500;
    caret-color: var(--accent-primary);
}

#modalSearchInput::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.search-modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.search-modal-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 0;
}

.modal-results-grid {
    display: flex;
    flex-direction: column;
}

.modal-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    transition: background 0.15s ease;
    text-decoration: none;
}

.modal-result-card:hover {
    background: var(--bg-card-hover);
}

.modal-result-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.modal-result-body {
    flex: 1;
    min-width: 0;
}

.modal-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modal-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-no-results {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-modal-hint {
    padding: 10px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.search-modal-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-secondary);
}

body.modal-open {
    overflow: hidden;
}

[data-theme="dark"] .search-modal-box {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

@media (max-width: 640px) {
    .search-modal {
        padding-top: 0;
        align-items: flex-end;
    }
    .search-modal-box {
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        transform: translateY(100%);
    }
    .search-modal.active .search-modal-box {
        transform: translateY(0);
    }
    .search-modal-results {
        max-height: 60vh;
    }
}

.sub-header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sub-nav-link:hover {
    color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.sub-nav-link.active {
    color: white;
    background: var(--accent-primary);
}

@media (max-width: 576px) {
    .sub-header-container {
        gap: 8px;
        padding: 0 12px;
        justify-content: center;
    }
    .sub-header-nav {
        flex: 1;
        overflow-x: auto;
        white-space: nowrap;
        justify-content: center;
        gap: 4px;
        scrollbar-width: none;
    }
    .sub-header-nav::-webkit-scrollbar {
        display: none;
    }
    .sub-nav-link {
        padding: 4px 10px;
        font-size: 0.78rem;
    }
}

/* ── Sub-header Live AJAX Search Bar ── */
.sub-menu-search-wrap {
    position: relative;
    max-width: 280px;
    width: 100%;
    box-sizing: border-box;
}

.sub-menu-search-inner {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    height: 34px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

[data-theme="dark"] .sub-menu-search-inner {
    background: rgba(30, 41, 59, 0.4);
}

.sub-menu-search-inner:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.sub-menu-search-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 8px;
    display: flex;
    align-items: center;
}

#subHeaderSearchInput {
    flex: 1;
    border: none !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

#subHeaderSearchInput::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Autocomplete results dropdown for sub-header search */
.sub-menu-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 380px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .sub-menu-search-results {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.sub-menu-search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu-search-results::-webkit-scrollbar {
    width: 6px;
}

.sub-menu-search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

[data-theme="dark"] .sub-menu-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* Shared Search Result Item styles inside sub-header-search */
.sub-menu-search-results .search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.sub-menu-search-results .search-result-item:last-child {
    border-bottom: none;
}

.sub-menu-search-results .search-result-item:hover {
    background-color: var(--bg-card-hover);
}

.sub-menu-search-results .search-result-image {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sub-menu-search-results .search-result-info {
    flex: 1;
    min-width: 0;
}

.sub-menu-search-results .search-result-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.88rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-menu-search-results .search-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sub-menu-search-results .search-loading,
.sub-menu-search-results .search-no-results {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .sub-menu-search-wrap {
        max-width: 200px;
    }
    .sub-menu-search-results {
        width: 280px;
    }
}

@media (max-width: 576px) {
    .sub-menu-search-wrap {
        max-width: 140px;
    }
    #subHeaderSearchInput::placeholder {
        font-size: 0.78rem;
    }
    .sub-menu-search-results {
        width: 250px;
        right: -10px; /* offset for small screen bounds */
    }
}


.header-logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
}

.header-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-primary);
    background: var(--bg-card-hover);
}

/* Header Components Overrides */
.pc-site-header .theme-toggle {
    position: static;
    margin: 0;
    box-shadow: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}


/* Back to Main Site Link */
.back-to-main-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 12px;
    padding: 4px 12px;
    border: 1px solid var(--accent-primary);
    border-radius: 20px;
    transition: all 0.2s;
    background: rgba(99, 102, 241, 0.1);
}

.back-to-main-link:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.back-to-main-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   E-E-A-T AUTHOR CARD & DATABASE STATS
   ============================================ */
.eeat-section {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin: 40px 0;
    box-shadow: var(--shadow-card);
}

.author-card {
    flex: 1;
    min-width: 280px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.author-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.author-title {
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.db-stats-card {
    flex: 1;
    min-width: 280px;
    border-left: 2px dashed var(--border-color);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .db-stats-card {
        border-left: none;
        border-top: 2px dashed var(--border-color);
        padding-left: 0;
        padding-top: 24px;
    }
}

.db-stats-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.db-stats-row {
    display: flex;
    gap: 16px;
}

.db-stat-box {
    text-align: center;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 12px 18px;
    flex: 1;
}

.db-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.db-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   MOBILE RESPONSIVE NAVIGATION
   ============================================ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle .bar {
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Transform hamburger to 'X' when active */
.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 9999;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 20px 24px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
    }

    [data-theme="dark"] .header-nav {
        background: rgba(18, 18, 26, 0.95);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .header-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-link {
        padding: 12px 20px;
        border-radius: 12px;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .pc-site-header .theme-toggle {
        margin: 8px 0 0 0;
        justify-content: center;
        display: flex;
        width: 100%;
        box-sizing: border-box;
        border-radius: 12px;
    }
}