/* ============================================================
   CardCompare.in — Styles
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #e6e8f0;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eef0ff;
  --green: #059669;
  --amber: #f59e0b;
  --red: #dc2626;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .10);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

.container { width: min(1240px, 92%); margin-inline: auto; }
.hidden { display: none !important; }
.mobile-only { display: none; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 10px;
  padding: 11px 20px; font-size: .95rem; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(79, 70, 229, .45); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-outline {
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--red); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.link-btn { background: none; border: none; color: var(--primary); font-weight: 600; font-size: .85rem; }
.link-btn:hover { text-decoration: underline; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-weight: 900; font-size: 1.15rem; letter-spacing: -.02em; }
.logo-text span { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text em { font-style: normal; color: var(--primary); font-weight: 700; }
.logo-footer { font-size: 1.25rem; color: #fff; }
.logo-footer span { background: linear-gradient(135deg, #a5b4fc, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-footer em { color: #a5b4fc; }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.nav-links a:hover { color: var(--primary); }
.hamburger { display: none; background: none; border: none; font-size: 1.5rem; color: var(--ink); }

/* ---------- Compare tray ---------- */
.compare-tray {
  background: #111633; color: #fff;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.compare-tray-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.tray-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.tray-slot {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px dashed rgba(255,255,255,.35);
  border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 600;
}
.tray-slot.filled { border-style: solid; background: linear-gradient(135deg, rgba(79,70,229,.5), rgba(124,58,237,.5)); }
.tray-slot button { background: none; border: none; color: #fff; opacity: .8; font-size: 1rem; line-height: 1; }
.tray-slot button:hover { opacity: 1; color: #fecaca; }
.tray-actions { display: flex; align-items: center; gap: 12px; }
.tray-hint { font-size: .8rem; color: #b6bcf0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
    radial-gradient(800px 400px at 85% -10%, rgba(124, 58, 237, .18), transparent),
    radial-gradient(700px 350px at -10% 110%, rgba(79, 70, 229, .15), transparent),
    linear-gradient(180deg, #fdfdff, var(--bg));
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: 1.2fr .8fr;
  gap: 48px; align-items: center; padding: 72px 0 64px;
}
.hero-badge {
  display: inline-block; background: var(--primary-soft); color: var(--primary);
  font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 999px;
  border: 1px solid #dcdcf9; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.12; }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--primary-2), #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: 16px; color: var(--ink-2); font-size: 1.06rem; max-width: 54ch; }
.hero-search { display: flex; gap: 10px; margin-top: 28px; max-width: 520px; }
.hero-search input {
  flex: 1; padding: 13px 18px; border-radius: 12px;
  border: 1.5px solid var(--line); font-size: .95rem; background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.hero-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.hero-stats { display: flex; gap: 36px; margin-top: 34px; flex-wrap: wrap; }
.stat strong { display: block; font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--ink-3); font-weight: 600; }

/* floating mini cards */
.hero-cards { position: relative; height: 340px; }
.mini-card {
  position: absolute; width: 240px; padding: 18px 20px;
  border-radius: 16px; color: #fff; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 4px;
  animation: float 6s ease-in-out infinite;
}
.mini-card small { opacity: .85; font-size: .78rem; }
.mc-1 { top: 4%; left: 8%; background: linear-gradient(135deg, #1a1a2e, #16213e); rotate: -6deg; }
.mc-2 { top: 30%; right: 2%; background: linear-gradient(135deg, #1e3a8a, #2563eb); rotate: 5deg; animation-delay: -1.5s; }
.mc-3 { bottom: 22%; left: 0; background: linear-gradient(135deg, #b45309, #f59e0b); rotate: 3deg; animation-delay: -3s; }
.mc-4 { bottom: -2%; right: 12%; background: linear-gradient(135deg, #4c1d95, #7c3aed); rotate: -4deg; animation-delay: -4.5s; }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 44px 0 80px; align-items: start; }

/* ---------- Filters ---------- */
.filters {
  position: sticky; top: 84px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.filters-head h2 { font-size: 1.05rem; font-weight: 800; }
.filter-group { margin-bottom: 20px; }
.filter-group > label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 10px; }
.filter-group input[type="text"] {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); outline: none; font-size: .92rem;
}
.filter-group input[type="text"]:focus { border-color: var(--primary); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 13px; font-size: .82rem; font-weight: 600; color: var(--ink-2);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; }

.range-wrap output { display: block; font-size: .85rem; color: var(--ink-2); font-weight: 600; margin-top: 6px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .88rem; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.checkbox-row input { accent-color: var(--primary); width: 16px; height: 16px; }

.checkbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.checkbox-list label { display: flex; align-items: center; gap: 9px; font-size: .88rem; color: var(--ink-2); cursor: pointer; font-weight: 500; }
.checkbox-list input { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.checkbox-list select { width: 100%; }

.filter-group select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: .9rem; outline: none; cursor: pointer;
}

/* ---------- Results head ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results-head h2 { font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; }
.count-pill {
  display: inline-block; background: var(--primary-soft); color: var(--primary);
  font-size: .85rem; font-weight: 800; padding: 2px 12px; border-radius: 999px; vertical-align: middle;
}
.results-sub { color: var(--ink-3); font-size: .88rem; margin: 6px 0 20px; }

/* ============================================================
   CARD GRID
   ============================================================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }

.card-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
.card-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.card-face {
  position: relative; height: 150px; padding: 18px 20px;
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  isolation: isolate;
}
.card-face::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 140% at 90% -20%, rgba(255,255,255,.28), transparent 55%);
}
.cf-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cf-bank { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.cf-network { font-size: .68rem; font-weight: 800; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.cf-name { font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.cf-chip {
  position: absolute; right: 20px; bottom: 52px;
  width: 34px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, #f7d774, #d9a53a);
  border: 1px solid rgba(255,255,255,.4);
}

.card-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
}
.tag.free { background: #d1fae5; color: var(--green); }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kv .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.kv .v { font-size: .86rem; font-weight: 700; color: var(--ink); }
.kv .v.green { color: var(--green); }

.rating-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.stars { color: var(--amber); font-size: .9rem; letter-spacing: 1px; }
.stars small { color: var(--ink-3); font-weight: 600; letter-spacing: 0; margin-left: 4px; }

.card-actions { display: flex; gap: 10px; }
.card-actions .btn-details {
  flex: 1; background: var(--primary-soft); color: var(--primary); border: none;
  border-radius: 10px; padding: 9px 0; font-weight: 700; font-size: .87rem;
}
.card-actions .btn-details:hover { background: #e2e5ff; }
.compare-check { display: flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.compare-check input { accent-color: var(--primary); width: 17px; height: 17px; cursor: pointer; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--ink-2); }
.empty-icon { font-size: 3rem; margin-bottom: 10px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state .btn { margin-top: 18px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16, 24, 40, .55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  position: relative; background: var(--surface); border-radius: 20px;
  width: min(680px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 30px; box-shadow: var(--shadow-lg);
  animation: popIn .22s cubic-bezier(.34, 1.4, .64, 1);
}
.modal-wide { width: min(1150px, 100%); padding: 26px; }
@keyframes popIn { from { transform: scale(.94) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 16px; z-index: 5;
  background: var(--bg); border: none; width: 36px; height: 36px;
  border-radius: 50%; font-size: 1.3rem; color: var(--ink-2); line-height: 1;
}
.modal-close:hover { background: var(--line); color: var(--ink); }

/* ---------- Detail modal ---------- */
.detail-hero {
  border-radius: 16px; padding: 24px; color: #fff; margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.detail-hero .dh-bank { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .9; }
.detail-hero h3 { font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; }
.detail-hero .dh-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dh-meta span { background: rgba(255,255,255,.2); padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700; backdrop-filter: blur(4px); }

.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 10px; font-weight: 800; }
.detail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fact .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.fact .v { font-size: .95rem; font-weight: 800; margin-top: 2px; word-break: break-word; }
.fact .v.green { color: var(--green); }

.highlights { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.highlights li { display: flex; gap: 10px; font-size: .93rem; color: var(--ink-2); }
.highlights li::before { content: "✔"; color: var(--green); font-weight: 900; flex-shrink: 0; }

.eligibility-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 14px 16px; font-size: .88rem; color: #92400e; }

/* ---------- Compare table ---------- */
.compare-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 4px; letter-spacing: -.02em; padding-right: 40px; }
.compare-table-wrap { overflow-x: auto; margin-top: 16px; }
table.compare-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
.compare-table th, .compare-table td {
  padding: 12px 14px; text-align: left; font-size: .88rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.compare-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.compare-table thead tr:first-child th:first-child { border-top-left-radius: 12px; }
.compare-table thead tr:last-child th:last-child { border-top-right-radius: 12px; }
.compare-table .row-label { font-weight: 700; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--bg); }
.compare-table td.col-head { background: var(--bg); }
.ct-name { font-weight: 800; font-size: .95rem; }
.ct-bank { display: block; font-size: .75rem; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.ct-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; }
.compare-table td.best { background: #f0fdf4; }
.win-chip { display: inline-block; background: #d1fae5; color: #065f46; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: #0f1230; color: #cbd0f5; padding: 52px 0 40px; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1.6fr; gap: 36px; }
.footer-tag { font-size: .88rem; margin-top: 10px; color: #9aa1d6; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: #cbd0f5; text-decoration: none; font-size: .9rem; font-weight: 600; }
.footer-links a:hover { color: #fff; }
.footer-note { font-size: .8rem; color: #9aa1d6; }
.footer-note strong { color: #cbd0f5; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cards { display: none; }
  .main-layout { grid-template-columns: 1fr; }

  .mobile-only { display: inline-flex; }
  .filters { position: static; display: none; }
  .filters.open { display: block; animation: fadeIn .2s ease; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; z-index: 99;
    background: #fff; flex-direction: column; padding: 20px 6%;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .hero-inner { padding: 48px 0; }
  .hero-stats { gap: 22px; }
  .hero-search { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; }
  .compare-tray-inner { flex-direction: column; align-items: stretch; }
  .tray-actions { justify-content: space-between; }
  .modal { padding: 22px 16px; }
}
