/* ===== CSS Variables ===== */
:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --secondary: #1e1b4b;
    --secondary-light: #312e81;
    --accent: #ec4899;
    --background: #0f0a1f;
    --background-light: #1a1333;
    --surface: #251d3a;
    --surface-light: #352a50;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

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

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

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--secondary);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    color: var(--secondary);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--secondary);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===== Header & Navigation ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 10, 31, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.logo:hover {
    color: var(--text);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition);
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 70px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 40%),
                radial-gradient(ellipse at 20% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
}

.hero-content {
    position: relative;
    text-align: center;
    padding: 4rem 0;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

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

.hero-lights {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 150, 0.8), transparent),
        radial-gradient(2px 2px at 20% 50%, rgba(255, 200, 150, 0.6), transparent),
        radial-gradient(3px 3px at 30% 30%, rgba(255, 220, 180, 0.7), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(255, 255, 200, 0.5), transparent),
        radial-gradient(2px 2px at 50% 40%, rgba(255, 180, 150, 0.6), transparent),
        radial-gradient(3px 3px at 60% 20%, rgba(255, 255, 180, 0.7), transparent),
        radial-gradient(2px 2px at 70% 60%, rgba(255, 200, 180, 0.5), transparent),
        radial-gradient(2px 2px at 80% 35%, rgba(255, 220, 150, 0.6), transparent),
        radial-gradient(3px 3px at 90% 50%, rgba(255, 255, 200, 0.7), transparent),
        radial-gradient(2px 2px at 15% 80%, rgba(255, 180, 180, 0.5), transparent),
        radial-gradient(2px 2px at 85% 80%, rgba(255, 200, 150, 0.6), transparent);
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ===== Categories Section ===== */
.categories {
    padding: 4rem 0;
    background: var(--background-light);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
    text-align: center;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.category-icon {
    font-size: 2rem;
}

.category-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

/* ===== Section Header ===== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== Products Section ===== */
.products {
    padding: 5rem 0;
}

.products-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.filter-select {
    padding: 0.625rem 1rem;
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition);
}

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

.product-image {
    position: relative;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    overflow: hidden;
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.product-compare-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}

.product-compare-btn:hover,
.product-compare-btn.active {
    background: var(--primary);
    color: var(--secondary);
}

.product-content {
    padding: 1.25rem;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-feature {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--background);
    border-radius: 4px;
    color: var(--text-muted);
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.product-rating .stars {
    color: var(--primary);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-actions .btn {
    flex: 1;
}

/* Products Table */
.products-table {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.products-table table {
    width: 100%;
    border-collapse: collapse;
}

.products-table th,
.products-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.products-table th {
    background: var(--background);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.products-table td {
    font-size: 0.875rem;
}

.products-table tr:hover {
    background: var(--surface-light);
}

.products-table .product-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.products-table .product-emoji {
    font-size: 1.5rem;
}

.products-table .table-compare-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* ===== Quiz Section ===== */
.quiz {
    padding: 5rem 0;
    background: var(--background-light);
}

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border);
}

.quiz-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--background);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 20%;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.quiz-question {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-question h3 {
    margin-bottom: 0.5rem;
}

.quiz-options {
    display: grid;
    gap: 1rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.quiz-option:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
}

.quiz-option-icon {
    font-size: 1.5rem;
}

.quiz-option-text {
    font-weight: 500;
}

.quiz-option-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.quiz-result {
    text-align: center;
}

.quiz-result h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.quiz-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.quiz-recommendations {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    text-align: left;
}

.quiz-recommendation {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.quiz-recommendation-emoji {
    font-size: 2rem;
}

.quiz-recommendation-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.quiz-recommendation-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.quiz-recommendation .btn {
    margin-left: auto;
}

.quiz-restart {
    margin-top: 2rem;
}

/* ===== Compare Section ===== */
.compare {
    padding: 5rem 0;
}

.compare-container {
    min-height: 200px;
}

.compare-empty {
    text-align: center;
    padding: 3rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.compare-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.compare-empty p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.compare-table {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.compare-table table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.compare-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-muted);
    width: 150px;
}

.compare-table td {
    min-width: 200px;
}

.compare-product-header {
    text-align: center;
    padding: 1.5rem;
}

.compare-product-emoji {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.compare-product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.compare-product-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.compare-remove-btn {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
}

.compare-remove-btn:hover {
    background: var(--error);
    color: white;
}

#clearCompare {
    margin-top: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Guide Section ===== */
.guide {
    padding: 5rem 0;
    background: var(--background-light);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.guide-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.guide-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.guide-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.guide-card h3 {
    margin-bottom: 1rem;
}

.guide-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.guide-card p:last-child {
    margin-bottom: 0;
}

/* ===== SEO Content Section ===== */
.seo-content {
    padding: 5rem 0;
    background: var(--surface);
}

.seo-content-inner {
    max-width: 800px;
    margin: 0 auto;
}

.seo-content h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.seo-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.seo-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.seo-cta {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}

/* ===== Footer ===== */
.footer {
    padding: 4rem 0 2rem;
    background: var(--background);
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.9375rem;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    color: var(--text);
}

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

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9375rem;
    transition: color var(--transition);
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.affiliate-disclosure {
    font-size: 0.8125rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

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

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 1001;
}

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

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

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

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--background);
        padding: 1.5rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

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

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

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

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

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        margin-left: 0;
        justify-content: center;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group label {
        margin-bottom: 0.25rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .quiz-container {
        padding: 1.5rem;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
    }

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

    .product-actions {
        flex-direction: column;
    }
}
