/* Modern Dark Theme & Variables */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-color: rgba(55, 65, 81, 0.5);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-green: #22c55e;
  --accent-green-glow: rgba(34, 197, 94, 0.2);
  --accent-blue: #3b82f6;
  --accent-orange: #f97316;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;
  --accent-yellow: #eab308;
}

/* Light Theme Variables */
body.light-theme {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --border-color: rgba(203, 213, 225, 0.8);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent-green: #16a34a;
  --accent-green-glow: rgba(22, 163, 74, 0.15);
}

body.light-theme .glass-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: #cbd5e1;
}

body.light-theme .glass-panel {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

body.light-theme input,
body.light-theme select,
body.light-theme textarea {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
  color: #94a3b8 !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glassmorphism effects */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.glass-header {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

/* Platform Badges */
.badge-olx {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-allegro {
  background-color: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-vinted {
  background-color: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-sprzedajemy {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-otomoto {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-wakacje {
  background-color: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-fly4free {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Status Badges */
.badge-delivery-lost {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-sold {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-delivery {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-price-drop {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Inactive Deal Card */
.deal-card.deal-inactive {
  opacity: 0.65;
  filter: grayscale(35%);
  border-style: dashed;
}

/* Card animations */
.deal-card {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px 0 var(--accent-green-glow);
  border-color: rgba(34, 197, 94, 0.4);
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Modal transition */
.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

/* Pulsing radar dot */
@keyframes radar-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.radar-dot {
  animation: radar-pulse 2s infinite;
}

/* --- FORCE LIGHT MODE OVERRIDES (CORRECTED) --- */
body.light-theme,
body.light-theme.bg-slate-950,
body.light-theme .bg-slate-950,
body.light-theme .bg-slate-950\/80 { background-color: #f1f5f9 !important; }

body.light-theme.bg-slate-900,
body.light-theme .bg-slate-900,
body.light-theme .bg-slate-900\/80,
body.light-theme .bg-slate-900\/60,
body.light-theme .bg-slate-900\/50,
body.light-theme .bg-slate-900\/30 { background-color: #ffffff !important; }

body.light-theme.bg-slate-800,
body.light-theme .bg-slate-800,
body.light-theme .bg-slate-800\/80 { background-color: #e2e8f0 !important; }

body.light-theme .border-slate-800, 
body.light-theme .border-slate-800\/80, 
body.light-theme .border-slate-800\/50, 
body.light-theme .border-slate-700,
body.light-theme .border-slate-700\/60 { border-color: #cbd5e1 !important; }

body.light-theme,
body.light-theme.text-slate-100,
body.light-theme .text-slate-100,
body.light-theme .text-white { color: #0f172a !important; }

body.light-theme.text-slate-200,
body.light-theme .text-slate-200 { color: #1e293b !important; }

body.light-theme.text-slate-300,
body.light-theme .text-slate-300 { color: #334155 !important; }

body.light-theme.text-slate-400,
body.light-theme .text-slate-400 { color: #475569 !important; }

body.light-theme.text-slate-500,
body.light-theme .text-slate-500,
body.light-theme .text-slate-600 { color: #64748b !important; }

body.light-theme .hover\:bg-slate-800:hover,
body.light-theme .hover\:bg-slate-700:hover { background-color: #cbd5e1 !important; }
body.light-theme .hover\:text-white:hover { color: #000 !important; }

/* Keep badges looking decent in light mode */
body.light-theme .bg-emerald-500\/10, body.light-theme .bg-emerald-500\/20, body.light-theme .bg-emerald-600\/20, body.light-theme .bg-emerald-600\/30 { background-color: rgba(16, 185, 129, 0.15) !important; }
body.light-theme .text-emerald-400, body.light-theme .text-emerald-300, body.light-theme .text-emerald-500 { color: #059669 !important; }
body.light-theme .border-emerald-500\/20, body.light-theme .border-emerald-500\/30, body.light-theme .border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.3) !important; }

body.light-theme .text-amber-400, body.light-theme .text-amber-300 { color: #d97706 !important; }
body.light-theme .text-rose-400, body.light-theme .text-rose-500 { color: #e11d48 !important; }
body.light-theme .bg-rose-500\/10, body.light-theme .bg-rose-500\/20 { background-color: rgba(225, 29, 72, 0.1) !important; border-color: rgba(225, 29, 72, 0.2) !important; }

body.light-theme .bg-indigo-500\/20 { background-color: rgba(99, 102, 241, 0.1) !important; }
body.light-theme .text-indigo-400 { color: #4f46e5 !important; }
body.light-theme .border-indigo-500\/20, body.light-theme .border-t-indigo-500 { border-color: rgba(99, 102, 241, 0.3) !important; }

/* Fix AI badge background specifically */
body.light-theme .bg-indigo-950\/30 { background-color: rgba(99, 102, 241, 0.1) !important; }
body.light-theme .text-indigo-200\/80 { color: #312e81 !important; }