/* FastUtil - Custom Styles */

/* Checkerboard pattern for transparent canvas / image previews */
.bg-checkered {
    background-color: #f8fafc;
    background-image: 
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Custom Range Slider */
input[type="range"] {
    accent-color: #4f46e5;
}

/* Drag & Drop active hover states */
.drag-active {
    border-color: #4f46e5 !important;
    background-color: #eef2ff !important;
    transform: scale(1.01);
}

/* Smooth fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

/* ==========================================================================
   FastUtil - Dark Mode Design System
   ========================================================================== */

.dark {
    color-scheme: dark;
}

/* Base Body & Backgrounds */
.dark body {
    background-color: #020617; /* slate-950 */
    color: #f1f5f9; /* slate-100 */
}

.dark .bg-white {
    background-color: #0f172a !important; /* slate-900 */
    color: #f1f5f9;
}

.dark .bg-slate-50,
.dark .bg-slate-50\/40,
.dark .bg-slate-50\/60 {
    background-color: #020617 !important; /* slate-950 */
}

/* Hero Banner & Gradients in Dark Mode */
.dark .hero-banner {
    background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), #020617, #020617) !important;
    background-color: #020617 !important;
    border-bottom-color: #1e293b !important;
}

.dark .hero-banner-pattern {
    background-image: radial-gradient(#334155 1px, transparent 1px) !important;
    opacity: 0.35 !important;
}

.dark .bg-slate-100 {
    background-color: #1e293b !important; /* slate-800 */
    color: #f1f5f9;
}

.dark .bg-slate-200,
.dark .bg-slate-200\/60,
.dark .bg-slate-200\/70 {
    background-color: #334155 !important; /* slate-700 */
    color: #f1f5f9;
}

/* Borders */
.dark .border-slate-100,
.dark .border-slate-200,
.dark .border-slate-200\/60,
.dark .border-slate-200\/80,
.dark .border-slate-200\/90,
.dark .border-slate-300 {
    border-color: #1e293b !important; /* slate-800 */
}

/* Text Colors */
.dark .text-slate-900,
.dark .text-slate-800 {
    color: #f8fafc !important; /* slate-50 */
}

.dark .text-slate-700 {
    color: #e2e8f0 !important; /* slate-200 */
}

.dark .text-slate-600 {
    color: #cbd5e1 !important; /* slate-300 */
}

.dark .text-slate-500 {
    color: #94a3b8 !important; /* slate-400 */
}

.dark .text-slate-400 {
    color: #64748b !important; /* slate-500 */
}

/* Form Inputs, Selects, Textareas */
.dark input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.dark textarea,
.dark select {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #64748b !important;
}

/* Interactive Hover & Focus States in Dark Mode */
.dark .hover\:bg-brand-50:hover,
.dark .hover\:bg-brand-50:focus,
.dark a.hover\:bg-brand-50:hover,
.dark a.hover\:bg-brand-50:focus,
.dark button.hover\:bg-brand-50:hover,
.dark button.hover\:bg-brand-50:focus {
    background-color: #1e293b !important; /* slate-800 instead of bright white */
    color: #818cf8 !important; /* indigo/brand-400 */
}

.dark .hover\:text-brand-600:hover,
.dark .hover\:text-brand-600:focus,
.dark a.hover\:text-brand-600:hover,
.dark a.hover\:text-brand-600:focus,
.dark button.hover\:text-brand-600:hover,
.dark .text-slate-700.hover\:text-brand-600:hover,
.dark .text-slate-600.hover\:text-brand-600:hover,
.dark .text-slate-800.hover\:text-brand-600:hover {
    color: #818cf8 !important; /* indigo/brand-400 */
}

.dark .hover\:bg-slate-50:hover,
.dark .hover\:bg-slate-50:focus {
    background-color: #1e293b !important;
}

.dark .hover\:bg-slate-100:hover,
.dark .hover\:bg-slate-100:focus {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

.dark .hover\:bg-slate-200:hover,
.dark .hover\:bg-slate-200:focus {
    background-color: #334155 !important;
}

.dark .hover\:text-slate-900:hover,
.dark .hover\:text-slate-900:focus {
    color: #ffffff !important;
}

/* Active & Selected items in Dark Mode (prevents bright white glare) */
.dark .bg-brand-50,
.dark .bg-brand-50\/50,
.dark .bg-brand-50\/60,
.dark .bg-brand-50\/80 {
    background-color: #1e293b !important; /* slate-800 */
    color: #818cf8 !important; /* brand-400 */
}

.dark .text-brand-600 {
    color: #818cf8 !important;
}

.dark .border-brand-200 {
    border-color: #3730a3 !important; /* indigo-800 */
}

/* Soft 50-level background tints in Dark Mode */
.dark .bg-blue-50 { background-color: rgba(37, 99, 235, 0.15) !important; }
.dark .bg-indigo-50 { background-color: rgba(79, 70, 229, 0.15) !important; }
.dark .bg-purple-50 { background-color: rgba(147, 51, 234, 0.15) !important; }
.dark .bg-emerald-50 { background-color: rgba(16, 185, 129, 0.15) !important; }
.dark .bg-amber-50 { background-color: rgba(245, 158, 11, 0.15) !important; }
.dark .bg-rose-50 { background-color: rgba(244, 63, 94, 0.15) !important; }
.dark .bg-cyan-50 { background-color: rgba(6, 182, 212, 0.15) !important; }

/* Dark mode scrollbars */
.dark ::-webkit-scrollbar-track {
    background: #020617;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Dark mode checkerboard */
.dark .bg-checkered {
    background-color: #0b0f19;
    background-image: 
        linear-gradient(45deg, #151d2f 25%, transparent 25%),
        linear-gradient(-45deg, #151d2f 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #151d2f 75%),
        linear-gradient(-45deg, transparent 75%, #151d2f 75%);
}

/* Code & Pre in Dark Mode */
.dark pre:not([class*="bg-"]) {
    background-color: #020617;
    border-color: #1e293b;
    color: #e2e8f0;
}

/* ==========================================================================
   Sliding Theme Switch (Sun on Left -> Moon on Right)
   ========================================================================== */
.theme-switch-track {
    width: 4rem; /* 64px */
    height: 2rem; /* 32px */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem;
    border-radius: 9999px;
    background-color: #e2e8f0; /* slate-200 */
    border: 1px solid #cbd5e1; /* slate-300 */
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-switch-track:hover {
    border-color: #94a3b8;
}

.dark .theme-switch-track {
    background-color: #0f172a !important; /* slate-900 */
    border-color: #334155 !important; /* slate-700 */
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);
}

.dark .theme-switch-track:hover {
    border-color: #475569 !important;
}

.theme-switch-thumb {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
    border-radius: 9999px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, border-color 0.3s ease;
    pointer-events: none;
}

.dark .theme-switch-thumb {
    transform: translateX(2rem) !important; /* 32px to the right */
    background-color: #1e293b !important; /* slate-800 */
    border-color: #475569 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
}

.theme-switch-icon-left,
.theme-switch-icon-right {
    position: relative;
    z-index: 10;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
}

/* Light Mode: Sun on Left is highlighted, Moon on Right is muted */
.theme-switch-icon-left {
    color: #f59e0b; /* amber-500 */
    opacity: 1;
}

.theme-switch-icon-right {
    color: #94a3b8; /* slate-400 */
    opacity: 0.6;
}

/* Dark Mode: Moon on Right is highlighted, Sun on Left is muted */
.dark .theme-switch-icon-left {
    color: #64748b !important; /* slate-500 */
    opacity: 0.5 !important;
}

.dark .theme-switch-icon-right {
    color: #818cf8 !important; /* indigo-400 */
    opacity: 1 !important;
}

/* ==========================================================================
   Fixed Responsive Ad Placements (Anti-CLS & Google Auto-Ads Guard)
   ========================================================================== */
.fastutil-ad-wrapper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    contain: layout;
    box-sizing: border-box;
    text-align: center;
}

.fastutil-ad-label {
    display: block;
    font-size: 10px;
    line-height: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8; /* slate-400 */
    margin-bottom: 4px;
    user-select: none;
}

.dark .fastutil-ad-label {
    color: #64748b; /* slate-500 */
}

/* The Fixed Ad Slot Container: Strict Layout Isolation (Zero CLS) */
.fastutil-ad-slot {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    contain: layout size !important; /* Imperativo: isola o layout impedindo que anúncios alterem o tamanho do container */
    border-radius: 0.875rem;
    background-color: #f8fafc; /* slate-50 */
    border: 1px dashed #cbd5e1; /* slate-300 */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dark .fastutil-ad-slot {
    background-color: #0b1120 !important; /* slate-950/deep */
    border-color: #1e293b !important; /* slate-800 */
}

/* 1. Horizontal Responsive Slot (Top, Bottom & In-Feed)
   - Mobile: 320x100 (or 320x50)
   - Tablet: 728x90
   - Desktop: 970x90
*/
.fastutil-ad-slot.fastutil-ad-horizontal {
    width: 100% !important;
    max-width: 320px !important;
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
    margin: 0 auto !important;
}

@media (min-width: 640px) {
    .fastutil-ad-slot.fastutil-ad-horizontal {
        max-width: 468px !important;
        height: 90px !important;
        min-height: 90px !important;
        max-height: 90px !important;
    }
}

@media (min-width: 768px) {
    .fastutil-ad-slot.fastutil-ad-horizontal {
        max-width: 728px !important;
        height: 90px !important;
        min-height: 90px !important;
        max-height: 90px !important;
    }
}

@media (min-width: 1024px) {
    .fastutil-ad-slot.fastutil-ad-horizontal {
        max-width: 970px !important;
        height: 90px !important;
        min-height: 90px !important;
        max-height: 90px !important;
    }
}

/* 2. Medium Rectangle Slot (Sidebar & Grid): 300x250 */
.fastutil-ad-slot.fastutil-ad-rectangle {
    width: 300px !important;
    max-width: 100% !important;
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    margin: 0 auto !important;
}

/* 3. Billboard Slot (Large Bottom Banner): 970x250 on desktop, 300x250 on mobile */
.fastutil-ad-slot.fastutil-ad-billboard {
    width: 100% !important;
    max-width: 300px !important;
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    margin: 0 auto !important;
}

@media (min-width: 768px) {
    .fastutil-ad-slot.fastutil-ad-billboard {
        max-width: 728px !important;
        height: 90px !important;
        min-height: 90px !important;
        max-height: 90px !important;
    }
}

@media (min-width: 1024px) {
    .fastutil-ad-slot.fastutil-ad-billboard {
        max-width: 970px !important;
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
}

/* Strict Overrides: Impede que o AdSense / Auto-Ads injete dimensões que estourem o container */
.fastutil-ad-slot ins.adsbygoogle,
.fastutil-ad-slot iframe,
.fastutil-ad-slot div[id^="google_ads_iframe"],
.fastutil-ad-slot div[id^="aswift"],
.fastutil-ad-slot div[data-google-query-id] {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    box-shadow: none !important;
}

/* Impede que o Google Auto-Ads force full-width 100vw no mobile */
.fastutil-ad-slot iframe[name^="google_ads_iframe"] {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Áreas críticas protegidas contra inserção de Anúncios Automáticos */
.google-auto-ads-ignore {
    position: relative;
}

/* ==========================================================================
   Print Utility Styles (Ocultar elementos desnecessários nos relatórios/PDF)
   ========================================================================== */
@media print {
    .no-print,
    #btn-back-to-top,
    #toast-container,
    #top-privacy-banner,
    .google-auto-ads-ignore,
    .fastutil-ad-wrapper {
        display: none !important;
    }
}





