/**
 * Sistema de Temas Moderno 2024
 * Esquemas visuais contemporâneos com suporte a modo escuro
 */

/* ========================================
   TEMAS CORPORATIVOS MODERNOS
======================================== */

/* Tema SINGUS - Azul Profissional */
.theme-singus {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    --primary-950: #082f49;
}

.theme-singus #main-container {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 30%, #0369a1 70%, #075985 100%);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(3, 105, 161, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.theme-singus .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(14, 165, 233, 0.15);
    box-shadow: 
        0 32px 64px -12px rgba(14, 165, 233, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Tema CLAN - Verde Sustentável */
.theme-clan {
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #059669;
    --primary-600: #047857;
    --primary-700: #065f46;
    --primary-800: #064e3b;
    --primary-900: #022c22;
    --primary-950: #021610;
}

.theme-clan #main-container {
    background: linear-gradient(135deg, #059669 0%, #047857 30%, #065f46 70%, #064e3b 100%);
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(5, 150, 105, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(6, 95, 70, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.theme-clan .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(5, 150, 105, 0.15);
    box-shadow: 
        0 32px 64px -12px rgba(5, 150, 105, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Tema Enterprise - Azul Corporativo */
.theme-enterprise {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    --primary-950: #172554;
}

.theme-enterprise #main-container {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 30%, #1d4ed8 70%, #1e40af 100%);
    background-image: 
        radial-gradient(circle at 25% 75%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 25%, rgba(29, 78, 216, 0.2) 0%, transparent 50%);
}

.theme-enterprise .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* ========================================
   TEMAS SETORIAIS
======================================== */

/* Tema Governo - Roxo Institucional */
.theme-governo {
    --primary-50: #faf5ff;
    --primary-100: #f3e8ff;
    --primary-200: #e9d5ff;
    --primary-300: #d8b4fe;
    --primary-400: #c084fc;
    --primary-500: #7c3aed;
    --primary-600: #6d28d9;
    --primary-700: #5b21b6;
    --primary-800: #4c1d95;
    --primary-900: #3c1361;
    --primary-950: #2e1065;
}

.theme-governo #main-container {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 30%, #5b21b6 70%, #4c1d95 100%);
    background-image: 
        radial-gradient(circle at 35% 65%, rgba(124, 58, 237, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 65% 35%, rgba(91, 33, 182, 0.2) 0%, transparent 50%);
}

.theme-governo .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(124, 58, 237, 0.15);
}

/* Tema Educação - Laranja Vibrante */
.theme-educacao {
    --primary-50: #fff7ed;
    --primary-100: #ffedd5;
    --primary-200: #fed7aa;
    --primary-300: #fdba74;
    --primary-400: #fb923c;
    --primary-500: #f59e0b;
    --primary-600: #d97706;
    --primary-700: #b45309;
    --primary-800: #92400e;
    --primary-900: #78350f;
    --primary-950: #451a03;
}

.theme-educacao #main-container {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 30%, #b45309 70%, #92400e 100%);
    background-image: 
        radial-gradient(circle at 40% 60%, rgba(245, 158, 11, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 40%, rgba(180, 83, 9, 0.2) 0%, transparent 50%);
}

.theme-educacao .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

/* Tema Saúde - Verde Médico */
.theme-saude {
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;
    --primary-950: #022c22;
}

.theme-saude #main-container {
    background: linear-gradient(135deg, #10b981 0%, #059669 30%, #047857 70%, #065f46 100%);
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(16, 185, 129, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(4, 120, 87, 0.2) 0%, transparent 50%);
}

.theme-saude .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Tema Corporativo - Vermelho Executivo */
.theme-corporativo {
    --primary-50: #fef2f2;
    --primary-100: #fee2e2;
    --primary-200: #fecaca;
    --primary-300: #fca5a5;
    --primary-400: #f87171;
    --primary-500: #dc2626;
    --primary-600: #b91c1c;
    --primary-700: #991b1b;
    --primary-800: #7f1d1d;
    --primary-900: #651f1f;
    --primary-950: #450a0a;
}

.theme-corporativo #main-container {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 30%, #991b1b 70%, #7f1d1d 100%);
    background-image: 
        radial-gradient(circle at 45% 55%, rgba(220, 38, 38, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 55% 45%, rgba(153, 27, 27, 0.2) 0%, transparent 50%);
}

.theme-corporativo .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(220, 38, 38, 0.15);
}

/* ========================================
   TEMAS ESPECIAIS
======================================== */

/* Tema Escuro Moderno */
.theme-dark {
    --primary-50: #0f172a;
    --primary-100: #1e293b;
    --primary-200: #334155;
    --primary-300: #475569;
    --primary-400: #64748b;
    --primary-500: #94a3b8;
    --primary-600: #cbd5e1;
    --primary-700: #e2e8f0;
    --primary-800: #f1f5f9;
    --primary-900: #f8fafc;
    --primary-950: #ffffff;
    
    /* Cores específicas para modo escuro */
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-emerald: #34d399;
}

.theme-dark #main-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #334155 70%, #475569 100%);
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(96, 165, 250, 0.1) 0%, transparent 70%),
        radial-gradient(circle at 70% 30%, rgba(167, 139, 250, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.05) 0%, transparent 70%);
}

