/**
 * V-Omar VTEX Hub - Sistema de Temas (Dark/Light Mode)
 * 
 * Este arquivo define as variáveis CSS para os temas claro e escuro.
 * Para usar em qualquer página, basta incluir este CSS e usar as variáveis.
 * 
 * Uso:
 *   background: var(--bg-primary);
 *   color: var(--text-primary);
 */

/* ==========================================
   TEMA CLARO (Padrão)
   ========================================== */
:root,
[data-theme="light"] {
    /* Cores de fundo */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --bg-hover: #f0f0f0;
    --bg-active: #e8e8e8;
    
    /* Cores de texto */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverted: #ffffff;
    
    /* Bordas */
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --border-light: #f0f0f0;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
    
    /* Cores de marca */
    --brand-primary: #e51537;
    --brand-primary-hover: #c41230;
    --brand-primary-dark: #72091D;
    --brand-primary-light: rgba(229, 21, 55, 0.1);
    --brand-primary-lighter: rgba(229, 21, 55, 0.05);
    
    /* Cores de status */
    --color-success: #22c55e;
    --color-success-bg: #f0fdf4;
    --color-success-border: #bbf7d0;
    
    --color-warning: #eab308;
    --color-warning-bg: #fefce8;
    --color-warning-border: #fef08a;
    
    --color-error: #ef4444;
    --color-error-bg: #fef2f2;
    --color-error-border: #fecaca;
    
    --color-info: #3b82f6;
    --color-info-bg: #eff6ff;
    --color-info-border: #bfdbfe;
    
    --color-orange: #f97316;
    --color-orange-bg: #fff7ed;
    --color-orange-border: #fed7aa;
    
    /* Inputs */
    --input-bg: #ffffff;
    --input-border: #e5e5e5;
    --input-text: #333333;
    --input-placeholder: #999999;
    --input-focus-border: #e51537;
    --input-focus-ring: rgba(229, 21, 55, 0.1);
    
    /* Scrollbar */
    --scrollbar-bg: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a1a1a1;
    
    /* Overlay */
    --overlay-bg: rgba(0, 0, 0, 0.5);
    
    /* Transição */
    --theme-transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================
   TEMA ESCURO
   ========================================== */
[data-theme="dark"] {
    /* Cores de fundo */
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d24;
    --bg-tertiary: #242830;
    --bg-hover: #2a2e38;
    --bg-active: #32363f;
    
    /* Cores de texto */
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;
    --text-inverted: #111827;
    
    /* Bordas */
    --border-primary: #2d3139;
    --border-secondary: #3d4149;
    --border-light: #242830;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
    
    /* Cores de marca */
    --brand-primary: #f43f5e;
    --brand-primary-hover: #e11d48;
    --brand-primary-dark: #72091D;
    --brand-primary-light: rgba(244, 63, 94, 0.15);
    --brand-primary-lighter: rgba(244, 63, 94, 0.08);
    
    /* Cores de status */
    --color-success: #34d399;
    --color-success-bg: rgba(52, 211, 153, 0.1);
    --color-success-border: rgba(52, 211, 153, 0.3);
    
    --color-warning: #fbbf24;
    --color-warning-bg: rgba(251, 191, 36, 0.1);
    --color-warning-border: rgba(251, 191, 36, 0.3);
    
    --color-error: #f87171;
    --color-error-bg: rgba(248, 113, 113, 0.1);
    --color-error-border: rgba(248, 113, 113, 0.3);
    
    --color-info: #60a5fa;
    --color-info-bg: rgba(96, 165, 250, 0.1);
    --color-info-border: rgba(96, 165, 250, 0.3);
    
    --color-orange: #fb923c;
    --color-orange-bg: rgba(251, 146, 60, 0.1);
    --color-orange-border: rgba(251, 146, 60, 0.3);
    
    /* Inputs */
    --input-bg: #1a1d24;
    --input-border: #3d4149;
    --input-text: #f3f4f6;
    --input-placeholder: #6b7280;
    --input-focus-border: #f43f5e;
    --input-focus-ring: rgba(244, 63, 94, 0.2);
    
    /* Scrollbar */
    --scrollbar-bg: #1a1d24;
    --scrollbar-thumb: #3d4149;
    --scrollbar-thumb-hover: #4d5159;
    
    /* Overlay */
    --overlay-bg: rgba(0, 0, 0, 0.7);
}

/* ==========================================
   ESTILOS BASE USANDO VARIÁVEIS
   ========================================== */

/* Aplicar transição suave ao mudar tema */
body,
body * {
    transition: var(--theme-transition);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==========================================
   CLASSES UTILITÁRIAS DE TEMA
   ========================================== */

/* Background do body para páginas temáticas */
.theme-bg {
    background: var(--bg-primary) !important;
}

/* Backgrounds */
.theme-bg-primary { background-color: var(--bg-primary) !important; }
.theme-bg-secondary { background-color: var(--bg-secondary) !important; }
.theme-bg-tertiary { background-color: var(--bg-tertiary) !important; }

/* Textos */
.theme-text-primary { color: var(--text-primary) !important; }
.theme-text-secondary { color: var(--text-secondary) !important; }
.theme-text-tertiary { color: var(--text-tertiary) !important; }
.theme-text-muted { color: var(--text-muted) !important; }

/* Bordas */
.theme-border { border-color: var(--border-primary) !important; }
.theme-border-secondary { border-color: var(--border-secondary) !important; }

/* Cards */
.theme-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-card);
}

.theme-card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Inputs */
.theme-input {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
}

.theme-input::placeholder {
    color: var(--input-placeholder);
}

.theme-input:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
    outline: none;
}

/* Botões */
.theme-btn-primary {
    background-color: var(--brand-primary);
    color: var(--text-inverted);
}

.theme-btn-primary:hover {
    background-color: var(--brand-primary-hover);
}

/* ==========================================
   BOTÃO DE TOGGLE DO TEMA
   ========================================== */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

/* Ícone do sol (light mode) */
.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

/* No dark mode, mostrar lua e esconder sol */
[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* Animação de rotação ao trocar tema */
.theme-toggle.switching svg {
    animation: spin-toggle 0.3s ease;
}

@keyframes spin-toggle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.8); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ==========================================
   TABELAS
   ========================================== */
.table-header {
    background-color: var(--bg-tertiary);
}

.table-row {
    border-bottom: 1px solid var(--border-primary);
}

.table-row:hover {
    background-color: var(--bg-hover);
}

/* ==========================================
   MODAL
   ========================================== */
.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.modal-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
}
