/* Dashboard CSS - Complete standalone styles with Dark Mode */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ========================================
   CSS Variables for Theme Support
   ======================================== */
:root {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f9fafb;
  --bg-hover: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --text-primary: #1f2937;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --accent-blue: #3b82f6;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  --accent-purple: #9333ea;
  --accent-yellow: #d97706;
  --success-bg: linear-gradient(135deg, #dcfce7, #bbf7d0);
  --warning-bg: #fef3c7;
  --error-bg: #fee2e2;
}

[data-theme="dark"] {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --bg-hover: #374151;
  --border-color: #374151;
  --border-light: #4b5563;
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
  --success-bg: rgba(22, 163, 74, 0.2);
  --warning-bg: rgba(217, 119, 6, 0.2);
  --error-bg: rgba(220, 38, 38, 0.2);
}

/* ========================================
   Base Styles
   ======================================== */
body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  background: var(--bg-primary); 
  color: var(--text-primary);
  min-height: 100vh; 
  transition: background-color 0.3s, color 0.3s;
}

/* ========================================
   Layout
   ======================================== */
.dashboard-container { display: flex; min-height: 100vh; }

.sidebar { 
  width: 200px; 
  background: var(--bg-secondary); 
  box-shadow: var(--shadow-md); 
  position: fixed; 
  height: 100vh; 
  overflow-y: auto; 
  overflow-x: hidden;
  z-index: 50;
  transition: width 0.3s ease, background-color 0.3s;
  display: flex;
  flex-direction: column;
}

