/* ==========================================================================
   FIAT CRM - Cyber Luxury Theme System (Light / Dark Mode Engine)
   ========================================================================== */

/* 1. Theme Toggle Button Styling (زر الإيقونة الدائري المبتكر بدون نصوص) */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(234, 160, 35, 0.45);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  user-select: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: #fbbf24;
  box-shadow: 0 6px 20px rgba(234, 160, 35, 0.5);
  background: rgba(30, 41, 59, 0.9);
}

.theme-toggle-btn:active {
  transform: translateY(0) scale(0.95);
}

.theme-toggle-btn .theme-icon {
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease, color 0.3s ease;
}

.theme-icon-sun {
  color: #f59e0b !important;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
}

.theme-icon-moon {
  color: #38bdf8 !important;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

/* 2. Light Theme Overrides (تغطية وتعديل الوضع الفاتح للنظام بالكامل) */
[data-theme="light"] {
  color-scheme: light;

  --bg-dark: #f0f4f9;
  --bg-surface: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-border: rgba(203, 213, 225, 0.85);
  --bg-card-hover: rgba(248, 250, 252, 0.98);

  --fiat-red: #EAA023;
  --fiat-red-light: #FBBF24;
  --fiat-red-dark: #D97706;
  --fiat-red-glow: rgba(234, 160, 35, 0.2);

  --neon-cyan: #EAA023;
  --neon-cyan-glow: rgba(234, 160, 35, 0.2);
  --neon-blue: #0284c7;
  --neon-green: #059669;
  --neon-amber: #EAA023;
  --neon-red: #dc2626;

  --chrome-silver: #1e293b;
  --chrome-light: #0f172a;
  --chrome-mid: #475569;
  --chrome-dark: #64748b;
  --chrome-gunmetal: #cbd5e1;
  --chrome-slate: #f8fafc;
  --chrome-border: rgba(148, 163, 184, 0.4);
  --chrome-border-hover: rgba(234, 160, 35, 0.5);
  --chrome-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 75%, #475569 100%);
  --metal-surface: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --input-bg: #ffffff;
  --input-border: rgba(234, 160, 35, 0.4);
  --input-focus: #EAA023;
}

/* Base Body in Light Mode */
[data-theme="light"] body {
  background-color: #f0f4f9 !important;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(200, 16, 46, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 82% 15%, rgba(2, 132, 199, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(200, 16, 46, 0.05) 0%, transparent 50%) !important;
  color: #0f172a !important;
}

/* Header & Nav Bar */
[data-theme="light"] .header-bar,
[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid rgba(234, 160, 35, 0.25) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(234, 160, 35, 0.45);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: #ffffff;
  border-color: #EAA023;
  box-shadow: 0 6px 18px rgba(234, 160, 35, 0.25);
}

[data-theme="light"] .user-badge {
  background: rgba(241, 245, 249, 0.95) !important;
  border-color: rgba(234, 160, 35, 0.3) !important;
}

[data-theme="light"] .user-name-text {
  color: #0f172a !important;
}

/* Brand Section & Logo Text in Light Mode */
[data-theme="light"] .brand-title {
  color: #0f172a !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme="light"] .brand-subtitle {
  color: #475569 !important;
}

[data-theme="light"] .header-center-title,
[data-theme="light"] .header-indicator {
  background: rgba(241, 245, 249, 0.95) !important;
  color: #0f172a !important;
  border: 1px solid rgba(203, 213, 225, 0.8) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

/* Glass Panels & Cards */
[data-theme="light"] .glass-panel,
[data-theme="light"] .client-card,
[data-theme="light"] .hub-tab-panel,
[data-theme="light"] .complaints-card,
[data-theme="light"] .report-card,
[data-theme="light"] .settings-card,
[data-theme="light"] .card-panel,
[data-theme="light"] .diag-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .summary-card,
[data-theme="light"] .survey-kpi-card,
[data-theme="light"] .no-answer-card,
[data-theme="light"] .settings-hero-card,
[data-theme="light"] .settings-content-card,
[data-theme="light"] .perm-checkbox-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(203, 213, 225, 0.85) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05) !important;
}

/* VIN & PLATE Character Boxes */
[data-theme="light"] .vin-char-box,
[data-theme="light"] .plate-char-box,
[data-theme="light"] .chassis-digit-input,
[data-theme="light"] .plate-char-input,
[data-theme="light"] .readonly-vehicle-input {
  background-color: #f1f5f9 !important;
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  font-weight: 800 !important;
}

