*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Navbar */
.navbar {
    background: var(--bg-dark);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo-img {
    height: 40px;
    width: auto;
}

.nav-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.logo-picker {
    color: #3b82f6;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }

.nav-admin {
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.8rem;
}

.sale-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 700;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
    color: white;
    padding: 6rem 0;
    margin: 0 -1.5rem 2rem -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    text-align: center;
}

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

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    line-height: 1.8;
}

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

/* Sections */
.section { margin: 3rem 0; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h1, .section-header h2 { font-size: 1.8rem; font-weight: 700; }

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

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

.card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f8f8;
    padding: 1rem;
}

.card-body { padding: 1.25rem; }

.card-badge {
    display: inline-block;
    background: #dbeafe;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-kit {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 0.4rem;
}

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

.card-text { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.75rem; }

.card-brand { color: var(--text-light); font-size: 0.85rem; margin-bottom: 0.5rem; }

.card-price { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; }

.card-source { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.5rem; }

.seller-logo-img {
    height: 18px;
    width: auto;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 4px;
    background: white;
    padding: 1px;
}

.card-source .seller-logo-img {
    height: 16px;
}

.card-actions { display: flex; gap: 0.5rem; align-items: flex-start; flex-wrap: wrap; }

/* Sale cards */
.sale-card { border-top: 3px solid var(--danger); }

.sale-badge-large {
    display: inline-block;
    background: var(--danger);
    color: white;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.price-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }

.original-price { text-decoration: line-through; color: var(--text-light); font-size: 1rem; }

.sale-price { color: var(--danger); font-size: 1.5rem; font-weight: 700; }

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-secondary { background: rgba(255,255,255,0.15); color: white; }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }

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

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-success { background: #22c55e; color: white; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s;
}

.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.input-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; border-radius: 6px; border: 1px solid var(--border); }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; font-size: 0.85rem; cursor: pointer; }

/* Alert */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* Flash messages */
.flash-messages { margin: 1rem 0; }

.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.flash-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; opacity: 0.5; }
.flash-close:hover { opacity: 1; }

/* Quiz */
.quiz-form { max-width: 700px; margin: 0 auto; }

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

.question-number { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }

.question-text { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }

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

.quiz-option {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

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

.quiz-option.selected {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.quiz-option input[type="radio"] { display: none; }

.option-label { font-weight: 600; font-size: 1rem; }

.option-desc { color: var(--text-light); font-size: 0.85rem; margin-top: 0.25rem; }

.quiz-user-info {
    background: #f8faff;
    border: 1px solid #dbeafe;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.quiz-user-info h3 { margin-bottom: 0.5rem; }
.quiz-user-info p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1rem; }

/* Results */
.result-summary {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.summary-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.summary-label { display: block; font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }

.summary-value { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

.recommendation-card { border-left: 4px solid var(--primary); }

.rec-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-light); }

.empty-state h3 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--text); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-info { color: var(--text-light); font-size: 0.9rem; }

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

.pagination-ellipsis {
    color: var(--text-light);
    padding: 0 0.25rem;
}

/* How it works */
.how-it-works { text-align: center; }

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

.step { padding: 2rem; }

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 auto 1rem;
}

.step h3 { margin-bottom: 0.5rem; }

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

/* Seller info */
.seller-info {
    font-size: 1rem;
    color: var(--text);
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    display: inline-block;
}

/* Specs table */
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.spec-label { font-weight: 600; color: var(--text-light); width: 200px; white-space: nowrap; }

/* Email alert section */
.email-alert-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2rem 0;
}
.email-alert-section h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.email-alert-section p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1rem; }
.email-alert-form { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.section-email-results { text-align: center; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: var(--radius); padding: 2rem; }

/* Printer detail */
.printer-detail { margin: 2rem 0; }

.printer-detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.printer-detail-img {
    width: 400px;
    max-width: 100%;
    height: 300px;
    object-fit: contain;
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
}

.printer-detail-info { flex: 1; }

.printer-detail-info h1 { font-size: 2rem; margin-bottom: 0.5rem; }

.brand-name { font-size: 1.1rem; color: var(--text-light); margin-bottom: 0.75rem; }

.price-section { margin: 1.5rem 0; display: flex; align-items: center; gap: 1rem; }

.detail-section { margin: 2rem 0; }

.detail-section h2 { font-size: 1.3rem; margin-bottom: 1rem; }

.specs-pre {
    background: #f8f8f8;
    padding: 1.25rem;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* Price history */
.price-history-chart { max-height: 400px; overflow-y: auto; }

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

.price-table th, .price-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.price-table th { font-weight: 600; color: var(--text-light); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }

.trend-cell { font-size: 1.1rem; text-align: center; }
.trend-up { color: #22c55e; }
.trend-down { color: #ef4444; }
.trend-flat { color: #6b7280; }

/* Filter bar */
.filter-bar { margin-bottom: 1.5rem; }

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

.filter-form .form-input { width: auto; }
.range-form { display: flex; align-items: center; gap: 0.5rem; }

.inline-form { display: inline; }

/* Admin */
.admin-actions { display: flex; gap: 0.75rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-light); font-size: 0.9rem; margin-top: 0.25rem; }

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.admin-card h2 { font-size: 1.2rem; margin-bottom: 1rem; }

.affiliate-form textarea { resize: vertical; }

.help-text { font-size: 0.8rem; color: var(--text-light); margin-top: 0.4rem; }

.table-wrapper { overflow-x: auto; }

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

.admin-table th, .admin-table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.admin-table th { font-weight: 600; color: var(--text-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Admin login */
.admin-login-form { max-width: 400px; margin: 0 auto; }

/* Footer */
.footer {
    background: var(--bg-dark);
    color: #94a3b8;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

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

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

.footer a { color: #94a3b8; text-decoration: none; display: block; margin-bottom: 0.4rem; font-size: 0.9rem; }
.footer a:hover { color: white; }

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

.footer-legal-links { margin-left: 1rem; }
.footer-legal-links a { color: #64748b; text-decoration: none; }
.footer-legal-links a:hover { color: #94a3b8; text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-dark); padding: 1rem; }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
    .hero-content h1 { font-size: 2rem; }
    .hero { padding: 4rem 0; }
    .card-grid { grid-template-columns: 1fr; }
    .printer-detail-header { flex-direction: column; }
    .printer-detail-img { width: 100%; height: auto; max-height: 250px; }
    .admin-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
