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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
}

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

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

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

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

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--primary-color);
}

.logo span {
    color: var(--text-secondary);
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

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

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

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

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

.hero .btn-secondary {
    background-color: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.hero .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Categories */
.categories {
    padding: 3rem 0 1rem;
    background-color: var(--bg-secondary);
}

.categories h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.625rem 1.25rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Products Section */
.products {
    padding: 2rem 0 4rem;
    background-color: var(--bg-secondary);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.view-btn {
    padding: 0.5rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

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

.product-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    position: relative;
    height: 200px;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

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

.product-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: var(--accent-color);
    font-size: 0.875rem;
}

.rating-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

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

.product-actions .btn {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.btn-compare {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
}

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

.btn-compare.added {
    background-color: var(--primary-light);
    color: white;
}

/* Products Table */
.products-table {
    overflow-x: auto;
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

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

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

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

.products-table tr:hover td {
    background-color: var(--bg-secondary);
}

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

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

/* Quiz Section */
.quiz-section {
    padding: 5rem 0;
    background-color: var(--bg-primary);
}

.quiz-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.quiz-section > .container > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

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

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

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

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.quiz-question {
    display: none;
}

.quiz-question.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.quiz-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.quiz-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.quiz-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

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

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

.quiz-results h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.result-product {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.result-product .product-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Compare Section */
.compare-section {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
}

.compare-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.compare-section > .container > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.compare-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.compare-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
}

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

.compare-table-container {
    overflow-x: auto;
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

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

.compare-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
}

.compare-table th:first-child,
.compare-table td:first-child {
    text-align: left;
    font-weight: 600;
    background-color: var(--bg-secondary);
}

.compare-table .product-header {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.compare-table .check {
    color: var(--secondary-color);
    font-size: 1.25rem;
}

.compare-table .cross {
    color: var(--text-light);
    font-size: 1.25rem;
}

/* SEO Section */
.seo-section {
    padding: 5rem 0;
    background-color: var(--bg-primary);
}

.seo-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.seo-content {
    max-width: 800px;
}

.seo-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.seo-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-brand .logo span {
    color: var(--text-light);
}

.footer-brand p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-links h4,
.footer-categories h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-links a,
.footer-categories a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-categories a:hover {
    color: white;
}

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

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.affiliate-disclosure {
    font-size: 0.75rem !important;
    max-width: 600px;
    margin: 0 auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .nav.active {
        display: flex;
    }

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

    .hero {
        padding: 3rem 0;
    }

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

    .hero .btn {
        width: 100%;
        max-width: 300px;
    }

    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
        flex-wrap: nowrap;
    }

    .filter-btn {
        white-space: nowrap;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .quiz-container {
        padding: 1.5rem;
    }

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

    .compare-selector {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

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

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.product-card.highlight {
    animation: pulse 0.3s ease;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
