/* ==========================================
   ChillBro Coupons — Main Stylesheet
   ========================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --secondary: #f59e0b;
  --success: #10b981;
  --info: #06b6d4;
  --purple: #8b5cf6;
  --bg-light: #f8fafc;
  --border: #e2e8f0;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: #1e293b;
  line-height: 1.6;
}

/* ---- Topbar ---- */
.topbar {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
  font-size: .8rem;
}

/* ---- Navbar ---- */
.bg-primary-custom {
  background: linear-gradient(135deg, #1e1b4b 0%, var(--primary) 100%) !important;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--secondary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}
.brand-icon-sm { width: 28px; height: 28px; font-size: .9rem; border-radius: 8px; }
.brand-text { font-size: 1.4rem; font-weight: 800; color: white; letter-spacing: -0.5px; }

.search-bar {
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
}
.search-bar .input-group-text {
  background: white; border: none; padding: .45rem .75rem;
}
.search-bar .form-control {
  background: white; border: none; min-width: 220px;
}
.search-bar .btn-warning {
  border-radius: 0 8px 8px 0;
}

.nav-link { border-radius: var(--radius-sm); padding: .45rem .75rem !important; font-weight: 500; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.15); }

/* ---- Hero ---- */
.hero-section {
  background: linear-gradient(135deg, #1e1b4b 0%, var(--primary) 60%, #7c3aed 100%);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  color: white; border-radius: 50px;
  padding: .35rem 1rem; font-size: .85rem; font-weight: 500;
}
.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800; color: white;
  line-height: 1.15; letter-spacing: -1px;
}
.text-gradient {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 480px; }
.hero-search-group {
  background: white; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.hero-search-group .input-group-text { background: white; border: none; padding: .75rem 1rem; }
.hero-search-group .form-control { border: none; font-size: 1rem; padding: .75rem .5rem; }
.hero-search-group .btn-warning { border-radius: 0 12px 12px 0; font-size: 1rem; }

.stat-number { font-size: 1.5rem; font-weight: 800; color: white; }
.stat-label { font-size: .75rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }

/* Floating hero illustration */
.hero-illustration { position: relative; height: 320px; }
.hero-circle {
  width: 200px; height: 200px;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; color: rgba(255,255,255,.5);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.floating-card {
  position: absolute;
  background: white; border-radius: 14px;
  padding: .75rem 1.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  display: flex; align-items: center;
  font-size: .9rem; font-weight: 500;
  animation: float 3s ease-in-out infinite;
}
.card-1 { top: 20px; right: 30px; animation-delay: 0s; }
.card-2 { bottom: 80px; right: 0; animation-delay: 1s; }
.card-3 { top: 50%; left: 0; animation-delay: .5s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.discount-tag {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; padding: .2rem .6rem;
  border-radius: 6px; font-weight: 700; font-size: .85rem;
}
.discount-tag-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.hero-wave { line-height: 0; margin-bottom: -1px; }

/* ---- Section titles ---- */
.section-title { font-size: 1.5rem; font-weight: 700; }
.bg-light-custom { background: var(--bg-light); }

/* ---- Category cards ---- */
.category-card {
  background: white;
  border: 2px solid transparent;
  transition: all .25s ease;
  box-shadow: var(--shadow-sm);
}
.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.category-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

/* ---- Store cards ---- */
.store-card {
  background: white;
  border: 1px solid var(--border);
  transition: all .25s ease;
  box-shadow: var(--shadow-sm);
}
.store-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.store-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; }
.store-logo-placeholder {
  width: 44px; height: 44px;
  background: var(--primary-light); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.store-logo-placeholder-sm {
  width: 36px; height: 36px;
  background: var(--primary-light); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: .8rem;
}
.store-card-full {
  background: white;
  border: 1px solid var(--border);
  transition: all .25s ease;
  box-shadow: var(--shadow-sm);
}
.store-card-full:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.store-full-logo { width: 80px; height: 80px; object-fit: contain; margin: 0 auto; display: block; }
.store-full-placeholder {
  width: 80px; height: 80px;
  background: var(--primary-light); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Coupon cards ---- */
.coupon-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  transition: all .25s ease;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 100%;
  display: flex; flex-direction: column;
}
.coupon-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: #c7d2fe;
}
.coupon-card.verified { border-top: 3px solid var(--success); }
.coupon-card.featured { border-top: 3px solid var(--secondary); }

.featured-ribbon {
  position: absolute; top: 12px; right: -8px;
  background: var(--secondary); color: white;
  font-size: .7rem; font-weight: 700;
  padding: .2rem .8rem;
  border-radius: 4px 0 0 4px;
  box-shadow: -2px 2px 4px rgba(0,0,0,.1);
}

.coupon-store-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.coupon-store-icon {
  width: 36px; height: 36px;
  background: var(--primary-light); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: .9rem;
}

.discount-badge {
  color: white; font-weight: 700; font-size: .9rem;
  padding: .35rem .75rem; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
}
.bg-purple { background-color: var(--purple) !important; }

.badge-category { font-size: .7rem; font-weight: 500; }

.coupon-title { font-size: 1rem; line-height: 1.4; flex-grow: 1; }
.coupon-desc { line-height: 1.5; }

.btn-get-coupon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none; border-radius: var(--radius-sm);
  padding: .65rem 1rem; font-weight: 600; cursor: pointer;
  position: relative; overflow: hidden;
  transition: all .3s ease;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-get-coupon:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1e1b4b);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.btn-get-coupon .code-reveal {
  display: none;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px; font-size: 1rem;
}
.btn-get-coupon.revealed {
  background: linear-gradient(135deg, var(--success), #059669);
}
.btn-get-coupon.revealed .btn-text { display: none; }
.btn-get-coupon.revealed .code-reveal { display: inline; }

.usage-bar { opacity: .7; font-size: .72rem; }

/* ---- Filter sidebar ---- */
.filter-sidebar {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 80px;
}
.filter-section { margin-bottom: 1.5rem; }
.filter-section:last-child { margin-bottom: 0; }
.filter-title {
  font-weight: 600; text-transform: uppercase;
  font-size: .72rem; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: .75rem;
}
.filter-chip {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: var(--radius-sm);
  font-size: .875rem; color: #374151; font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none; transition: all .2s;
  cursor: pointer;
}
.filter-chip:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.badge-count {
  background: var(--bg-light); color: var(--text-muted);
  padding: .1rem .4rem; border-radius: 10px; font-size: .7rem;
}
.filter-check {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; cursor: pointer; padding: .3rem 0;
}
.filter-check input { accent-color: var(--primary); }

/* ---- Page header ---- */
.page-header {
  background: white; border-bottom: 1px solid var(--border);
}

/* ---- Store hero ---- */
.store-hero {
  background: white; border-bottom: 1px solid var(--border);
}
.store-hero-logo {
  width: 100px; height: 100px; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border); padding: .5rem;
  background: white;
}
.store-hero-placeholder {
  width: 100px; height: 100px;
  background: var(--primary-light); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}

/* ---- Related store links ---- */
.related-store-link { border: 1px solid transparent; transition: all .2s; }
.related-store-link:hover { background: var(--primary-light); border-color: var(--primary); }

/* ---- CTA section ---- */
.cta-section {
  background: linear-gradient(135deg, #1e1b4b 0%, var(--primary) 60%, #7c3aed 100%);
}

/* ---- Footer ---- */
.footer {
  background: #0f172a; color: #94a3b8;
}
.footer h6 { color: white; }
.footer-links a {
  color: #94a3b8; text-decoration: none; font-size: .875rem;
  display: flex; align-items: center; gap: .3rem;
  padding: .2rem 0; transition: color .2s;
}
.footer-links a:hover { color: var(--secondary); }
.social-link {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.08); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; text-decoration: none; transition: all .2s;
}
.social-link:hover { background: var(--primary); color: white; }

/* ---- Empty state ---- */
.empty-state { padding: 4rem 2rem; }
.empty-icon { opacity: .4; }

/* ---- Coupon modal ---- */
.coupon-code-display {
  background: var(--primary-light); border: 2px dashed var(--primary);
  border-radius: var(--radius-sm); padding: 1rem 2rem;
  letter-spacing: 4px;
}
.coupon-code-display span { color: var(--primary); }
.success-icon { animation: popIn .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- Utilities ---- */
.letter-spacing { letter-spacing: 2px; }
.bg-purple { background: var(--purple) !important; }
.text-purple { color: var(--purple) !important; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .filter-sidebar { position: static; margin-bottom: 1rem; }
  .topbar small:last-child { display: none; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
