/* ===== CSS Variables ===== */
:root {
    --primary: #ff6b9d;
    --primary-dark: #e5527f;
    --secondary: #7c3aed;
    --secondary-dark: #6d28d9;
    --accent: #fbbf24;
    --accent-dark: #f59e0b;

    --bg-primary: #fefefe;
    --bg-secondary: #f8f9fc;
    --bg-gradient: linear-gradient(135deg, #fff5f8 0%, #f0f4ff 50%, #fff8f0 100%);

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    --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: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

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

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

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

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

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

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

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

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

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

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

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

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

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

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--bg-gradient);
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

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

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

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

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

.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-secondary);
}

.hero-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.floating-candy {
    position: absolute;
    font-size: 3rem;
    animation: float 6s ease-in-out infinite;
}

.candy-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.candy-2 {
    top: 25%;
    right: 15%;
    animation-delay: 1.5s;
}

.candy-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 3s;
}

.candy-4 {
    bottom: 30%;
    right: 10%;
    animation-delay: 4.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    gap: 0.5rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

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

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

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

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

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

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

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

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    background: white;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.view-toggle {
    display: flex;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

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

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

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

.product-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #fff5f8, #f0f4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

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

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

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

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.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;
}

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

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

.crunch-level {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.crunch-bar {
    display: flex;
    gap: 2px;
}

.crunch-bar span {
    width: 8px;
    height: 8px;
    background: var(--border-color);
    border-radius: 2px;
}

.crunch-bar span.filled {
    background: var(--secondary);
}

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

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

.btn-compare {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition);
}

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

/* ===== Product Table ===== */
.products-table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.products-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: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

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

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

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

.products-table .product-name {
    font-weight: 500;
}

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

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

.compare-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

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

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

.compare-slot-empty {
    text-align: center;
    color: var(--text-secondary);
}

.plus-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary);
    margin: 0 auto 1rem;
}

.compare-slot-filled {
    width: 100%;
    height: 100%;
    padding: 1.5rem;
}

.compare-slot-filled .compare-product-info {
    text-align: center;
}

.compare-slot-filled .product-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.compare-slot-filled .product-name {
    font-weight: 600;
    font-size: 1.125rem;
}

.remove-compare {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-compare:hover {
    background: var(--primary-dark);
}

.comparison-result {
    overflow-x: auto;
}

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

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

.comparison-table th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
}

.comparison-table th:first-child {
    text-align: left;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
    background: var(--bg-secondary);
}

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

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.quiz-start {
    padding: 3rem;
    text-align: center;
}

.quiz-intro {
    max-width: 500px;
    margin: 0 auto;
}

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

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

.quiz-intro p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.quiz-questions {
    padding: 2rem 3rem 3rem;
}

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

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

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

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

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

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

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

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

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(255, 107, 157, 0.1);
}

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

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

.quiz-results {
    padding: 3rem;
    text-align: center;
}

.results-header {
    margin-bottom: 2rem;
}

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

.results-header h3 {
    font-size: 1.5rem;
}

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

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

.recommended-product .product-emoji {
    font-size: 2.5rem;
}

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

.recommended-product .product-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

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

/* ===== How It Works ===== */
.how-it-works {
    padding: 5rem 0;
    background: white;
}

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

.process-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

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

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

.process-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.process-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

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

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

.seo-content h2 {
    font-size: 2rem;
    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 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

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

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

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

.footer-brand .logo-text {
    color: white;
}

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

.footer-links {
    display: contents;
}

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

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

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

.footer-column a {
    color: var(--text-light);
    transition: var(--transition);
}

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

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

.affiliate-disclosure {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-content h3 {
    margin-bottom: 1.5rem;
}

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

.modal-product {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.modal-product:hover {
    background: rgba(255, 107, 157, 0.1);
    transform: translateX(4px);
}

.modal-product .product-emoji {
    font-size: 2rem;
}

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

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

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

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

    .nav-links li {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }

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

    .hero {
        padding: 5rem 0 3rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

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

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

    .filter-group {
        justify-content: center;
    }

    .view-toggle {
        align-self: center;
    }

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

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

    .quiz-start,
    .quiz-questions,
    .quiz-results {
        padding: 2rem 1.5rem;
    }

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

    .footer-links {
        display: flex;
        justify-content: center;
        gap: 3rem;
    }

    .floating-candy {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

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

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

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

    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }
}

/* ===== 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(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.3s; }
.product-card:nth-child(5) { animation-delay: 0.4s; }
.product-card:nth-child(6) { animation-delay: 0.5s; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
