/* Estilo Minimalista e Dark */
:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-green: #00ff66;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Efeito Scanline (Monitor Antigo) */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 9999;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    opacity: 0.4;
}

/* Fundo Matrix Canvas */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* Efeito de Animação RGB de fundo */
@keyframes rgb-glow {
    0% { filter: drop-shadow(0 0 10px var(--neon-blue)); }
    33% { filter: drop-shadow(0 0 10px var(--neon-purple)); }
    66% { filter: drop-shadow(0 0 10px var(--neon-green)); }
    100% { filter: drop-shadow(0 0 10px var(--neon-blue)); }
}

/* Animação Glitch Aleatória */
@keyframes glitch-random {
    0%, 90%, 100% { transform: translate(0); filter: none; opacity: 1; }
    92% { transform: translate(-3px, 2px); filter: hue-rotate(90deg) contrast(1.2); opacity: 0.8; }
    94% { transform: translate(3px, -2px); filter: hue-rotate(-90deg) contrast(1.5); opacity: 0.9; }
    95% { transform: translate(-1px, -3px); filter: invert(0.1); opacity: 0.7; }
    96% { transform: translate(2px, 3px); filter: brightness(2); }
    98% { transform: translate(-5px, 0); clip-path: inset(10% 0 30% 0); }
    99% { transform: translate(5px, 0); clip-path: inset(40% 0 10% 0); }
}

header {
    text-align: center;
    padding: 50px 20px;
    border-bottom: 1px solid #222;
}

header p { opacity: 0.7; letter-spacing: 1px; }

.status-bar {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--neon-green);
    margin-bottom: 15px;
    text-transform: uppercase;
    text-shadow: 0 0 5px var(--neon-green);
}

h1 {
    font-size: 3rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: rgb-glow 3s infinite alternate, glitch-random 5s infinite;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-color);
}

.top-bar-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    text-align: center;
}

#user-profile {
    display: none; /* Começa oculto */
    align-items: center;
    gap: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
}

#user-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--neon-blue);
}

h1 span {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    -webkit-text-stroke: 0;
}

/* Botão do Menu Hamburger */
.menu-toggle-btn {
    display: none; /* Oculto em desktop */
    position: absolute;
    top: 60px;
    right: 20px;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10002; /* Acima do overlay do terminal */
}

.menu-toggle-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Animação do botão para 'X' */
.side-menu-open .menu-toggle-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.side-menu-open .menu-toggle-btn span:nth-child(2) { opacity: 0; }
.side-menu-open .menu-toggle-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Overlay de fundo */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998; /* Abaixo do menu, acima do resto */
}
.side-menu-open .overlay {
    display: block;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #0a0a0a;
    flex-wrap: wrap; /* Permite que os botões quebrem linha em telas menores */
}

.neon-btn {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--neon-purple);
    padding: 10px 20px;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--neon-purple) inset, 0 0 5px var(--neon-purple);
}

/* Variantes de Botões Neon */
.neon-btn.blue {
    border-color: var(--neon-blue);
    box-shadow: 0 0 5px var(--neon-blue) inset, 0 0 5px var(--neon-blue);
}
.neon-btn.green {
    border-color: var(--neon-green);
    box-shadow: 0 0 5px var(--neon-green) inset, 0 0 5px var(--neon-green);
}

.neon-btn:hover {
    background: var(--neon-purple);
    box-shadow: 0 0 15px var(--neon-purple), 0 0 30px var(--neon-purple);
    transform: scale(1.05);
}
.neon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background: #111;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--neon-blue);
    box-shadow: -5px 0 15px rgba(0, 243, 255, 0.2);
    transition: transform 0.3s;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card:hover {
    transform: translateY(-5px);
    border-left-color: var(--neon-green);
    box-shadow: -5px 0 15px rgba(0, 255, 102, 0.3);
}

/* Estilos do Gráfico de Admin */
.admin-chart-container {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

#adminTicketLegend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* Estilos do Sistema de Respostas do Ticket */
.ticket-replies-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
}
.reply-box {
    background: #2a2a2a;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}
.reply-box.admin-reply {
    background: rgba(0, 243, 255, 0.1);
    border-left: 2px solid var(--neon-blue);
}
.reply-form { margin-top: 10px; }

/* Estilos da Busca de Admin */
#admin-search-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: center;
}
#admin-search-container input {
    margin: 0;
    flex-grow: 1;
}

/* Estilos do Filtro de Admin */
#admin-filter-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
#admin-filter-container .neon-btn {
    padding: 5px 15px;
    font-size: 0.8rem;
}
#admin-filter-container .neon-btn.active {
    background: var(--neon-blue);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--neon-blue);
}

