@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Core Palette - Deep Space Theme */
    --bg-primary: #030712; /* Darker than slate-950 */
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    /* Brand Colors - Electric Violet & Cyan */
    --brand-primary: #6366f1; /* Indigo 500 */
    --brand-secondary: #8b5cf6; /* Violet 500 */
    --brand-accent: #06b6d4; /* Cyan 500 */
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    
    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* UI Elements */
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* selection */
::selection {
    background: var(--brand-primary);
    color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 3px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; line-height: 1.1; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* Layout Items */
header {
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Breadcrumbs */
.breadcrumb-nav {
    display: flex;
    align-items: center;
}

.breadcrumbs {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    opacity: 0.5;
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--brand-primary);
}

.breadcrumbs .active {
    color: var(--text-primary);
    font-weight: 600;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.logo i {
    color: var(--brand-primary);
    font-size: 1.75rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo:hover {
    transform: scale(1.02);
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

nav a {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

nav a:hover, nav a.active {
    color: var(--text-primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-gradient);
    transition: var(--transition-normal);
    border-radius: 99px;
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

main {
    flex: 1;
    padding: 3rem 0;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition-normal);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    z-index: -1;
    transition: var(--transition-normal);
    opacity: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.card-glass {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Utilities */
.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.w-full { width: 100%; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Extra premium utilities */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.text-glow {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, #2d3748 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
 
/* Dashboard & Stats */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.stat-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    color: white;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

/* Page Load Progress Bar */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
}

#top-progress-bar {
    height: 100%;
    width: 0;
    background: var(--brand-gradient);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Global Toasts */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 450px;
    pointer-events: auto;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    overflow: hidden;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
    animation: toast-timer 5s linear forwards;
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-timer {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-success { color: var(--success); border-left: 4px solid var(--success); }
.toast-error { color: var(--danger); border-left: 4px solid var(--danger); }
.toast-warning { color: var(--warning); border-left: 4px solid var(--warning); }
.toast-info { color: var(--info); border-left: 4px solid var(--info); }

/* Poll Cards Specifics */
.poll-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.card:hover .poll-card img {
    transform: scale(1.05);
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-closed { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

/* Option Selection */
.option-label {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.option-label:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--brand-primary);
}

.option-label:has(input:checked) {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
}

.option-radio {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--text-tertiary);
    border-radius: 50%;
    margin-right: 1rem;
    display: grid;
    place-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}

.option-radio::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    transform: scale(0);
    transition: 0.2s transform ease-in-out;
    background-color: white;
}

.option-label input:checked + .option-radio {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.option-label input:checked + .option-radio::before {
    transform: scale(1);
}

/* Mobile Responsive */
/* =========================================
   RESPONSIVIDADE HIPER MEGA SUPER PODEROSA
   ========================================= */

/* 1. Fluid Typography & Spacing */
html {
    font-size: 16px;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem; /* Margem segura para mobile */
}

/* Breakpoints Personalizados */
@media (min-width: 640px) { .container { max-width: 640px; padding: 0 1.5rem; } }
@media (min-width: 768px) { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1536px) { .container { max-width: 1536px; } } /* Telas 2K/4K */

/* 2. Grid System Inteligente */
.grid {
    display: grid;
    gap: 1.5rem;
}

/* Auto-fit mágico que se adapta a qualquer tela */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* Grid Específico para Enquetes (3 Colunas Fixas em Desktop) */
.polls-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr; /* Mobile Default */
}

@media (min-width: 768px) {
    .polls-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .polls-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 3. Mobile Header & Navigation */
.mobile-menu-btn {
    display: none; /* Escondido em Desktop */
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(3, 7, 18, 0.98);
    backdrop-filter: blur(15px);
    z-index: 190;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.95);
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0;
}

.mobile-nav-links a {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.mobile-nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    background: var(--brand-gradient);
    transition: width 0.3s;
    margin: 5px auto 0;
    border-radius: 99px;
}

.mobile-nav-links a:hover::after {
    width: 100%;
}

/* 4. Otimizações de Toque (Touch Targets) */
button, 
.btn, 
input, 
select, 
textarea, 
.option-label {
    min-height: 48px; /* Altura mínima para toque confortável */
    touch-action: manipulation; /* Melhora resposta ao toque */
}

/* 5. Ajustes Específicos para Mobile (até 850px para cobrir tablets menores) */
@media (max-width: 850px) {
    header { padding: 0.75rem 0; }
    
    .logo { font-size: 1.25rem; z-index: 200; position: relative; }

    /* Esconde menu desktop e mostra botão mobile */
    .desktop-nav { display: none !important; }
    .mobile-menu-btn { display: block; }
    
    .header-content {
        flex-direction: row; /* Mantém logo e menu alinhados horizontalmente */
        justify-content: space-between;
    }

    /* Cards e Elementos em Mobile */
    .card { padding: 1.5rem 1.25rem; border-radius: 16px; }
    
    .stat-value { font-size: 2.5rem; }
    
    /* Tabelas com Scroll Horizontal Suave */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: 8px;
        border: 1px solid var(--glass-border);
    }
    
    /* Remover hovers em dispositivos touch para evitar "sticky hover" */
    .card:hover { transform: none; box-shadow: none; border-color: var(--glass-border); }
    
    /* Melhorias no formulário em mobile */
    input, select, textarea {
        font-size: 16px; /* Evita zoom automático no iOS */
    }
}

/* 6. Ajustes para Telas Muito Pequenas (iPhone SE, etc) */
@media (max-width: 375px) {
    h1 { font-size: 1.75rem; }
    .btn { padding: 0.6rem 1rem; font-size: 0.85rem; width: 100%; margin-bottom: 0.5rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* 7. Ajustes para TV e Monitores Grandes */
@media (min-width: 1920px) {
    html { font-size: 18px; } /* Aumenta escala geral */
    .container { max-width: 1600px; }
    .header-content { max-width: 1800px; margin: 0 auto; }
}

/* 8. Suporte a iOS Safe Areas */
@supports (padding-top: env(safe-area-inset-top)) {
    header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mobile-overlay {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Breadcrumbs - Hiper Mega Super Poderoso */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--glass-border);
    font-size: 0.75rem;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item .active {
    color: var(--brand-secondary);
    font-weight: 600;
}

/* PWA Add-ons */
@media (display-mode: standalone) {
    header {
        padding-top: env(safe-area-inset-top);
    }
}
