/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --accent: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 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: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

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

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

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

.btn-amazon {
    background: linear-gradient(135deg, #ff9900, #e88a00);
    color: white;
    font-weight: 600;
}

.btn-amazon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

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

/* Header */
.header {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

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

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-au {
    color: var(--primary);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: 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 {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

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

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

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Categories */
.categories {
    padding: 4rem 0 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover,
.category-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    transform: translateY(-2px);
}

.category-card.active {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

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

.category-name {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary);
}

/* Products */
.products {
    padding: 2rem 0 4rem;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.products-header .section-title {
    margin-bottom: 0;
    text-align: left;
}

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

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

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

/* Product 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-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

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

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

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

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

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

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

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

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent);
}

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

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

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

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

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

.btn-compare {
    background: var(--surface);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 0.5rem;
}

.btn-compare:hover,
.btn-compare.active {
    border-color: var(--secondary);
    color: var(--secondary);
    background: #ecfdf5;
}

/* Products Table */
.products-table-wrapper {
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

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

.products-table tr:hover {
    background: #f8fafc;
}

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

.products-table .product-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: var(--radius);
}

.products-table .product-name {
    font-weight: 600;
    color: var(--text-primary);
}

.table-rating {
    color: var(--accent);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Quiz Section */
.quiz-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

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

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

.quiz-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.quiz-header p {
    color: var(--text-secondary);
}

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

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

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

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

.quiz-question {
    margin-bottom: 1.5rem;
}

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

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

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

.quiz-option:hover {
    border-color: var(--primary-light);
    background: #eef2ff;
}

.quiz-option.selected {
    border-color: var(--primary);
    background: #eef2ff;
}

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

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

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

.quiz-recommendations {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

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

.quiz-recommendation-icon {
    font-size: 2.5rem;
}

.quiz-recommendation-content {
    flex: 1;
}

.quiz-recommendation-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.quiz-recommendation-match {
    font-size: 0.875rem;
    color: var(--secondary);
    font-weight: 500;
}

/* Compare Section */
.compare-section {
    padding: 4rem 0;
    background: var(--surface);
}

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

.compare-slot {
    min-height: 120px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 1rem;
    text-align: center;
}

.compare-slot:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.compare-slot.filled {
    border-style: solid;
    border-color: var(--primary);
    background: #eef2ff;
}

.slot-placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.slot-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

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

.slot-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.slot-remove {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 0.25rem;
}

.slot-remove:hover {
    color: #ef4444;
}

.compare-table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

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

.compare-table th:first-child {
    background: #f8fafc;
    color: var(--text-primary);
    text-align: left;
}

.compare-table td:first-child {
    background: #f8fafc;
    font-weight: 600;
    text-align: left;
}

.compare-table .product-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.compare-table .product-header-icon {
    font-size: 2rem;
}

#clearCompare {
    margin-top: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-search {
    margin: 1rem 0;
}

.modal-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.modal-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-products {
    display: grid;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.modal-product {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.modal-product:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

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

.modal-product-name {
    font-weight: 500;
}

/* About Section */
.about {
    padding: 4rem 0;
    background: var(--background);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-content > p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-list {
    list-style: none;
    display: grid;
    gap: 1.5rem;
}

.about-list li {
    display: flex;
    gap: 1rem;
}

.about-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.about-list h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

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

.about-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
}

.about-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.about-card p {
    font-size: 1rem;
    opacity: 0.9;
}

/* SEO Section */
.seo-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--surface) 0%, var(--background) 100%);
}

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

.seo-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.seo-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

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

.seo-list {
    list-style: none;
    margin: 1rem 0;
}

.seo-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.seo-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

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

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

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

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

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

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

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

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

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

.footer-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    line-height: 1.6;
}

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

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

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

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .products-header {
        flex-direction: column;
        gap: 1rem;
    }

    .products-header .section-title {
        text-align: center;
    }

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

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

    .quiz-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }
}