/* Inputs, Textareas, Selects, Date Pickers, & Search Bars */
[data-theme="light"] .input-field,
[data-theme="light"] .search-input,
[data-theme="light"] select.input-field,
[data-theme="light"] textarea.input-field,
[data-theme="light"] .combobox-input,
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="text"],
[data-theme="light"] .date-input,
[data-theme="light"] .filter-search-box input {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.5) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder,
[data-theme="light"] select::placeholder {
  color: #64748b !important;
}

[data-theme="light"] .input-field:focus,
[data-theme="light"] .search-input:focus,
[data-theme="light"] select.input-field:focus,
[data-theme="light"] textarea.input-field:focus {
  border-color: #EAA023 !important;
  box-shadow: 0 0 10px rgba(234, 160, 35, 0.25) !important;
}

[data-theme="light"] .search-box-wrapper,
[data-theme="light"] .search-bar-container {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
}

/* Hub Tabs & Inactive Filter Pills */
[data-theme="light"] .hub-tab-btn:not(.active),
[data-theme="light"] .tab-btn:not(.active),
[data-theme="light"] .filter-pill-btn:not(.active),
[data-theme="light"] .branch-pill-btn:not(.active),
[data-theme="light"] .status-filter-btn:not(.active),
[data-theme="light"] .filter-chip:not(.active),
[data-theme="light"] .filter-btn:not(.active),
[data-theme="light"] .branch-filter-chip:not(.active) {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .branch-filter-chip,
[data-theme="light"] .ticket-filter-chip {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .branch-filter-chip.active,
[data-theme="light"] .ticket-filter-chip.active {
  background: linear-gradient(135deg, #FBBF24 0%, #EAA023 100%) !important;
  color: #ffffff !important;
  border-color: #FBBF24 !important;
}

/* Tables & Table Header Banners */
[data-theme="light"] .table-header-banner,
[data-theme="light"] .table-section-title,
[data-theme="light"] .table-title-box,
[data-theme="light"] .section-header-box,
[data-theme="light"] .complaints-table-header {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] table th,
[data-theme="light"] .hub-table th,
[data-theme="light"] .reports-table th,
[data-theme="light"] .complaints-table th,
[data-theme="light"] .settings-table th,
[data-theme="light"] .no-answer-table th {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-bottom: 2px solid #cbd5e1 !important;
  font-weight: 800 !important;
}

[data-theme="light"] table td,
[data-theme="light"] .hub-table td,
[data-theme="light"] .reports-table td,
[data-theme="light"] .complaints-table td,
[data-theme="light"] .settings-table td,
[data-theme="light"] .no-answer-table td {
  background: #ffffff !important;
  color: #1e293b !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] table tr:nth-child(even) td,
[data-theme="light"] .hub-table tr:nth-child(even) td,
[data-theme="light"] .reports-table tr:nth-child(even) td,
[data-theme="light"] .complaints-table tr:nth-child(even) td {
  background: #f8fafc !important;
}

[data-theme="light"] table tr:hover td,
[data-theme="light"] .hub-table tr:hover td,
[data-theme="light"] .reports-table tr:hover td,
[data-theme="light"] .complaints-table tr:hover td {
  background: rgba(234, 160, 35, 0.08) !important;
}

/* Modals & Dropdowns */
[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.45) !important;
}

[data-theme="light"] .modal-content,
[data-theme="light"] .search-results-dropdown,
[data-theme="light"] .combobox-dropdown {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(234, 160, 35, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

/* Chat & Messages */
[data-theme="light"] .wa-chat-container,
[data-theme="light"] .wa-chat-body {
  background: #f8fafc !important;
}

[data-theme="light"] .wa-chat-input-bar {
  background: #f1f5f9 !important;
  border-top-color: #cbd5e1 !important;
}

[data-theme="light"] .wa-bubble-client {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .wa-bubble-text {
  color: #0f172a !important;
}

/* Labels, Texts, & Headings */
[data-theme="light"] .field-label,
[data-theme="light"] .client-header-title,
[data-theme="light"] .section-title,
[data-theme="light"] label,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #1e293b !important;
}

[data-theme="light"] .text-muted,
[data-theme="light"] .client-header-subtitle {
  color: #64748b !important;
}

/* Chart Canvas Text Support */
[data-theme="light"] canvas {
  filter: contrast(1.05);
}
