@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Theme Light (Default) */
  --color-primary: #1d4ed8;       /* Blue 700 */
  --color-primary-hover: #1e40af; /* Blue 800 */
  --color-primary-light: #eff6ff; /* Blue 50 */
  --color-primary-rgb: 29, 78, 216;

  --color-accent: #0d9488;        /* Teal 600 */
  --color-accent-light: #f0fdf4;
  
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.85);
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-info-text: #1e40af;

  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-text: #92400e;
}

[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-primary-light: rgba(59, 130, 246, 0.15);
  --color-primary-rgb: 59, 130, 246;

  --color-accent: #14b8a6;
  --color-accent-light: rgba(20, 184, 166, 0.15);

  --bg-main: #090d16;
  --bg-surface: #131b2e;
  --bg-surface-glass: rgba(19, 27, 46, 0.85);
  --border-color: #1e293b;
  --border-focus: #60a5fa;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --color-info-bg: rgba(30, 58, 138, 0.3);
  --color-info-border: rgba(59, 130, 246, 0.4);
  --color-info-text: #93c5fd;

  --color-warning-bg: rgba(146, 64, 14, 0.25);
  --color-warning-border: rgba(245, 158, 11, 0.4);
  --color-warning-text: #fde68a;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Glass panel */
.glass-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
}

/* App container */
.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #ffffff;
  padding: 2px;
  box-shadow: var(--shadow-sm);
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-tag {
  font-size: 0.65rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
}

.brand-titles p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 24px 12px 18px;
}

.hero-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 20px;
}

/* Search bar */
.search-container {
  position: relative;
  max-width: 680px;
  margin: 0 auto 24px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 52px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--color-primary-light), var(--shadow-md);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

/* Search Chips */
.search-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.search-chips-label {
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-right: 4px;
}

.search-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.search-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

/* Quick actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.btn-quick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-quick:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn-quick-featured {
  background: var(--color-primary);
  color: #ffffff !important;
  border-color: var(--color-primary);
}

.btn-quick-featured:hover {
  background: var(--color-primary-hover);
}

/* Categories grid */
.categories-section {
  margin-bottom: 32px;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.category-card.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.category-card.active .category-icon {
  background: var(--color-primary);
  color: #ffffff;
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.category-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Results header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.results-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-clear-filter {
  font-size: 0.82rem;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: none;
}

.btn-clear-filter:hover {
  text-decoration: underline;
}

/* FAQ Accordion List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

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

.faq-item:hover {
  border-color: rgba(var(--color-primary-rgb), 0.4);
}

.faq-item.active {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.faq-question-btn {
  width: 100%;
  padding: 18px 20px;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.faq-question-btn:focus-visible {
  outline: 2px solid var(--border-focus);
}

.faq-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-share-faq {
  background: none;
  border: none;
  color: var(--text-subtle);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-share-faq:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--text-subtle);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.25s ease;
}

[data-theme="dark"] .toast-container {
  background: #3b82f6;
  color: #ffffff;
}

.faq-category-badge {
  font-size: 0.72rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
}

.faq-answer-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer {
  padding: 0 20px 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px dashed var(--border-color);
  padding-top: 16px;
}

.faq-answer p {
  margin-bottom: 12px;
}

.faq-answer ul, .faq-answer ol {
  margin: 10px 0 14px 20px;
}

.faq-answer li {
  margin-bottom: 6px;
}

.faq-answer strong {
  color: var(--text-main);
}

.faq-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--color-primary);
  transition: var(--transition-fast);
}

.faq-link:hover {
  color: var(--color-primary-hover);
  border-bottom-style: solid;
}

.faq-alert-box {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 14px 0 8px;
  font-size: 0.9rem;
}

.faq-alert-box.info {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info-border);
  color: var(--color-info-text);
}

.faq-alert-box.warning {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning-border);
  color: var(--color-warning-text);
}

.faq-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.faq-tag {
  font-size: 0.72rem;
  background: var(--bg-main);
  color: var(--text-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: none;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 16px;
}

/* Modal system */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  position: relative;
  animation: slideUp 0.25s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-main);
}

/* Step wizard inside modal */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-step h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.wizard-option-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.wizard-result {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.wizard-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 6px 0;
}

/* Directory / Contact card */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-subtle);
  text-transform: uppercase;
}

.contact-info a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

/* Footer */
footer {
  margin-top: auto;
  text-align: center;
  padding: 24px 12px 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

/* PWA banner */
.pwa-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  display: none;
  align-items: center;
  gap: 14px;
  z-index: 150;
  animation: slideUp 0.3s ease;
}

.pwa-btn-install {
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.pwa-btn-close {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
}

/* Floating back to top button */
.btn-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  transition: var(--transition-fast);
}

.btn-top:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.5rem;
  }
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-actions {
    flex-direction: column;
  }
  .btn-quick {
    width: 100%;
    justify-content: center;
  }
  .faq-question-btn {
    padding: 16px 14px;
    font-size: 0.94rem;
  }
  .faq-answer {
    padding: 0 14px 16px;
    font-size: 0.9rem;
  }
}
