/* ===== THEME SWITCHER ===== */
.theme-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-switcher-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.theme-switcher-icon {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

/* Toggle Switch */
.theme-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
  border: none;
  padding: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.theme-toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #7C3AED, #5B21B6);
  border-radius: 50%;
  transition: transform 0.3s ease;
  display: grid;
  place-items: center;
}

.theme-toggle-slider svg {
  width: 12px;
  height: 12px;
  color: white;
}

/* Quando light mode está ativo */
.theme-toggle.light-mode {
  background: rgba(252, 85, 30, 0.2);
}

.theme-toggle.light-mode .theme-toggle-slider {
  transform: translateX(22px);
  background: linear-gradient(135deg, #FC551E, #F97316);
}

/* ===== LIGHT THEME VARIABLES ===== */
html[data-theme="light"] {
  /* Cores principais */
  --primary: #FC551E;
  --primary-dark: #E64A1B;
  --primary-light: #FF6B3D;
  --accent: #7C3AED;
  --accent-light: #A78BFA;
  
  /* Backgrounds */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --card: #FFFFFF;
  --panel: #F9FAFB;
  --border: #E2E8F0;
  
  /* Textos */
  --text: #1E293B;
  --muted: #64748B;
  
  /* Estados */
  --success: #22C55E;
  --danger: #EF4444;
  --ok: #22C55E;
  
  /* Sidebar gradient (light version) */
  --sb-from: #FFFFFF;
  --sb-mid: #F9FAFB;
  --sb-to: #F5F7FA;
}

/* Ajustes específicos para o light mode */
html[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

/* Drawer gradiente no light mode */
html[data-theme="light"] .drawer {
  background: linear-gradient(180deg, var(--sb-from) 0%, var(--sb-mid) 38%, var(--sb-to) 100%);
  border-right: 1px solid var(--border);
}

/* Menu items no light mode */
html[data-theme="light"] .drawer .menu .menu-link {
  color: var(--text);
}

html[data-theme="light"] .drawer .menu .menu-link:hover {
  background: rgba(252, 85, 30, 0.08);
  border-color: rgba(252, 85, 30, 0.15);
}

html[data-theme="light"] .drawer .menu .menu-link.active {
  background: rgba(252, 85, 30, 0.12);
  border-color: rgba(252, 85, 30, 0.25);
}

html[data-theme="light"] .drawer .menu .menu-link .ico {
  opacity: 0.8;
}

/* Drawer user no light mode */
html[data-theme="light"] .drawer-user,
html[data-theme="light"] .drawer .foot .empresa {
  background: var(--panel);
  border: 1px solid var(--border);
}

html[data-theme="light"] .drawer-user-email {
  color: var(--muted);
}

/* Drawer footer */
html[data-theme="light"] .drawer .foot {
  border-top: 1px solid var(--border);
}

html[data-theme="light"] .drawer .foot .logout-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

html[data-theme="light"] .drawer .foot .logout-btn:hover {
  background: var(--panel);
  border-color: var(--primary);
}

/* Cards e surfaces */
html[data-theme="light"] .product-card,
html[data-theme="light"] .card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .product-card:hover,
html[data-theme="light"] .card:hover {
  box-shadow: 0 4px 20px rgba(252, 85, 30, 0.15);
}

/* Toolbar no light mode */
html[data-theme="light"] .toolbar {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* Inputs no light mode */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
  border-color: var(--primary);
  background: white;
}

/* Modais no light mode */
html[data-theme="light"] .modal,
html[data-theme="light"] .modal-overlay .modal {
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .modal-header {
  border-bottom: 1px solid var(--border);
}

/* Badges no light mode */
html[data-theme="light"] .badge {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

html[data-theme="light"] .badge.active {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #16A34A;
}

html[data-theme="light"] .badge.inactive {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #DC2626;
}

/* Tabelas no light mode */
html[data-theme="light"] table {
  background: var(--surface);
}

html[data-theme="light"] thead {
  background: var(--panel);
  border-bottom: 2px solid var(--border);
}

html[data-theme="light"] tbody tr {
  border-bottom: 1px solid var(--border);
}

html[data-theme="light"] tbody tr:hover {
  background: var(--panel);
}

/* Botões no light mode */
html[data-theme="light"] .btn {
  border-color: var(--border);
}

html[data-theme="light"] .btn.cta {
  background: var(--primary);
  color: white;
}

html[data-theme="light"] .btn.cta:hover {
  background: var(--primary-dark);
}

html[data-theme="light"] .btn.secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

html[data-theme="light"] .btn.secondary:hover {
  background: var(--panel);
  border-color: var(--primary);
}

/* ===== Theme Switcher no topo do Drawer ===== */
/* Estilos específicos para quando o theme switcher está logo após a logo */
.drawer-header + div .theme-switcher,
#drawerThemeSwitcher .theme-switcher,
#favoritosThemeSwitcher .theme-switcher {
  width: 100%;
  padding: 0;
  justify-content: center;
  background: transparent;
}

#drawerThemeSwitcher,
#favoritosThemeSwitcher {
  display: flex;
  justify-content: center;
  align-items: center;
}
