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

:root {
    --primary-color: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --secondary-color: #EC4899;
    --secondary-dark: #DB2777;
    --accent-color: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --shadow-sm: 0 1px 2px 0 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-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

html {
    scroll-behavior: smooth;
}

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 600;
}

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

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

/* 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-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

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

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

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

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

/* Header */
.header {
    position: sticky;
    top: 0;
    background: 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 h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 span {
    font-weight: 400;
}

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

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

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

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

.nav a:hover::after {
    width: 100%;
}

.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: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #F5F3FF 0%, #FDF2F8 100%);
    padding: 5rem 0;
}

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

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

/* Section Styles */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

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

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

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    align-items: center;
}

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

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

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

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

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

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

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

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

.product-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.product-image {
    position: relative;
    height: 200px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-bestseller {
    background: var(--accent-color);
    color: white;
}

.badge-new {
    background: var(--success-color);
    color: white;
}

.badge-sale {
    background: var(--error-color);
    color: white;
}

.product-info {
    padding: 1.5rem;
}

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

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

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

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

.feature-tag {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

.product-price .original-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 0.5rem;
    font-weight: 400;
}

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

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

.btn-compare {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.75rem;
    flex: 0 0 auto;
}

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

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

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

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.products-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    white-space: nowrap;
}

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

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

.table-product-image {
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

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

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

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

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

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width var(--transition-normal);
}

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

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

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

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

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

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

.quiz-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quiz-option.selected .quiz-option-radio {
    border-color: var(--primary-color);
}

.quiz-option.selected .quiz-option-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

.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 p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.recommended-products {
    display: grid;
    gap: 1rem;
}

.recommended-product {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: left;
}

.recommended-product-image {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.recommended-product-info {
    flex: 1;
}

.recommended-product-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.recommended-product-info .match-score {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

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

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

.compare-slot {
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.compare-slot.filled {
    border-style: solid;
    border-color: var(--border-color);
    flex-direction: column;
    padding: 1rem;
    cursor: default;
}

.compare-slot.filled:hover {
    background: transparent;
}

.slot-placeholder {
    text-align: center;
    color: var(--text-light);
}

.slot-placeholder span {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.slot-product {
    text-align: center;
    width: 100%;
}

.slot-product-image {
    width: 100px;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin: 0 auto 1rem;
}

.slot-product h4 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slot-product .price {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.remove-slot {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.875rem;
}

.remove-slot:hover {
    color: var(--error-color);
}

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

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

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

.comparison-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.comparison-table tr:hover {
    background: var(--bg-secondary);
}

.check-icon {
    color: var(--success-color);
}

.cross-icon {
    color: var(--error-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    line-height: 1;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

.product-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.product-list-item:hover {
    border-color: var(--primary-color);
    background: #F5F3FF;
}

.product-list-item-image {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.product-list-item-info h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.product-list-item-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

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

.guide-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.guide-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #F5F3FF, #FDF2F8);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

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

.guide-card ul {
    list-style: none;
}

.guide-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.guide-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

.guide-card li strong {
    color: var(--text-primary);
}

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

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

.seo-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

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

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

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

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-col p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.7;
}

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

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

.footer-col a {
    color: var(--text-light);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

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

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

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

.affiliate-disclosure {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    max-width: 600px;
    margin: 0 auto;
}

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

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }

    .nav.active {
        display: block;
    }

    .nav ul {
        flex-direction: column;
        gap: 0;
    }

    .nav li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav li:last-child {
        border-bottom: none;
    }

    .nav a {
        display: block;
        padding: 1rem;
    }

    .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 h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

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

    .filter-group select {
        width: 100%;
    }

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

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

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

    .quiz-container {
        padding: 1.5rem;
    }

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

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }

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

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

    .product-actions .btn {
        width: 100%;
    }

    .btn-compare {
        order: 1;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
