/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f8fafc; color: #1e293b; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { margin: 40px 0; }
.section h2 { font-size: 1.5rem; margin-bottom: 20px; color: #0f172a; border-left: 4px solid #2563eb; padding-left: 12px; }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.site-header { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; gap: 24px; padding: 14px 20px; flex-wrap: wrap; }
.logo { font-size: 1.4rem; font-weight: 800; color: #2563eb; text-decoration: none; }
.logo:hover { text-decoration: none; }
.site-header nav { display: flex; gap: 12px; flex-wrap: wrap; }
.site-header nav a { color: #475569; font-size: .9rem; padding: 4px 8px; border-radius: 6px; transition: background .15s; }
.site-header nav a:hover { background: #f1f5f9; color: #2563eb; text-decoration: none; }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%); color: #fff; text-align: center; padding: 72px 20px 60px; border-radius: 20px; margin: 28px 0; position: relative; overflow: hidden; }
.hero::before { content:''; position:absolute; inset:0; background: radial-gradient(ellipse at 70% 20%, rgba(255,255,255,.08) 0%, transparent 60%); pointer-events: none; }
.hero h1 { font-size: 3rem; font-weight: 900; margin-bottom: 10px; position: relative; }
.hero > p { font-size: 1.15rem; opacity: .85; position: relative; }

/* ─── Compare Form ──────────────────────────────────────────────────────────── */
.compare-form { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; position: relative; z-index: 2; }
.compare-inputs { display: flex; align-items: flex-end; gap: 12px; width: 100%; max-width: 820px; flex-wrap: wrap; justify-content: center; }
.input-wrap { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 240px; }
.input-wrap label { color: rgba(255,255,255,.95); font-size: .8rem; font-weight: 700; text-align: left; letter-spacing: 1px; text-transform: uppercase; }
.input-wrap input {
  width: 100%; padding: 16px 20px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.95);
  color: #1e293b; font-size: 1rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  -webkit-appearance: none;
  position: relative; z-index: 1;
}
.input-wrap input::placeholder { color: #94a3b8; }
.input-wrap input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147,197,253,.3); }
.vs-text { color: #fff; font-weight: 900; font-size: 1.1rem; background: rgba(255,255,255,.2); padding: 10px 14px; border-radius: 50%; margin-bottom: 4px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.btn-compare {
  background: #fff; color: #2563eb; font-weight: 800; font-size: 1.1rem;
  padding: 16px 44px; border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,.2); transition: transform .2s, box-shadow .2s;
  letter-spacing: .3px; position: relative; z-index: 2;
}
.btn-compare:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.3); cursor: pointer; }

