/* ═══════════════════════════════════════════════════════════
   KOREAN TRACKER - REFINED DASHBOARD EDITION
   Modern, professional interface with snapshot card layout
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Core Colors - Single Accent System */
  --accent-primary: #00d9ff;
  --accent-dim: #0099b3;
  --accent-bright: #4dffff;

  /* Neutrals */
  --bg-base: #0a0e14;
  --bg-elevated: #101419;
  --bg-card: #14181f;
  --bg-hover: #1a1f28;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(0, 217, 255, 0.3);

  --text-primary: #e8eaed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 0 24px rgba(0, 217, 255, 0.2);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Animation */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════
   PASSWORD AUTHENTICATION OVERLAY
   ═══════════════════════════════════════════════════════════ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  backdrop-filter: blur(8px);
}

.auth-overlay.hidden {
  display: none;
}

.auth-box {
  width: 100%;
  max-width: 400px;
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
  text-align: center;
  margin-bottom: var(--space-sm);
  letter-spacing: 2px;
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-lg);
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.auth-input:focus {
  border-color: var(--accent-primary);
}

.auth-button {
  width: 100%;
  padding: 12px 16px;
  background: var(--accent-primary);
  border: none;
  border-radius: 8px;
  color: var(--bg-base);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-button:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-error {
  padding: var(--space-sm) var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 13px;
  text-align: center;
}

.auth-error.hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════ */

/* Admin Button in Header */
.admin-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-button:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Admin Modal */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-modal.hidden {
  display: none;
}

.admin-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.admin-modal__content {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.admin-modal__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-modal__close:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.admin-header {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.admin-header__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: var(--space-xs);
}

.admin-header__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.admin-body {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.admin-section__title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-btn--primary {
  background: var(--accent-primary);
  color: var(--bg-base);
}

.admin-btn--primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.admin-btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.admin-btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-status {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 36px;
  display: flex;
  align-items: center;
}

.admin-status:empty {
  display: none;
}

.admin-status.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.admin-status.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.admin-status.loading {
  background: rgba(0, 217, 255, 0.1);
  border-color: rgba(0, 217, 255, 0.3);
  color: var(--accent-primary);
}

/* File List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 300px;
  overflow-y: auto;
}

.file-list__loading {
  padding: var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.file-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.file-item__name {
  font-size: 13px;
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
}

.file-item__delete {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-item__delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   BACKGROUND ELEMENTS
   ═══════════════════════════════════════════════════════════ */

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 217, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 217, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════
   APP CONTAINER
   ═══════════════════════════════════════════════════════════ */

.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */

.app-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-lg) var(--space-xl);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.brand-line {
  width: 3px;
  height: 28px;
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.snapshot-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.snapshot-indicator__dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

/* ═══════════════════════════════════════════════════════════
   APP BODY - SIDEBAR LAYOUT
   ═══════════════════════════════════════════════════════════ */

.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════ */

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  height: calc(100vh - 76px);
  overflow-y: auto;
  position: sticky;
  top: 76px;
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.control-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.control-select,
.control-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition-normal);
  outline: none;
}

.control-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300d9ff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.control-input::placeholder {
  color: var(--text-muted);
}

.control-select:hover,
.control-input:hover {
  border-color: var(--border-accent);
}

.control-select:focus,
.control-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.control-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--bg-elevated);
}

/* Toggle Group */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.toggle-option:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.toggle-option input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.toggle-option input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base);
  font-size: 11px;
  font-weight: bold;
}

.toggle-option__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  user-select: none;
}

.toggle-option input[type="checkbox"]:checked ~ .toggle-option__label {
  color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.stats-badge {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
}

.stats-badge__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stats-badge__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */

.main-content {
  padding: var(--space-xl);
  overflow-y: auto;
  min-height: calc(100vh - 76px);
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */

.empty-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: var(--space-xl);
}

.empty-view__icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-view__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.empty-view__text {
  color: var(--text-secondary);
  max-width: 400px;
}

/* ═══════════════════════════════════════════════════════════
   SNAPSHOT GRID - THE MAIN VIEW
   ═══════════════════════════════════════════════════════════ */

.products-container {
  width: 100%;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  animation: fadeIn 0.5s var(--transition-normal);
}

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

/* Snapshot Card */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
  background: var(--bg-hover);
}

.card.active {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-accent);
}

.card__badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  background: rgba(0, 217, 255, 0.15);
  border: 1px solid var(--border-accent);
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
}

.card__title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0;
}

.card__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.buy-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--accent-primary);
  color: var(--bg-base);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-normal);
  border: none;
}

.buy-link:hover {
  background: var(--accent-bright);
  transform: scale(1.02);
}

/* ═══════════════════════════════════════════════════════════
   DETAIL MODAL
   ═══════════════════════════════════════════════════════════ */

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.detail-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.detail-modal__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.detail-modal__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  z-index: 10;
}

.detail-modal__close:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Detail Header */
.detail-header {
  padding: var(--space-xl);
  padding-right: 80px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.detail-header__subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Detail Stats */
.detail-stats {
  padding: var(--space-lg) var(--space-xl);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.stat-card {
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-card__value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.stat-card__value.pill--up {
  color: #ef4444;
}

.stat-card__value.pill--down {
  color: #10b981;
}

/* Detail Body */
.detail-body {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Chart Section */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: var(--space-lg);
}

.chart-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.chart-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-section__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.chart-section__canvas {
  position: relative;
  height: 300px;
}

.chart-section__canvas canvas {
  max-height: 100%;
}

/* Offers Section */
.offers-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.offers-list {
  display: grid;
  gap: var(--space-md);
}

.offer {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: var(--space-md);
  transition: all var(--transition-normal);
}

.offer:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}

.offer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.offer__top strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.offer__price {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.offer .card__meta {
  margin-bottom: 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.offer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.offer a:hover {
  color: var(--accent-bright);
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-accent);
}

/* ═══════════════════════════════════════════════════════════
   MOBILE FILTER TOGGLE
   ═══════════════════════════════════════════════════════════ */

.filter-toggle {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: sticky;
  top: 76px;
  z-index: 50;
  margin: var(--space-lg);
  margin-bottom: 0;
}

.filter-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.filter-toggle svg {
  transition: transform var(--transition-fast);
}

.filter-toggle.active svg {
  transform: rotate(90deg);
}

/* Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 140;
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .app-body {
    grid-template-columns: 1fr;
    position: relative;
  }

  .filter-toggle {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 76px;
    left: 0;
    width: 280px;
    height: calc(100vh - 76px);
    border-right: 1px solid var(--border-subtle);
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 150;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .snapshot-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: var(--space-md) var(--space-lg);
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar {
    padding: var(--space-lg);
  }

  .main-content {
    padding: var(--space-lg);
  }

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

  .detail-modal {
    padding: var(--space-md);
  }

  .detail-modal__content {
    max-height: 95vh;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 1.25rem;
  }

  .card {
    padding: var(--space-md);
  }

  .detail-header,
  .detail-body {
    padding: var(--space-lg);
  }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