/* Collapsed sidebar */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .sidebar-title { display: none; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-link span { display: none; }
.sidebar.collapsed .status-indicator > span:last-child { display: none; }
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .logout-btn span { display: none; }
.sidebar.collapsed .sidebar-collapse-btn span { display: none; }
.sidebar.collapsed .auth-buttons span { display: none; }

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .nav-link i {
  margin: 0;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 10px 8px;
}

.sidebar.collapsed .sidebar-nav {
  padding: 6px;
}

.sidebar.collapsed .nav-section {
  margin-bottom: 6px;
}

.sidebar.collapsed .sidebar-footer {
  padding: 6px;
}

.sidebar.collapsed .status-indicator {
  justify-content: center;
}

.sidebar.collapsed .status-indicator > span:last-child { display: none; }

.sidebar.collapsed .sidebar-status-row {
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.sidebar.collapsed .user-info {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sidebar.collapsed .user-avatar {
  margin: 0;
}

.sidebar.collapsed .logout-btn {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-collapse-btn {
  justify-content: center;
}

.sidebar.collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

.sidebar.collapsed .auth-buttons {
  flex-direction: column;
}

.sidebar.collapsed .auth-buttons .btn {
  justify-content: center;
  padding: 8px;
}

/* Collapse toggle button - subtle style */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 0;
  margin-top: 6px;
  transition: color 0.15s;
}

.sidebar-collapse-btn:hover {
  color: var(--text-primary);
}

.sidebar-collapse-btn i {
  font-size: 10px;
  transition: transform 0.3s;
}

.main-content { 
  flex: 1; 
  margin-left: 200px;
  transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
  margin-left: 72px;
}

.header { 
  background: var(--bg-secondary); 
  box-shadow: var(--shadow-sm); 
  padding: 16px 32px; 
  position: sticky; 
  top: 0; 
  z-index: 40; 
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background-color 0.3s;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header h1 { 
  font-size: 24px; 
  font-weight: 700; 
  color: var(--text-primary); 
}

.content { padding: 32px; }

/* ========================================
   Sidebar
   ======================================== */
.sidebar-header { 
  padding: 10px 12px; 
  border-bottom: 1px solid var(--border-color); 
  display: flex; 
  align-items: center; 
  gap: 10px;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.sidebar-logo { 
  width: 36px; 
  height: 36px; 
  background: linear-gradient(135deg, #3b82f6, #8b5cf6); 
  border-radius: 8px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: white; 
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-title { 
  font-weight: 700; 
  font-size: 16px; 
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav { 
  padding: 8px 10px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.nav-section { margin-bottom: 10px; }
.nav-section:last-child { margin-bottom: 0; }

.nav-label { 
  font-size: 10px; 
  font-weight: 600; 
  color: var(--text-light); 
  text-transform: uppercase; 
  margin-bottom: 4px; 
  letter-spacing: 0.5px;
  padding-left: 4px;
}

.nav-link { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  padding: 8px 10px; 
  border-radius: 6px; 
  color: var(--text-secondary); 
  text-decoration: none; 
  font-size: 13px; 
  font-weight: 500;
  transition: all 0.15s; 
}

.nav-link:hover { background: var(--bg-hover); }
.nav-link.active { background: #3b82f6; color: white; }
.nav-link i { width: 20px; text-align: center; font-size: 14px; }

.sidebar-footer { 
  margin-top: auto;
  padding: 10px; 
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.status-indicator { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  font-size: 12px; 
  color: var(--text-muted);
}

/* Status row with collapse button */
.sidebar-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}

.status-dot { 
  width: 8px; 
  height: 8px; 
  background: #22c55e; 
  border-radius: 50%;
  flex-shrink: 0;
}

/* User info in sidebar footer */
.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  margin-top: 4px;
  flex-wrap: wrap;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 500;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.user-role {
  font-size: 9px;
  color: var(--text-muted);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  transition: background 0.15s;
}

.logout-btn:hover {
  background: var(--bg-hover);
}

.logout-btn i {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

/* Logout icon button (inline with username) */
.logout-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.logout-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.logout-icon-btn i {
  font-size: 14px;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.auth-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  font-size: 11px;
}

/* ========================================
   Grid System
   ======================================== */
.grid { display: grid; gap: 24px; }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Use larger cards for product-heavy sections without affecting forms/metrics. */
.deal-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
}

.compact-deal-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* Deal details 2-column layout */
.deal-details-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1400px) {
  .deal-details-layout { grid-template-columns: 1.5fr 1fr; }
}

@media (max-width: 1200px) { 
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .deal-details-layout { grid-template-columns: 1fr; }
  .deal-grid, .compact-deal-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) { 
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } 
  .deal-grid, .compact-deal-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ========================================
   Cards
   ======================================== */
.card { 
  background: var(--bg-secondary); 
  border-radius: 12px; 
  box-shadow: var(--shadow-md); 
  transition: background-color 0.3s; 
}

.card-header { 
  padding: 16px 24px; 
  border-bottom: 1px solid var(--border-color); 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.card-title { 
  font-weight: 700; 
  font-size: 18px; 
  color: var(--text-primary); 
}

.card-body { padding: 24px; }

/* ========================================
   Metric Cards
   ======================================== */
.metric-card { padding: 24px; }

.metric-icon { 
  width: 48px; 
  height: 48px; 
  border-radius: 8px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 20px; 
  margin-bottom: 16px; 
}

.metric-icon.blue { background: #dbeafe; color: #2563eb; }
.metric-icon.green { background: #dcfce7; color: #16a34a; }
.metric-icon.orange { background: #ffedd5; color: #ea580c; }
.metric-icon.purple { background: #f3e8ff; color: #9333ea; }
.metric-icon.yellow { background: #fef3c7; color: #d97706; }

[data-theme="dark"] .metric-icon.blue { background: rgba(59,130,246,0.2); }
[data-theme="dark"] .metric-icon.green { background: rgba(22,163,74,0.2); }
[data-theme="dark"] .metric-icon.orange { background: rgba(234,88,12,0.2); }
[data-theme="dark"] .metric-icon.purple { background: rgba(147,51,234,0.2); }
[data-theme="dark"] .metric-icon.yellow { background: rgba(217,119,6,0.2); }

.metric-value { 
  font-size: 30px; 
  font-weight: 700; 
  color: var(--text-primary); 
}

.metric-label { 
  font-size: 14px; 
  color: var(--text-muted); 
  margin-top: 4px; 
}

/* ========================================
   Tooltips
   ======================================== */
.tooltip-container { position: relative; }

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 280px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  margin-bottom: 8px;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-color);
}

.tooltip-container:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   Badges
   ======================================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-gray { background: #f3f4f6; color: #4b5563; }

[data-theme="dark"] .badge-green { background: rgba(22,163,74,0.2); color: #4ade80; }
[data-theme="dark"] .badge-red { background: rgba(220,38,38,0.2); color: #f87171; }
[data-theme="dark"] .badge-yellow { background: rgba(217,119,6,0.2); color: #fbbf24; }
[data-theme="dark"] .badge-blue { background: rgba(59,130,246,0.2); color: #60a5fa; }
[data-theme="dark"] .badge-purple { background: rgba(147,51,234,0.2); color: #c084fc; }
[data-theme="dark"] .badge-gray { background: rgba(107,114,128,0.2); color: #9ca3af; }


/* ========================================
   Deal Cards
   ======================================== */
.deal-card { 
  background: var(--bg-secondary); 
  border-radius: 12px; 
  overflow: hidden; 
  transition: box-shadow 0.2s, background-color 0.3s; 
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.deal-card:hover { box-shadow: var(--shadow-lg); }

.deal-image { 
  width: 100%; 
  aspect-ratio: 1 / 1;
  object-fit: cover; 
  object-position: center;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

/* Compact cards (category deals) */
.compact-card .deal-image,
.compact-card .compact-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Image container for compact cards */
.compact-card > div:first-child {
  height: 180px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.compact-card .deal-content {
  padding: 10px;
}

.compact-card .deal-title {
  font-size: 12px;
  margin-bottom: 6px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.compact-card .deal-price-current {
  font-size: 14px;
}

.compact-card .deal-meta {
  font-size: 10px;
}

.deal-content { 
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.deal-badge { 
  display: inline-block; 
  padding: 4px 8px; 
  border-radius: 4px; 
  font-size: 12px; 
  font-weight: 500; 
  margin-bottom: 8px; 
}

.deal-badge.hot { background: linear-gradient(90deg, #ef4444, #f97316); color: white; }
.deal-badge.good { background: #dcfce7; color: #166534; }
[data-theme="dark"] .deal-badge.good { background: rgba(22,163,74,0.2); color: #4ade80; }

.deal-title { 
  font-weight: 600; 
  font-size: 14px; 
  margin-bottom: 8px; 
  display: -webkit-box; 
  -webkit-line-clamp: 2; 
  line-clamp: 2;
  -webkit-box-orient: vertical; 
  overflow: hidden; 
  color: var(--text-primary); 
}

.deal-price { 
  display: flex; 
  align-items: baseline; 
  gap: 8px; 
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.deal-price-current { 
  font-size: 18px; 
  font-weight: 700; 
  color: var(--accent-green); 
}

.deal-price-original { 
  font-size: 13px; 
  color: var(--text-light); 
  text-decoration: line-through; 
}

.deal-discount { 
  font-size: 14px; 
  color: var(--accent-green); 
  font-weight: 600; 
}

.deal-meta { 
  display: flex; 
  gap: 16px; 
  font-size: 12px; 
  color: var(--text-muted); 
  margin-bottom: 10px; 
}

.deal-historical { 
  border-top: 1px solid var(--border-color); 
  padding-top: 12px; 
  margin-top: 12px; 
}

.deal-historical-label { 
  font-size: 11px; 
  color: var(--text-light); 
  text-transform: uppercase; 
}

.deal-historical-value { font-weight: 600; color: var(--text-primary); }
.deal-historical-value.below { color: var(--accent-green); }

.deal-actions { 
  display: flex; 
  gap: 8px; 
  margin-top: auto;
  padding-top: 10px;
}

/* ========================================
   Buttons
   ======================================== */
.btn { 
  padding: 8px 14px; 
  border-radius: 6px; 
  font-size: 13px; 
  font-weight: 500; 
  text-decoration: none; 
  text-align: center; 
  cursor: pointer; 
  border: none; 
  transition: all 0.15s; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 6px; 
}

.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }

.btn-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

/* Link styles */
.link {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
  position: relative;
  z-index: 10;
}
.link:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Clickable card styles */
.clickable-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.clickable-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   Progress Bars
   ======================================== */
.progress-container { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  margin-bottom: 12px; 
}

.progress-label { 
  width: 112px; 
  font-weight: 500; 
  color: var(--text-primary);
}

.progress-bar { 
  flex: 1; 
  height: 8px; 
  background: var(--border-color); 
  border-radius: 9999px; 
  overflow: hidden; 
}

.progress-fill { 
  height: 100%; 
  border-radius: 9999px; 
  transition: width 0.3s; 
}

.progress-fill.green { background: #22c55e; }
.progress-fill.orange { background: #f97316; }
.progress-fill.red { background: #ef4444; }

.progress-value { 
  width: 96px; 
  text-align: right; 
  font-size: 14px; 
  color: var(--text-muted); 
}

/* ========================================
   Tables
   ======================================== */
.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th { 
  padding: 12px 24px; 
  text-align: left; 
  font-size: 12px; 
  font-weight: 600; 
  color: var(--text-muted); 
  text-transform: uppercase; 
  background: var(--bg-tertiary); 
}

td { 
  padding: 16px 24px; 
  border-top: 1px solid var(--border-color); 
  color: var(--text-secondary); 
}

tr:hover { background: var(--bg-tertiary); }

/* ========================================
   Badges
   ======================================== */
.badge { 
  display: inline-block; 
  padding: 4px 8px; 
  border-radius: 9999px; 
  font-size: 12px; 
  font-weight: 600; 
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray { background: var(--bg-tertiary); color: var(--text-secondary); }

[data-theme="dark"] .badge-green { background: rgba(22,163,74,0.2); color: #4ade80; }
[data-theme="dark"] .badge-red { background: rgba(220,38,38,0.2); color: #f87171; }
[data-theme="dark"] .badge-yellow { background: rgba(217,119,6,0.2); color: #fbbf24; }

/* ========================================
   Forms
   ======================================== */
.form-group { margin-bottom: 16px; }

.form-label { 
  display: block; 
  font-size: 14px; 
  font-weight: 500; 
  color: var(--text-secondary); 
  margin-bottom: 4px; 
}

.form-input, .form-select { 
  width: 100%; 
  padding: 10px 12px; 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  font-size: 14px; 
  background: var(--bg-secondary); 
  color: var(--text-primary); 
  transition: background-color 0.3s, border-color 0.3s; 
}

.form-input:focus, .form-select:focus { 
  outline: none; 
  border-color: #3b82f6; 
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1); 
}

.form-row { display: flex; gap: 8px; }
.form-row .form-input { flex: 1; }

/* ========================================
   Filter Panel
   ======================================== */
.filter-panel { margin-bottom: 24px; }

.filter-grid { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 16px; 
}

@media (max-width: 1024px) { .filter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .filter-grid { grid-template-columns: 1fr; } }

.filter-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ========================================
   Empty State
   ======================================== */
.empty-state { 
  text-align: center; 
  padding: 64px 32px; 
  background: var(--bg-tertiary); 
  border-radius: 12px; 
  border: 2px dashed var(--border-color); 
}

.empty-icon { 
  font-size: 56px; 
  color: var(--text-light); 
  margin-bottom: 20px; 
}

.empty-title { 
  font-weight: 700; 
  font-size: 20px; 
  color: var(--text-secondary); 
  margin-bottom: 8px; 
}

.empty-text { 
  color: var(--text-muted); 
  margin-bottom: 20px; 
  max-width: 400px; 
  margin-left: auto; 
  margin-right: auto; 
  line-height: 1.6; 
}

/* ========================================
   Modal
   ======================================== */
.modal { 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,0.5); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 50; 
}

.modal.hidden { display: none; }

.modal-content { 
  background: var(--bg-secondary); 
  border-radius: 12px; 
  padding: 24px; 
  width: 100%; 
  max-width: 448px; 
}

.modal-title { 
  font-weight: 700; 
  font-size: 18px; 
  margin-bottom: 16px; 
  color: var(--text-primary); 
}

.modal-actions { 
  display: flex; 
  justify-content: flex-end; 
  gap: 12px; 
  margin-top: 24px; 
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-green { color: #16a34a; }
.text-red { color: #dc2626; }
.text-gray { color: var(--text-muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.link { color: #3b82f6; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ========================================
   Pagination
   ======================================== */
.pagination { 
  display: flex; 
  justify-content: center; 
  align-items: center;
  gap: 8px; 
  margin-top: 32px;
  flex-wrap: wrap;
}

.page-link { 
  padding: 8px 12px; 
  border-radius: 4px; 
  background: var(--bg-secondary); 
  text-decoration: none; 
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
  transition: background 0.2s, transform 0.1s;
}

.page-link:hover { background: var(--bg-hover); transform: translateY(-1px); }
.page-link.active { background: #3b82f6; color: white; }

.page-ellipsis {
  padding: 8px 4px;
  color: var(--text-muted);
  user-select: none;
}

.page-info {
  margin-left: 16px;
  color: var(--text-muted);
  font-size: 13px;
}


/* ========================================
   Dark Mode Toggle - Modern Pill Switch
   ======================================== */
.theme-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.05);
  overflow: hidden;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.1);
}

.theme-toggle:focus {
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 0 3px rgba(59,130,246,0.3);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 2;
}

.theme-toggle i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.theme-toggle .fa-sun {
  right: 8px;
  color: #f59e0b;
  opacity: 0.4;
}

.theme-toggle .fa-moon {
  left: 8px;
  color: #6366f1;
  opacity: 1;
}

[data-theme="dark"] .theme-toggle {
  background: linear-gradient(135deg, #312e81, #4338ca);
}

[data-theme="dark"] .theme-toggle::before {
  left: calc(100% - 25px);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  box-shadow: 0 0 8px rgba(251,191,36,0.5), 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle .fa-sun {
  opacity: 1;
  color: #fbbf24;
}

[data-theme="dark"] .theme-toggle .fa-moon {
  opacity: 0.4;
  color: #a5b4fc;
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}

.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .header { 
    padding: 12px 16px; 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--bg-secondary);
  }
  .header h1 { font-size: 16px; white-space: nowrap; }
  .content { 
    padding: 16px; 
    padding-top: 72px; /* Account for fixed header */
  }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 24px; }
  .deal-card { margin-bottom: 16px; }
  .deal-image { aspect-ratio: 1 / 1; object-fit: cover; }
  .deal-content { padding: 10px; }
  .deal-title { font-size: 12px; }
  .deal-price-current { font-size: 18px; }
  .deal-actions { flex-direction: column; }
  .deal-actions .btn { width: 100%; }
  .filter-panel .card-body { padding: 16px; }
  .filter-actions { flex-direction: column; }
  .filter-actions .btn { width: 100%; }
  .table-container { margin: 0 -16px; padding: 0 16px; }
  th, td { padding: 12px 16px; font-size: 13px; }
  
  /* Better grid on mobile */
  .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 16px; }
  .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  
  /* Unicorn cards on mobile */
  .unicorn-card { margin-bottom: 16px; }
  .unicorn-badge { 
    font-size: 11px; 
    padding: 4px 10px; 
  }
  
  /* Card header on mobile */
  .card-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 8px; 
  }
  .card-title { font-size: 16px; }
  
  /* Price comparison section on mobile */
  .unicorn-price-comparison { font-size: 11px; }
  
  /* Deal details layout on mobile */
  .deal-details-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { gap: 12px; }
  .card { border-radius: 8px; }
  .card-header { padding: 12px 16px; }
  .card-body { padding: 16px; }
  .metric-card { padding: 12px; }
  .metric-icon { width: 40px; height: 40px; font-size: 16px; margin-bottom: 12px; }
  .metric-value { font-size: 20px; }
  .metric-label { font-size: 12px; }
  .header h1 { font-size: 14px; }
  .content { padding: 12px; padding-top: 68px; }
  
  /* Smaller badges on very small screens */
  .deal-badge { font-size: 10px; padding: 3px 6px; }
  .unicorn-badge { font-size: 10px; padding: 4px 8px; }
  .score-badge { font-size: 10px; padding: 3px 6px; }
}

/* ========================================
   Last Updated Indicator
   ======================================== */
.last-updated {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-light);
  margin-left: auto;
}

.last-updated i { font-size: 14px; }

/* ========================================
   Skeleton Loaders
   ======================================== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-tertiary) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-text.sm { height: 12px; width: 60%; }
.skeleton-text.lg { height: 24px; width: 40%; }
.skeleton-card { height: 280px; }
.skeleton-metric { height: 100px; }

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

[data-theme="dark"] .loading-overlay {
  background: rgba(17,24,39,0.8);
}

.loading-overlay.active { display: flex; }

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Unicorn Card Special Styling
   ======================================== */
.unicorn-card {
  background: linear-gradient(180deg, #faf5ff, #fff);
  border: 2px solid #a855f7;
}

[data-theme="dark"] .unicorn-card {
  background: linear-gradient(180deg, #2e1065, #1f2937);
  border-color: #a855f7;
}

.unicorn-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.score-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.unicorn-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
}

.unicorn-price {
  color: #7c3aed !important;
}

[data-theme="dark"] .unicorn-price {
  color: #a78bfa !important;
}

.unicorn-savings {
  background: #f3e8ff;
  padding: 8px;
  border-radius: 6px;
  margin: 8px 0;
}

[data-theme="dark"] .unicorn-savings {
  background: rgba(139, 92, 246, 0.2);
}

.unicorn-savings-label {
  font-size: 11px;
  color: #7c3aed;
  margin-bottom: 4px;
}

[data-theme="dark"] .unicorn-savings-label {
  color: #a78bfa;
}

.unicorn-savings-value {
  font-size: 16px;
  font-weight: 700;
  color: #7c3aed;
}

[data-theme="dark"] .unicorn-savings-value {
  color: #a78bfa;
}

.unicorn-btn {
  flex: 1;
  background: linear-gradient(90deg, #8b5cf6, #a855f7) !important;
  border: none !important;
}

.unicorn-btn:hover {
  background: linear-gradient(90deg, #7c3aed, #9333ea) !important;
}

.unicorn-title {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

/* Unicorn Section Card */
.unicorn-section-card {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border: 2px solid #a855f7;
}

[data-theme="dark"] .unicorn-section-card {
  background: linear-gradient(135deg, #2e1065, #1f2937);
  border-color: #a855f7;
}

.unicorn-section-header {
  border-bottom: 1px solid #d8b4fe;
}

[data-theme="dark"] .unicorn-section-header {
  border-bottom-color: #6b21a8;
}

.unicorn-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unicorn-emoji {
  font-size: 24px;
}

.unicorn-subtitle {
  font-size: 12px;
  color: #7c3aed;
  font-weight: normal;
  margin-left: 8px;
}

[data-theme="dark"] .unicorn-subtitle {
  color: #a78bfa;
}

.unicorn-link {
  color: #7c3aed;
}

[data-theme="dark"] .unicorn-link {
  color: #a78bfa;
}

/* ========================================
   Console Panel (Settings Page)
   ======================================== */
#console-panel {
  background: #1e1e1e;
  border-radius: 0 0 12px 12px;
  padding: 16px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  max-height: 300px;
  overflow-y: auto;
  color: #d4d4d4;
}

[data-theme="dark"] #console-panel {
  background: #0d1117;
  border: 1px solid #30363d;
}

/* ========================================
   Compare Page Styles
   ======================================== */
.compare-slot {
  min-height: 200px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  transition: all 0.2s;
}

.compare-slot:hover {
  border-color: var(--accent-blue);
  background: var(--bg-hover);
}

.compare-slot.filled {
  border-style: solid;
  border-color: var(--border-color);
}

.winner-card {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 2px solid #16a34a;
}

[data-theme="dark"] .winner-card {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.3), rgba(34, 197, 94, 0.2));
}

/* ========================================
   Search Autocomplete
   ======================================== */
.search-container {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 4px;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* ========================================
   Notification History Styles
   ======================================== */
.notification-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon.sent {
  background: #dcfce7;
  color: #16a34a;
}

.notification-icon.pending {
  background: #fef3c7;
  color: #d97706;
}

.notification-icon.failed {
  background: #fee2e2;
  color: #dc2626;
}

[data-theme="dark"] .notification-icon.sent {
  background: rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .notification-icon.pending {
  background: rgba(217, 119, 6, 0.2);
}

[data-theme="dark"] .notification-icon.failed {
  background: rgba(220, 38, 38, 0.2);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notification-meta {
  font-size: 12px;
  color: var(--text-muted);
}


/* ========================================
   Analytics Charts
   ======================================== */
.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding: 16px 0;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.chart-label {
  font-size: 10px;
  color: var(--text-muted);
  transform: rotate(-45deg);
  white-space: nowrap;
}

.chart-empty {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}

.chart-empty i {
  font-size: 32px;
}

.category-chart {
  padding: 8px 0;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.category-name {
  width: 120px;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-bar-bg {
  flex: 1;
  height: 20px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.category-bar {
  height: 100%;
  border-radius: 4px;
}

.category-count {
  width: 80px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* Text color utilities */
.text-blue { color: #3b82f6 !important; }
.text-green { color: #16a34a !important; }
.text-orange { color: #ea580c !important; }
.text-purple { color: #9333ea !important; }
.text-red { color: #dc2626 !important; }
.text-muted { color: var(--text-muted); }


/* ========================================
   Filter Panel Styles
   ======================================== */
.filter-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.filter-range {
  display: flex;
  gap: 8px;
}

.filter-range .form-input {
  flex: 1;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-text {
  color: var(--text-muted);
}

/* ========================================
   Deal Card Improvements
   ======================================== */
.deal-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Note: Main .deal-image styles are defined earlier in the file */

.deal-content {
  padding: 14px;
}

.deal-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.deal-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.deal-price-current {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.deal-price-original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.deal-discount {
  font-size: 14px;
  color: #16a34a;
  font-weight: 600;
}

.deal-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.deal-actions {
  display: flex;
  gap: 8px;
}

.deal-actions .btn-primary {
  flex: 1;
}


/* ========================================
   Product Card Styles (xPrice for Resigilate)
   ======================================== */
.product-card {
  position: relative;
}

.offer-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.price-range-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-range-info i {
  color: var(--accent-blue);
}

.xprice-comparison {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}

.xprice-label {
  color: var(--text-muted);
}

.xprice-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.xprice-value.below {
  color: var(--accent-green);
}

.page-header {
  margin-bottom: 24px;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Product detail page - offers list */
.offers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.offer-item.best {
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(34, 197, 94, 0.05));
}

.offer-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-green);
}

.offer-condition {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.offer-date {
  font-size: 11px;
  color: var(--text-light);
}

/* Resigilat price history chart placeholder */
.resigilat-history-chart {
  min-height: 200px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ========================================
   Category Section Styles
   ======================================== */
.category-section {
  margin-bottom: 24px;
}

.category-section:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.category-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ========================================
   Compact Deal Card Styles
   ======================================== */
.compact-card {
  cursor: pointer;
}

.compact-image {
  height: 120px;
}

.compact-content {
  padding: 12px;
}

.compact-title {
  font-size: 12px;
  min-height: 32px;
  -webkit-line-clamp: 2;
  margin-bottom: 6px;
}

.compact-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.compact-price .deal-price-current {
  font-size: 16px;
}

.discount-badge {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.compact-meta {
  font-size: 11px;
  gap: 12px;
}

/* ========================================
   Responsive Adjustments for Category Grid
   ======================================== */
@media (max-width: 1200px) {
  .category-section .grid-4,
  .category-section .compact-deal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .category-section .grid-4,
  .category-section .compact-deal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .category-section .grid-4,
  .category-section .compact-deal-grid {
    grid-template-columns: 1fr;
  }
  
  .compact-image {
    height: 100px;
  }
}

/* ========================================
   Global Search Bar
   ======================================== */
.global-search {
  position: relative;
  flex: 1;
  max-width: 400px;
  margin: 0 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 80px 10px 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  padding: 2px 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: inherit;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--bg-hover);
}

.search-result-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
}

.search-result-price {
  font-weight: 600;
  color: var(--accent-green);
}

.search-result-discount {
  background: var(--accent-green);
  color: white;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.search-result-category {
  color: var(--text-muted);
}

.search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

.search-no-results i {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .global-search {
    display: none;
  }
  
  .search-shortcut {
    display: none;
  }
}

@media (max-width: 1024px) {
  .global-search {
    max-width: 280px;
  }
}

/* Active Deals Badge in Header */
.active-deals-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
  border: 1px solid var(--border-color);
}

#active-deals-count {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.badge-label {
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 768px) {
  .active-deals-badge {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .badge-label {
    display: none;
  }
}

/* Responsive adjustments for unicorn grid */
@media (max-width: 1400px) {
  .unicorn-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 1100px) {
  .unicorn-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .unicorn-grid {
    grid-template-columns: 1fr !important;
  }
}