/* Estilos das Configurações */
.settings-group {
    margin-top: 15px;
}
.settings-group label {
    display: block;
    margin-bottom: 10px;
    color: #aaa;
}
.theme-options {
    display: flex;
    gap: 20px;
}
.theme-options label {
    color: var(--text-color);
    cursor: pointer;
}

/* Estilos do Formulário de Perfil */
#profileForm {
    display: flex;
    flex-direction: column;
}
.profile-pic-updater {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
#profilePicPreview {
    width: 120px; height: 120px; border-radius: 50%; border: 3px solid var(--neon-blue); object-fit: cover;
}

/* Estilos da Paginação de Admin */
#admin-pagination-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
#admin-pagination-container .neon-btn {
    padding: 5px 15px;
    font-size: 0.8rem;
}
#admin-pagination-container .neon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

h2 {
    color: var(--neon-blue);
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

/* Formulários */
input, textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: #222;
    border: 1px solid #444;
    color: white;
    box-sizing: border-box;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.5);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: rgba(0, 0, 0, 0.9);
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    padding: 12px 20px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    animation: toast-slide 0.3s ease-out;
}
@keyframes toast-slide { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Vault Styles */
#confidential-files ul { list-style: none; padding: 0; }
#confidential-files li { 
    padding: 10px; margin: 5px 0; background: #1a1a1a; 
    border-left: 2px solid var(--neon-purple); font-size: 0.9rem;
}

/* Access Level Colors for Security Terminal */
#sec-username {
    transition: color 0.3s ease;
}
.access-level-idle { color: #0f0; }
.access-level-awaiting { color: #ffcc00; }
.access-level-unlocked { color: var(--neon-blue); }
.access-level-denied { color: #ff3333; }

/* Terminal Logs Style */
#system-logs {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--neon-green);
    height: 120px;
    overflow-y: hidden;
}

/* Dashboard Metrics */
.dashboard-metric {
    margin-top: 10px;
}
.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 5px;
    color: #aaa;
    text-transform: uppercase;
}
.progress-track {
    height: 6px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

/* Modificadores de cor para a barra de progresso */
.progress-bar.green {
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
}

.progress-bar.purple {
    background: var(--neon-purple);
    box-shadow: 0 0 10px var(--neon-purple);
}

/* Estilo para links de arquivos confidenciais */
#confidential-files a {
    color: var(--neon-blue);
    text-decoration: none;
}

/* Estilo Busca Avisos */
#avisoSearch {
    margin-bottom: 20px;
    border-radius: 4px;
    border-color: var(--neon-purple);
}

/* Estilos de Prioridade de Avisos */
.notice {
    transition: all 0.3s;
}
.notice.urgent {
    color: #ff8a8a;
    font-weight: bold;
    animation: urgent-pulse 2s infinite alternate;
}
@keyframes urgent-pulse {
    from { text-shadow: 0 0 5px rgba(255, 51, 51, 0.5); }
    to { text-shadow: 0 0 15px rgba(255, 51, 51, 1); }
}


/* Status de Serviços & LEDs */
.status-grid {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-family: 'Courier New', Courier, monospace;
}
.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.led-on {
    background-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    animation: led-blink 1.5s infinite alternate;
}
.led-off {
    background-color: #ff3333;
    box-shadow: 0 0 10px #ff3333;
}
@keyframes led-blink {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.5; transform: scale(0.9); }
}

/* Efeito de Tremor (Shake) */
@keyframes screen-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

.shake-effect {
    animation: screen-shake 0.2s ease-in-out 0s 2;
}

/* Acessibilidade: Alto Contraste */
body.high-contrast {
    --bg-color: #000000;
    --text-color: #ffffff;
    --neon-blue: #ffffff;
    --neon-purple: #ffffff;
    --neon-green: #ffff00;
}
body.high-contrast * {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
}
body.high-contrast .card {
    border: 2px solid #fff !important;
}
body.high-contrast h1 {
    -webkit-text-stroke: 0;
    color: #fff;
}
body.high-contrast #matrix-bg {
    display: none;
}

/* Tema Matrix Alternativo */
body.matrix-theme {
    --bg-color: #000000;
    --text-color: #00ff41;
    --neon-blue: #00ff41;
    --neon-purple: #00ff41;
    --neon-green: #00ff41;
}
body.matrix-theme * {
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.2) !important;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5) !important;
    border-color: #00ff41 !important;
}
body.matrix-theme .neon-btn:hover {
    background: #00ff41 !important;
    color: #000 !important;
}

/* Sistema de Abas */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
}
.tab-btn {
    background: transparent;
    border: none;
    color: #777;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: 0.3s;
    letter-spacing: 1px;
}
.tab-btn.active {
    color: var(--neon-green);
    border-bottom: 2px solid var(--neon-green);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Componentes do Terminal e Dashboard */
#terminal-loader {
    display: none;
    margin-top: 20px;
}