.theme-dark .main-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.theme-dark .company-name {
    background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-dark .company-slogan {
    color: var(--primary-400);
}

.theme-dark .form-input input,
.theme-dark .form-input select,
.theme-dark .form-input textarea {
    background: rgba(30, 41, 59, 0.8);
    color: var(--primary-900);
    border-color: var(--primary-300);
}

.theme-dark .form-label {
    color: var(--primary-700);
}

.theme-dark .footer {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tema Premium Gold */
.theme-premium {
    --primary-50: #fffbeb;
    --primary-100: #fef3c7;
    --primary-200: #fde68a;
    --primary-300: #fcd34d;
    --primary-400: #fbbf24;
    --primary-500: #f59e0b;
    --primary-600: #d97706;
    --primary-700: #b45309;
    --primary-800: #92400e;
    --primary-900: #78350f;
    --primary-950: #451a03;
    
    /* Gradientes dourados */
    --gold-gradient: linear-gradient(135deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
}

.theme-premium #main-container {
    background: linear-gradient(135deg, #1f2937 0%, #374151 30%, #4b5563 70%, #6b7280 100%);
    background-image: 
        radial-gradient(circle at 25% 75%, rgba(252, 211, 77, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 25%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
}

.theme-premium .main-card {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.theme-premium .main-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: var(--gold-gradient);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
}

/* ========================================
   VARIAÇÕES DE MODO ESCURO
======================================== */

/* Modo escuro automático para todos os temas */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-dark) {
        --dark-overlay: rgba(0, 0, 0, 0.6);
    }
    
    .main-card:not(.theme-dark .main-card) {
        background: rgba(17, 24, 39, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .company-name:not(.theme-dark .company-name) {
        background: linear-gradient(135deg, #f9fafb 0%, #d1d5db 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .company-slogan:not(.theme-dark .company-slogan) {
        color: #9ca3af;
    }
    
    .form-input input:not(.theme-dark .form-input input),
    .form-input select:not(.theme-dark .form-input select),
    .form-input textarea:not(.theme-dark .form-input textarea) {
        background: rgba(17, 24, 39, 0.8);
        color: #f3f4f6;
        border-color: #4b5563;
    }
    
    .form-label:not(.theme-dark .form-label) {
        color: #d1d5db;
    }
}

/* ========================================
   ESQUEMAS DE CORES ALTERNATIVOS
======================================== */

/* Esquema Monocromático */
.color-scheme-mono {
    --primary-500: #6b7280;
    --primary-600: #4b5563;
    --primary-700: #374151;
    filter: grayscale(100%);
}

/* Esquema Alto Contraste */
.color-scheme-high-contrast {
    --primary-500: #000000;
    --primary-600: #1f2937;
    --primary-700: #374151;
    
    --text-color: #000000;
    --bg-color: #ffffff;
    
    filter: contrast(150%);
}

.color-scheme-high-contrast .main-card {
    background: white;
    border: 3px solid black;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Esquema Reduzido (Daltônicos) */
.color-scheme-reduced {
    --primary-500: #1f2937;
    --primary-600: #374151;
    --primary-700: #4b5563;
    
    --success-500: #1f2937;
    --warning-500: #6b7280;
    --error-500: #000000;
}

/* ========================================
   PERSONALIZAÇÕES POR DISPOSITIVO
======================================== */

/* Mobile First Adjustments */
@media (max-width: 640px) {
    .theme-dark .main-card,
    .theme-premium .main-card {
        backdrop-filter: blur(15px);
    }
    
    /* Reduzir intensidade dos gradientes em telas pequenas */
    [class*="theme-"] #main-container {
        background-size: 200% 200%;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-card {
        max-width: 480px;
    }
}

/* Desktop Large */
@media (min-width: 1920px) {
    .main-card {
        max-width: 500px;
        padding: 3rem;
    }
    
    .company-logo {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   VARIAÇÕES SAZONAIS (OPCIONAL)
======================================== */

/* Tema Natalino (Dezembro) */
.theme-seasonal-christmas {
    --primary-500: #dc2626;
    --primary-600: #b91c1c;
    --accent-green: #059669;
    --accent-gold: #d97706;
}

.theme-seasonal-christmas #main-container {
    background: linear-gradient(135deg, #dc2626 0%, #059669 50%, #d97706 100%);
}

/* Tema Ano Novo (Janeiro) */
.theme-seasonal-newyear {
    --primary-500: #7c3aed;
    --primary-600: #6d28d9;
    --accent-gold: #f59e0b;
    --accent-silver: #9ca3af;
}

.theme-seasonal-newyear #main-container {
    background: linear-gradient(135deg, #7c3aed 0%, #1e293b 50%, #f59e0b 100%);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.3) 0%, transparent 50%);
}

/* ========================================
   ANIMAÇÕES TEMÁTICAS
======================================== */

/* Animação sutil para todos os temas */
.main-card {
    animation: themeCardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes themeCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
        filter: blur(10px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Animação especial para tema premium */
.theme-premium .main-card {
    animation: premiumEntrance 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes premiumEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
        box-shadow: 0 0 0 0 rgba(252, 211, 77, 0);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 0 30px 10px rgba(252, 211, 77, 0.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 20px 40px -10px rgba(252, 211, 77, 0.1);
    }
}

/* ========================================
   UTILITÁRIOS PARA TEMAS
======================================== */

/* Transições suaves entre temas */
[class*="theme-"] * {
    transition: 
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

/* Reset de preferências de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    [class*="theme-"] #main-container {
        animation: none;
        background-image: none;
    }
    
    .main-card {
        animation: none;
    }
    
    [class*="theme-"] * {
        transition: none;
    }
}