/* 
========================================================================
   DESIGN SYSTEM & FOUNDATION (CSS TOKENS)
======================================================================== 
*/

:root {
  /* Dark Mode - Premium Slate Theme */
  --bg-primary: #090d16;
  --bg-secondary: #111726;
  --bg-tertiary: #1b2336;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-color: #fbbf24; /* Warm Gold */
  --accent-glow: rgba(251, 191, 36, 0.12);
  --accent-hover: #f59e0b;
  
  --gradient-start: #3b82f6; /* Premium Indigo */
  --gradient-end: #1d4ed8;   /* Deep Blue */
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(255, 255, 255, 0.12);
  
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --btn-shadow: 0 4px 16px 0 rgba(59, 130, 246, 0.25);
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --border-radius-sm: 10px;
  --border-radius-md: 20px;
  --border-radius-lg: 28px;
}

/* Light Mode - Soft Slate Theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(15, 23, 42, 0.06);
  --border-focus: rgba(15, 23, 42, 0.12);
  
  --card-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
}

/* Reset & Global Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

/* Base Utility Classes */
.text-accent {
  color: var(--accent-color);
}

.text-gradient {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-container {
  width: 100%;
  max-width: 720px; /* Highly optimized readability constraints */
  margin: 0 auto;
  padding: 0 16px;
}

/* 
========================================================================
   COMPONENTS - NAVBAR (GLASSMORPHISM)
======================================================================== 
*/

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

[data-theme="light"] .navbar {
  background-color: rgba(248, 250, 252, 0.75);
}

.nav-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-icon {
  color: var(--accent-color);
  font-size: 1.4rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.update-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background-color: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.theme-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* 
========================================================================
   COMPONENTS - HERO & PROMO BANNER
======================================================================== 
*/

.hero-section {
  position: relative;
  padding: 32px 0 16px 0;
  text-align: center;
}

.hero-bg-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(9, 13, 22, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.75px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 20px auto;
}

/* Island Highlight Banner */
.highlight-banner {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
  margin: 0 auto;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.highlight-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 4px;
  background: var(--accent-color);
}

.hb-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(251, 191, 36, 0.08);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.hb-content {
  text-align: left;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hb-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.hb-text {
  font-size: 0.88rem;
  font-weight: 600;
}

.hb-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.hb-btn:hover {
  border-color: var(--border-focus);
  background-color: var(--border-color);
}

/* 
========================================================================
   COMPONENTS - FILTER BAR (STICKY & SNAP SCROLL)
======================================================================== 
*/

.filter-section {
  position: sticky;
  top: 68px;
  z-index: 90;
  background-color: rgba(9, 13, 22, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: 16px 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .filter-section {
  background-color: rgba(248, 250, 252, 0.9);
}

.filter-wrapper {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.filter-wrapper::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.filter-btn {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 30px;
  transition: var(--transition-smooth);
  scroll-snap-align: start;
}

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

.filter-btn.active {
  background-color: rgba(251, 191, 36, 0.08);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* 
========================================================================
   COMPONENTS - LISTING CARDS (NATIVE APP INTERFACE)
======================================================================== 
*/

.listing-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

/* Header Area (Horizontal Layout) */
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-wrapper {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-logo {
  width: 75%;
  height: 75%;
  object-fit: contain;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.brand-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.rank-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background-color: rgba(251, 191, 36, 0.08);
  color: var(--accent-color);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.15);
}

.brand-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-stars {
  color: var(--accent-color);
  font-size: 0.75rem;
  display: flex;
  gap: 1px;
}

.rating-val {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Body Area */
.brand-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-bonus {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.brand-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-pill.green {
  background-color: rgba(16, 185, 129, 0.06);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-pill.blue {
  background-color: rgba(59, 130, 246, 0.06);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

/* CTA Button Block (Full Width Native Feeling) */
.brand-actions {
  width: 100%;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 11px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--btn-shadow);
  transition: var(--transition-smooth);
}

.btn-primary:active {
  transform: scale(0.98); /* Native press-down action */
  filter: brightness(0.9);
}

/* 
========================================================================
   COMPONENTS - FAQ (ACCORDION)
======================================================================== 
*/

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-section {
  margin-top: 32px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-question {
  width: 100%;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.faq-icon {
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 16px;
}

.faq-answer p {
  padding-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.faq-item.active {
  border-color: var(--border-focus);
}

.faq-item.active .faq-answer {
  max-height: 300px;
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* 
========================================================================
   COMPONENTS - SEO TEXT & FOOTER
======================================================================== 
*/

.seo-text-section {
  margin-top: 40px;
  padding: 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
}

.seo-text-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.6;
}

.seo-text-content h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
}

.seo-text-content ul, .seo-text-content ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 24px 0;
  text-align: center;
}

.footer-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 12px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 
========================================================================
   RESPONSIVE DESIGN (DESKTOP OPTIMIZATIONS)
======================================================================== 
*/

@media (min-width: 576px) {
  /* Desktop Layout enhancements to look premium and aligned */
  .brand-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .brand-header {
    flex-grow: 1;
    max-width: 300px;
  }

  .brand-body {
    flex-grow: 2;
  }

  .brand-actions {
    width: 140px;
    flex-shrink: 0;
  }
}
