/* DealVault - Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Dark premium palette */
  --bg-primary: #0a0a0b;
  --bg-secondary: #141416;
  --bg-card: #1c1c1f;
  --bg-card-hover: #232326;

  /* Accent colors */
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --accent-glow: rgba(99, 102, 241, 0.4);

  /* Text colors */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Success/value color */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px var(--accent-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  height: 600px;
  background: radial-gradient(ellipse at center top, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.logo span {
  -webkit-text-fill-color: var(--text-primary);
  background: none;
}

nav {
  display: flex;
  gap: 0.5rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

nav a:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* Hero */
.hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: var(--accent-gradient);
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  position: relative;
}

.hero h1 .gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

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

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Filters */
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.filter-btn {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

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

/* Deal Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(180deg, var(--border-light) 0%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.1);
}

.card-header {
  padding: 1.5rem 1.5rem 1rem;
}

.card-category {
  display: inline-block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 9999px;
  margin-bottom: 0.875rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--success);
  letter-spacing: -0.02em;
}

.card-body {
  padding: 0 1.5rem 1.5rem;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.card-requirements {
  list-style: none;
  margin-bottom: 1rem;
}

.card-requirements li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.card-requirements li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
}

.card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-expiry {
  font-size: 0.75rem;
  color: #f87171;
  font-weight: 500;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--accent-gradient);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.card-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.card-btn::after {
  content: "→";
  transition: transform 0.2s ease;
}

.card-btn:hover::after {
  transform: translateX(3px);
}

/* Referral Card */
.referral-card {
  text-align: center;
  padding: 2.5rem 2rem;
}

.referral-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  filter: grayscale(0);
}

.referral-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.referral-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.referral-card .card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.referral-description {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.referral-code {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-light);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9375rem;
  color: var(--accent-primary);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.referral-benefit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Inactive card */
.card.inactive {
  opacity: 0.5;
}

.card.inactive .card-value {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1rem 2.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-stats {
    gap: 2rem;
  }

  .hero-stat-value {
    font-size: 1.5rem;
  }

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

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  nav {
    width: 100%;
    justify-content: center;
  }

  .filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .filter-btn {
    flex-shrink: 0;
  }
}

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

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

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

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

/* Selection */
::selection {
  background: var(--accent-primary);
  color: white;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
