/* ==========================================================================
   Mulligan Lab - Main Stylesheet
   Modern, Accessible, Dark/Light Theme for MTG Mulligan Analysis
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode (Default) */
  --bg-app: #0a0d14;
  --bg-primary: #0f1420;
  --bg-secondary: #161e30;
  --bg-card: #1b253b;
  --bg-card-hover: #222f4a;
  --bg-input: #111726;
  --bg-modal-backdrop: rgba(5, 8, 15, 0.78);
  
  --border-color: #27344f;
  --border-light: #37486d;
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  /* Accent Colors */
  --primary: #4f46e5;
  --primary-hover: #6366f1;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-light: rgba(6, 182, 212, 0.15);

  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.15);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.15);

  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: rgba(245, 158, 11, 0.15);

  /* MTG Mana Colors */
  --mana-w: #f8fafc;
  --mana-u: #38bdf8;
  --mana-b: #a1a1aa;
  --mana-r: #f87171;
  --mana-g: #4ade80;
  --mana-c: #cbd5e1;
  --mana-gold: #fbbf24;

  /* Spacing & Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --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 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 16px rgba(99, 102, 241, 0.35);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-modal-backdrop: rgba(15, 23, 42, 0.6);
  
  --border-color: #e2e8f0;
  --border-light: #cbd5e1;
  --border-focus: #4f46e5;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --primary: #4338ca;
  --primary-hover: #4f46e5;
  --primary-light: rgba(67, 56, 202, 0.1);

  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: rgba(2, 132, 199, 0.1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 16px rgba(79, 70, 229, 0.2);
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.back-link:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.active-deck-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.active-deck-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-deck-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: var(--bg-card);
  color: var(--text-muted);
}

/* Nav Tabs */
.app-nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.nav-tabs {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--text-primary);
}

.nav-tab-btn.active {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
}

.nav-tab-btn svg {
  width: 18px;
  height: 18px;
}

/* Main Content Area */
.app-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Common Components */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

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

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-accent {
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
}

.btn-icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

/* Form Controls */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: monospace;
  font-size: 0.85rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 200px;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary { background: var(--primary-light); color: var(--primary-hover); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  user-select: none;
}

.tag-chip.clickable {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-chip.clickable:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.tag-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   Tab 1: Deck Management
   ========================================================================== */
.deck-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.deck-import-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.file-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary-hover);
  background: var(--primary-light);
}

.deck-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.deck-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.deck-card-row:hover {
  border-color: var(--border-light);
}

.deck-card-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.deck-card-count {
  font-weight: 700;
  color: var(--accent);
  width: 24px;
  text-align: right;
}

.deck-card-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.deck-card-name:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.deck-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.unparsed-warning-box {
  background: var(--warning-light);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Tab 2: Mulligan Training Mode
   ========================================================================== */
.training-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.training-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-secondary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.training-info-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  flex-direction: column;
}

.stat-pill-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.training-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hand Cards Area */
.hand-area-wrapper {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.bottom-selection-prompt {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 16px rgba(99, 102, 241, 0.5); }
}

.hand-cards-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.mtg-card-wrapper {
  position: relative;
  width: 175px;
  max-width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
}

.mtg-card-wrapper:hover {
  transform: translateY(-8px) scale(1.02);
  z-index: 10;
  box-shadow: var(--shadow-lg);
}

.mtg-card-wrapper.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.mtg-card-wrapper.is-bottom-selected {
  transform: translateY(16px);
  filter: brightness(0.65) saturate(0.8);
}

.mtg-card-wrapper.is-bottom-selected::after {
  content: "BOTTOM " attr(data-bottom-order);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--danger);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.mtg-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  background-color: #1a1614;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: block;
}

.card-overlay-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.mtg-card-wrapper:hover .card-overlay-actions {
  opacity: 1;
}

.card-zoom-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-tags-strip {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  pointer-events: none;
}

.card-tags-strip .badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Blind Mode & Live Analysis in Training */
.training-insights {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}

.condition-check-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.condition-item-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.status-icon.success { color: var(--success); }
.status-icon.fail { color: var(--danger); }

/* Reasoning Section */
.reasoning-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.reason-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.reason-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reason-chip:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.reason-chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Tab 3: Opening Hand Analysis & Charts
   ========================================================================== */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-container {
  width: 100%;
  height: 240px;
  position: relative;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.stats-table th, .stats-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.stats-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.stats-table td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Turn Simulation Slider */
.turn-simulation-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Tab 4: Keep Condition Builder & Simulation
   ========================================================================== */
.condition-builder-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.condition-group-node {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0.75rem 0;
}

.condition-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.condition-rule-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.sim-progress-bar-container {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
  margin: 1rem 0;
}

.sim-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 150ms ease;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
  padding: 1.25rem;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-fast);
}

.modal-backdrop.active .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* Card Zoom Modal Custom */
.card-zoom-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.card-zoom-img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.card-zoom-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-in 0.25s ease forwards;
}

.toast.toast-success { border-color: var(--success); }
.toast.toast-danger { border-color: var(--danger); }
.toast.toast-warning { border-color: var(--warning); }

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

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
