/**
 * Dark Mode Styles - Presellcod
 * Modo escuro para interface do sistema (não afeta formulários gerados)
 */

/* ============================================
   VARIÁVEIS CSS - MODO CLARO (PADRÃO)
   ============================================ */
:root {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --border-color-dark: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --icon-glow: none;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --hover-bg: #f3f4f6;
}

/* ============================================
   VARIÁVEIS CSS - MODO ESCURO
   ============================================ */
body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #0a0a0a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --border-color: #333333;
    --border-color-dark: #404040;
    --shadow-sm: 0 1px 2px 0 rgba(255, 255, 255, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(255, 255, 255, 0.15);
    --icon-glow: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    --card-bg: #1a1a1a;
    --input-bg: #0a0a0a;
    --input-border: #333333;
    --hover-bg: #2a2a2a;
}

/* ============================================
   TRANSIÇÕES SUAVES
   ============================================ */
body,
header,
.bg-white,
.bg-gray-50,
.bg-gray-100,
input,
textarea,
select,
button:not(.js_submit),
.card,
.border {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================
   ESTILOS GLOBAIS - DARK MODE
   ============================================ */
body.dark-mode {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Headers */
body.dark-mode header {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

/* Backgrounds */
body.dark-mode .bg-white {
    background-color: var(--card-bg) !important;
}

body.dark-mode .bg-gray-50 {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
}

/* Textos */
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-900 {
    color: var(--text-primary) !important;
}

body.dark-mode .text-gray-600,
body.dark-mode .text-gray-700 {
    color: var(--text-secondary) !important;
}

body.dark-mode .text-gray-500 {
    color: var(--text-tertiary) !important;
}

/* Bordas */
body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300 {
    border-color: var(--border-color) !important;
}

body.dark-mode .border-gray-400 {
    border-color: var(--border-color-dark) !important;
}

/* Sombras */
body.dark-mode .shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

body.dark-mode .shadow-md {
    box-shadow: var(--shadow-md) !important;
}

body.dark-mode .shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* ============================================
   INPUTS E FORMULÁRIOS
   ============================================ */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="url"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="number"],
body.dark-mode textarea,
body.dark-mode select {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: var(--text-tertiary) !important;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: #3b82f6 !important;
    background-color: var(--input-bg) !important;
}

/* ============================================
   ÍCONES COM EFEITO GLOW
   ============================================ */
body.dark-mode svg,
body.dark-mode img.icon,
body.dark-mode .icon {
    filter: var(--icon-glow);
}

/* Logos de plataformas */
body.dark-mode .option-item img,
body.dark-mode .option-item-perfil img {
    filter: var(--icon-glow);
}

/* ============================================
   HOVER STATES
   ============================================ */
body.dark-mode .hover\:bg-gray-50:hover,
body.dark-mode .hover\:bg-gray-100:hover {
    background-color: var(--hover-bg) !important;
}

body.dark-mode .hover\:bg-blue-50:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* ============================================
   BOTÕES (exceto formulários)
   ============================================ */
body.dark-mode .bg-gray-600 {
    background-color: #4b5563 !important;
}

body.dark-mode .bg-gray-600:hover {
    background-color: #374151 !important;
}

/* ============================================
   PREVIEW DO FORMULÁRIO - NÃO ALTERAR
   ============================================ */
body.dark-mode #preview-container,
body.dark-mode #preview-container * {
    /* Resetar para modo claro */
    background-color: initial !important;
    color: initial !important;
    border-color: initial !important;
    filter: none !important;
}

body.dark-mode iframe {
    /* Iframes mantêm modo claro */
    filter: none !important;
}

/* ============================================
   DROPDOWN CUSTOMIZADO
   ============================================ */
body.dark-mode .custom-select-wrapper #custom-select-display {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .custom-select-wrapper #custom-select-options {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .option-item,
body.dark-mode .option-item-perfil {
    color: var(--text-primary) !important;
}

body.dark-mode .option-item:hover,
body.dark-mode .option-item-perfil:hover {
    background-color: var(--hover-bg) !important;
}

/* ============================================
   TABS
   ============================================ */
body.dark-mode .tab-button {
    color: var(--text-secondary) !important;
}

body.dark-mode .tab-button.active {
    color: #3b82f6 !important;
    border-bottom-color: #3b82f6 !important;
}

body.dark-mode .tab-button:hover {
    color: var(--text-primary) !important;
}

/* ============================================
   COLOR PICKER
   ============================================ */
body.dark-mode .color-preview {
    border-color: var(--border-color) !important;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
body.dark-mode .login-container {
    background-color: var(--bg-primary) !important;
}

body.dark-mode .login-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* ============================================
   DARK MODE TOGGLE BUTTON
   ============================================ */
.dark-mode-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #d1d5db;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0 3px;
}

.dark-mode-toggle:hover {
    background-color: #9ca3af;
}

body.dark-mode .dark-mode-toggle {
    background-color: #3b82f6;
}

body.dark-mode .dark-mode-toggle:hover {
    background-color: #2563eb;
}

.dark-mode-toggle-slider {
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode .dark-mode-toggle-slider {
    transform: translateX(24px);
}

.dark-mode-toggle-icon {
    width: 12px;
    height: 12px;
    color: #fbbf24;
}

body.dark-mode .dark-mode-toggle-icon {
    color: #fbbf24;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .dark-mode-toggle {
        width: 44px;
        height: 24px;
    }
    
    .dark-mode-toggle-slider {
        width: 18px;
        height: 18px;
    }
    
    body.dark-mode .dark-mode-toggle-slider {
        transform: translateX(20px);
    }
}