.terminal-loader-track {
    width: 100%;
    height: 10px;
    border: 1px solid #0f0;
    margin-top: 5px;
}

#terminal-progress {
    width: 0%;
    height: 100%;
    background: #0f0;
}

#sec-output {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #0f0;
    margin-bottom: 10px;
    height: 60px;
}

#sec-input {
    border: none;
    background: transparent;
    color: #0f0;
    outline: none;
    padding: 0;
    margin: 0;
}

#confidential-files {
    display: none;
    grid-column: 1 / -1;
    border-left-color: var(--neon-purple);
}

#poll-result-container {
    display: none;
    text-align: center;
    margin-top: 20px;
}
.poll-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    margin-top: 20px;
    align-items: flex-start; /* Alinha itens à esquerda */
}

.comment-box {
    background: #222;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 2px solid var(--neon-purple);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.logs-header h2 {
    border: none;
    margin: 0;
}

.export-btn {
    font-size: 0.7rem;
    padding: 5px 10px;
}

.u-mt-15 { margin-top: 15px; }
.contrast-btn { border-color: #fff !important; box-shadow: none !important; }
.matrix-btn { border-color: #00ff41 !important; color: #00ff41 !important; }

/* Terminal de Login */
#terminal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    z-index: 10001;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-size: 1.1rem;
}
#terminal-content { margin-bottom: 10px; white-space: pre-wrap; }
.term-input-line { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    font-size: 0.9rem;
}
#term-input { 
    background: transparent; border: none; color: #0f0; 
    outline: none; flex: 1; font-family: inherit; font-size: inherit;
}

/* Estilos para o Login com Google */
.google-login-container {
    margin-top: 30px;
    text-align: center;
}

.google-login-container p {
    color: #555;
    margin-bottom: 15px;
    font-family: inherit;
}

.ticket-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.status-aberto {
    background-color: rgba(0, 243, 255, 0.2);
    color: var(--neon-blue);
}
.status-em-andamento {
    background-color: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
}
.status-fechado {
    background-color: rgba(255, 51, 51, 0.2);
    color: #ff3333;
}

.admin-status-select {
    background-color: #333;
    color: var(--text-color);
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px;
    font-family: inherit;
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.8rem;
}

.top-bar-container #logoutBtn {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.reply-form button {
    margin-top: 10px;
    padding: 8px 15px;
}

.user-close-ticket-btn {
    margin-top: 15px;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-color: #ff3333;
}

.admin-delete-btn {
    margin-left: 10px;
    border-color: #ff3333;
    padding: 5px 10px;
    font-size: 0.8rem;
}

#deleteAccountBtn {
    border-color: #ff3333;
    box-shadow: 0 0 5px #ff3333 inset, 0 0 5px #ff3333;
}

/* Classe de utilidade para ocultar elementos */
.hidden {
    display: none !important;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #222;
    color: #777;
}

@keyframes footer-glitch {
    0%, 100% { text-shadow: 0 0 5px var(--neon-blue); color: var(--text-color); }
    20% { text-shadow: 2px 2px 5px var(--neon-purple), -2px -2px 5px var(--neon-green); color: #ccc; }
    21% { text-shadow: 0 0 5px var(--neon-blue); color: var(--text-color); }
    60% { text-shadow: 2px 2px 5px var(--neon-purple), -2px -2px 5px var(--neon-green); color: #ccc; }
    61% { text-shadow: 0 0 5px var(--neon-blue); color: var(--text-color); }
    80% { text-shadow: 2px 2px 5px var(--neon-purple), -2px -2px 5px var(--neon-green); color: #ccc; }
    81% { text-shadow: 0 0 5px var(--neon-blue); color: var(--text-color); }
}

footer p {
    color: var(--text-color);
    animation: footer-glitch 5s infinite alternate;
    transition: color 0.3s;
}

/* Efeito de Rastro do Mouse */
.mouse-trail-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background-color: var(--neon-blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10003; /* Acima de tudo, exceto talvez o terminal de login */
    box-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue);
    animation: trail-fade 0.7s linear forwards;
}

@keyframes trail-fade {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .menu-toggle-btn {
        display: block;
    }

    .container {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
        -webkit-text-stroke-width: 1px;
    }

    nav {
        position: fixed;
        top: 0;
        right: -300px; /* Começa fora da tela */
        width: 280px;
        height: 100%;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 80px;
        gap: 15px;
        transition: right 0.4s ease-in-out;
        z-index: 9999; /* Acima do overlay */
        box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    }

    .top-bar-container {
        position: relative;
        left: auto;
        transform: none;
        padding: 10px;
        width: auto;
    }

    header {
        padding: 20px 10px;
    }

    .side-menu-open nav {
        right: 0; /* Desliza para dentro */
    }

    nav .neon-btn {
        width: 80%;
    }
}