/* ─── Loading overlay ────────────────────────────────────────────────────────── */
.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.85); z-index: 999; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: #fff; }
.loading-overlay.active { display: flex; }
.spinner { width: 56px; height: 56px; border: 5px solid rgba(255,255,255,.2); border-top-color: #60a5fa; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 1.3rem; font-weight: 800; }
.loading-sub { opacity: .7; font-size: .9rem; }
.loading-products { margin-top: 8px; background: rgba(255,255,255,.1); padding: 10px 24px; border-radius: 20px; font-weight: 700; font-size: 1rem; }

/* ─── Recent list ────────────────────────────────────────────────────────────── */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 2px solid #e2e8f0; border-radius: 10px; padding: 12px 18px; transition: border-color .2s; text-decoration: none; color: #1e293b; }
.recent-item:hover { border-color: #2563eb; text-decoration: none; }
.recent-names { font-size: .92rem; }
.recent-names strong { color: #2563eb; }
.recent-arrow { color: #94a3b8; font-size: 1.3rem; }

/* ─── Categories ────────────────────────────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 12px; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s, transform .2s; }
.category-card:hover { border-color: #2563eb; transform: translateY(-2px); text-decoration: none; }
.cat-name { font-weight: 700; font-size: 1rem; color: #0f172a; }
.cat-meta { font-size: .78rem; color: #64748b; }

/* ─── Comparison Grid ───────────────────────────────────────────────────────── */
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.comp-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 12px; overflow: hidden; transition: border-color .2s, transform .2s; display: flex; flex-direction: column; }
.comp-card:hover { border-color: #2563eb; transform: translateY(-3px); text-decoration: none; }
.comp-images { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; background: #f8fafc; }
.comp-images img { width: 80px; height: 80px; object-fit: contain; }
.vs-badge { background: #2563eb; color: #fff; font-weight: 900; font-size: .8rem; padding: 4px 8px; border-radius: 20px; }
.comp-names { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: #1e293b; }
.comp-cat { padding: 0 16px 12px; font-size: .75rem; color: #94a3b8; }

/* ─── Steps ─────────────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.step { background: #fff; border-radius: 12px; padding: 24px; text-align: center; border: 2px solid #e2e8f0; }
.step-num { width: 48px; height: 48px; background: #2563eb; color: #fff; font-size: 1.4rem; font-weight: 900; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.step-text { font-weight: 600; }

/* ─── Product Grid ──────────────────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.product-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 12px; overflow: hidden; transition: border-color .2s; }
.product-card:hover { border-color: #2563eb; }
.product-card img { width: 100%; height: 180px; object-fit: contain; background: #f8fafc; padding: 12px; }
.product-info { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.product-info h3 { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.brand { font-size: .8rem; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; display: inline-block; width: fit-content; }
.price { font-size: 1.2rem; font-weight: 800; color: #2563eb; }
.old-price { font-size: .9rem; color: #94a3b8; text-decoration: line-through; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.score-badge { background: #eff6ff; color: #2563eb; font-weight: 700; font-size: .8rem; padding: 3px 8px; border-radius: 6px; display: inline-block; }
.mini-pros { list-style: none; font-size: .8rem; color: #16a34a; }
.mini-pros li { padding: 1px 0; }
.btn-buy { background: #2563eb; color: #fff; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: .9rem; display: inline-block; margin-top: 4px; text-align: center; transition: background .2s; }
.btn-buy:hover { background: #1d4ed8; text-decoration: none; }

/* ─── Comparison List ───────────────────────────────────────────────────────── */
.comparison-list { display: flex; flex-direction: column; gap: 12px; }
.comp-list-item { display: flex; align-items: center; gap: 16px; background: #fff; border: 2px solid #e2e8f0; border-radius: 10px; padding: 12px 16px; transition: border-color .2s; }
.comp-list-item:hover { border-color: #2563eb; text-decoration: none; }
.comp-list-images { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.comp-list-images img { width: 48px; height: 48px; object-fit: contain; }
.vs-sm { font-size: .7rem; font-weight: 900; color: #6b7280; }
.comp-list-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.comp-list-text strong { font-size: .9rem; color: #0f172a; }
.comp-conclusion { font-size: .78rem; color: #64748b; }
.arrow { color: #94a3b8; font-size: 1.2rem; }

/* ─── Page Header ───────────────────────────────────────────────────────────── */
.page-header { padding: 28px 0 12px; }
.page-header h1 { font-size: 2rem; font-weight: 900; }
.page-header p { color: #64748b; margin-top: 6px; }
.breadcrumb { font-size: .82rem; color: #94a3b8; margin-bottom: 10px; }
.breadcrumb a { color: #64748b; }

/* ─── Product Duel ──────────────────────────────────────────────────────────── */
.page-title { font-size: 1.8rem; font-weight: 900; margin: 20px 0; text-align: center; }
.winner-banner { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border-radius: 12px; padding: 20px 24px; margin: 20px 0; text-align: center; }
.winner-banner.winner-equal {
  background: linear-gradient(135deg, #0ea5e9 0%, #6d28d9 100%);
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: 0 8px 32px rgba(109,40,217,.4);
  animation: pulse-equal 2s ease-in-out infinite;
}
@keyframes pulse-equal {
  0%,100% { box-shadow: 0 8px 32px rgba(109,40,217,.4); }
  50% { box-shadow: 0 8px 48px rgba(14,165,233,.6); }
}
.winner-label { font-size: 1.4rem; font-weight: 900; display: block; margin-bottom: 8px; letter-spacing: .3px; }
.winner-banner p { opacity: .9; }
.product-duel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0; }
.duel-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.duel-card.is-winner { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.winner-crown { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; font-size: 1rem; font-weight: 900; padding: 7px 24px; border-radius: 20px; white-space: nowrap; box-shadow: 0 4px 16px rgba(34,197,94,.5); letter-spacing: .3px; }
.duel-img { width: 100%; max-height: 200px; object-fit: contain; background: #f8fafc; border-radius: 10px; padding: 12px; }
.duel-card h2 { font-size: 1.1rem; font-weight: 800; }
.price-block { display: flex; align-items: baseline; gap: 8px; }
.rating { font-size: .85rem; color: #64748b; }

/* ─── Scores ────────────────────────────────────────────────────────────────── */
.scores { display: flex; flex-direction: column; gap: 8px; }
.score-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.score-label { width: 130px; flex-shrink: 0; color: #475569; }
.score-bar-bg { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
.score-num { width: 30px; text-align: right; font-weight: 700; color: #0f172a; }

/* ─── Verdict ───────────────────────────────────────────────────────────────── */
.verdict-badge { color: #fff; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.verdict-block { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.verdict-text { font-size: .82rem; color: #475569; }

/* ─── Pros/Cons ─────────────────────────────────────────────────────────────── */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pros { background: #f0fdf4; border-radius: 8px; padding: 12px; }
.cons { background: #fef2f2; border-radius: 8px; padding: 12px; }
.pros strong { color: #15803d; font-size: .85rem; }
.cons strong { color: #dc2626; font-size: .85rem; }
.pros ul, .cons ul { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.pros ul li { font-size: .8rem; color: #166534; }
.pros ul li::before { content: '✓ '; }
.cons ul li { font-size: .8rem; color: #991b1b; }
.cons ul li::before { content: '✗ '; }
.suitable { font-size: .82rem; color: #475569; background: #f8fafc; border-radius: 8px; padding: 10px; }
.ai-summary { font-size: .82rem; color: #475569; background: #eff6ff; border-radius: 8px; padding: 10px; border-left: 3px solid #2563eb; }

/* ─── Table ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.comp-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.comp-table th { background: #2563eb; color: #fff; padding: 12px 16px; text-align: left; font-size: .88rem; }
.comp-table td { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; font-size: .85rem; }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table tr:hover td { background: #f8fafc; }
.win-cell { background: #f0fdf4; font-weight: 700; color: #15803d; }
.winner-col { font-weight: 700; color: #2563eb; }

/* ─── AI Section ────────────────────────────────────────────────────────────── */
.ai-section { background: #fff; border: 2px solid #e2e8f0; border-radius: 16px; padding: 28px; }
.ai-section h2 { border: none; padding: 0; margin-bottom: 16px; }
.winner-reason { background: #eff6ff; border-left: 4px solid #2563eb; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.winner-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.winner-badge { background: #f1f5f9; border-radius: 10px; padding: 10px 16px; display: flex; flex-direction: column; gap: 4px; }
.winner-badge span { font-size: .75rem; color: #64748b; }
.winner-badge strong { font-size: .9rem; color: #0f172a; }

/* ─── FAQ ───────────────────────────────────────────────────────────────────── */
.faq-section { background: #fff; border-radius: 12px; padding: 28px; border: 2px solid #e2e8f0; }
.faq-item { border-bottom: 1px solid #f1f5f9; padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { font-weight: 700; cursor: pointer; font-size: .95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; color: #2563eb; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 10px; font-size: .9rem; color: #475569; line-height: 1.7; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.site-footer { background: #1e293b; color: #94a3b8; padding: 40px 20px; margin-top: 60px; text-align: center; }
.site-footer a { color: #94a3b8; }
.disclaimer { font-size: .75rem; margin-top: 8px; opacity: .7; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ─── Admin ─────────────────────────────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: #1e293b; color: #e2e8f0; padding: 24px 0; flex-shrink: 0; }
.admin-sidebar .logo { color: #fff; padding: 0 20px 20px; display: block; border-bottom: 1px solid #334155; margin-bottom: 12px; }
.admin-sidebar a { display: block; padding: 10px 20px; color: #94a3b8; font-size: .9rem; transition: background .15s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #334155; color: #fff; text-decoration: none; }
.admin-content { flex: 1; padding: 32px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-header h1 { font-size: 1.6rem; }
.btn { padding: 8px 18px; border-radius: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; border: none; transition: background .2s; display: inline-block; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-success { background: #22c55e; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; padding: 24px; margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e2e8f0; text-align: center; }
.stat-num { font-size: 2rem; font-weight: 900; color: #2563eb; }
.stat-label { font-size: .82rem; color: #64748b; margin-top: 4px; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: .82rem; color: #64748b; border-bottom: 1px solid #e2e8f0; }
table.data-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: .85rem; vertical-align: middle; }
table.data-table tr:hover td { background: #fafafa; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 12px; font-weight: 700; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: .9rem; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.progress-bar { background: #f1f5f9; border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: #2563eb; border-radius: 4px; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .product-duel { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
  .admin-wrap { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .comparison-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .comparison-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 16px; }
}
