/* Estilo Dark para o Painel de Admin */
: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;
}

header {
    text-align: center;
    padding: 30px 20px;
    border-bottom: 1px solid #222;
}

h1 {
    font-size: 2.5rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 4px;
}

h1 span {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
}

/* Botão do Menu Hamburger */
.menu-toggle-btn {
    display: none; /* Oculto em desktop */
    position: absolute;
    top: 35px;
    left: 20px;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10002;
}

.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;
}
.side-menu-open .overlay {
    display: block;
}

.top-bar-container {
    position: absolute;
    top: 15px;
    right: 20px;
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap; /* Permite que os itens quebrem linha em telas médias */
}

#user-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--neon-blue);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.card {
    background: #111;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--neon-blue);
}

.card.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

.card {
    flex: 1 1 300px; /* Permite que os cards cresçam e encolham */
}

/* Estilos do Card de Atividade */
.realtime-metric {
    text-align: center;
    padding: 20px 0;
}
#active-users-count {
    font-size: 3rem;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}
.metric-label {
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
}

h2 {
    color: var(--neon-blue);
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

/* Botões */
.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;
    text-decoration: none;
}
.neon-btn.blue { border-color: var(--neon-blue); }
.neon-btn:hover { background: var(--neon-purple); color: var(--bg-color); }
.neon-btn.blue:hover { background: var(--neon-blue); }
.neon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Componentes do Painel */
.admin-chart-container, #admin-search-container, #admin-filter-container, #admin-pagination-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-chart-container {
    justify-content: center; /* Centraliza o gráfico em telas menores */
}

#admin-pagination-container { justify-content: center; }

#admin-filter-container .neon-btn, #admin-pagination-container .neon-btn {
    padding: 5px 15px;
    font-size: 0.8rem;
}

#admin-filter-container .neon-btn.active {
    background: var(--neon-blue);
    color: var(--bg-color);
}

input, textarea {
    width: 100%;
    padding: 10px;
    margin: 0;
    background: #222;
    border: 1px solid #444;
    color: white;
    box-sizing: border-box;
    flex-grow: 1;
}

/* Animação de Carregamento de Tickets */
.ticket-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 40px;
}
.loader-bar {
    width: 10px;
    height: 50px;
    background-color: var(--neon-blue);
    animation: loader-pulse 1.2s infinite ease-in-out;
}
.loader-bar:nth-child(2) {
    animation-delay: 0.2s;
}
.loader-bar:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes loader-pulse {
    0%, 100% {
        transform: scaleY(0.1);
        opacity: 0.5;
    }
    50% { transform: scaleY(1); opacity: 1; }
}

/* Lista de Tickets */
.comment-box {
    background: #222;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 2px solid var(--neon-purple);
}
.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;
}
.reply-box.admin-reply {
    background: rgba(0, 243, 255, 0.1);
    border-left: 2px solid var(--neon-blue);
}

/* Status */
.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;
    cursor: pointer;
}

.admin-delete-btn {
    margin-left: 10px;
    border-color: #ff3333;
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Contador de Respostas Não Lidas */
.unread-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--bg-color);
    background-color: var(--neon-green);
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.unread-count.visible {
    opacity: 1;
    transform: scale(1);
}

/* Estilos do Gerenciamento de Avisos */
#admin-notices-list {
    margin-bottom: 30px;
}
.notice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.notice-item p {
    margin: 0;
}
.notice-item .delete-notice-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    border-color: #ff3333;
}

/* Estilos para a barra de contato da consulta */
.inquiry-contact-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    padding: 5px 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.inquiry-contact-bar p {
    margin: 0;
}

.copy-email-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
}

.reply-note {
    display: block;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #aaa;
    background: rgba(255, 204, 0, 0.1);
    padding: 8px;
    border-radius: 4px;
    border-left: 2px solid #ffcc00;
}

/* Estilos do Gerenciamento de Enquetes */
.poll-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#admin-poll-results {
    margin-top: 20px;
}

/* Estilos para as Respostas de Consultas Comerciais */
.inquiry-replies-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.inquiry-replies-container h6 {
    margin: 0 0 10px 0;
    color: #aaa;
}

.inquiry-replies-container .replies-list {
    max-height: 150px; /* Limita a altura para rolagem */
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px; /* Espaço para a scrollbar */
}

.inquiry-replies-container .reply-box {
    background: #1e1e1e;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 3px;
    font-size: 0.85rem;
    border-left: 2px solid var(--neon-purple);
}

.inquiry-replies-container .reply-box.admin-reply {
    background: rgba(0, 243, 255, 0.1);
    border-left: 2px solid var(--neon-blue);
}

.inquiry-replies-container .reply-box strong {
    color: var(--text-color);
}

.inquiry-replies-container .reply-box small {
    display: block;
    margin-top: 3px;
    font-size: 0.7rem;
    color: #888;
}

/* Estilos para o formulário de resposta comercial */
.commercial-reply-form textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    background: #222;
    border: 1px solid #444;
    color: white;
    box-sizing: border-box;
    resize: vertical;
}

.commercial-reply-form button {
    margin-top: 5px;
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Estilos das Etiquetas de Prioridade no Admin */
.priority-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 10px;
    text-transform: uppercase;
    font-weight: bold;
    color: #fff;
}
.priority-tag.normal {
    background-color: var(--neon-blue);
}
.priority-tag.urgente {
    background-color: #ff3333;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10002;
}
.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;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #222;
    color: #777;
}

/* Animação para o texto do rodapé */
@keyframes rgb-glow-footer {
    0% { text-shadow: 0 0 5px var(--neon-blue); }
    33% { text-shadow: 0 0 5px var(--neon-purple); }
    66% { text-shadow: 0 0 5px var(--neon-green); }
    100% { text-shadow: 0 0 5px var(--neon-blue); }
}

footer p {
    color: var(--text-color);
    animation: rgb-glow-footer 4s infinite alternate;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: color 0.3s;
}

/* Tema Corporativo Alternativo */
body.corporate-theme {
    --bg-color: #1a202c; /* Cinza-azulado escuro */
    --text-color: #e2e8f0; /* Cinza claro */
    --neon-blue: #4299e1; /* Azul mais calmo */
    --neon-purple: #9f7aea; /* Roxo mais calmo */
    --neon-green: #48bb78; /* Verde mais calmo */
}

body.corporate-theme h1,
body.corporate-theme h2,
body.corporate-theme #active-users-count {
    text-shadow: none;
}

body.corporate-theme .card {
    background: #2d3748; /* Cinza-azulado um pouco mais claro */
    border-left-color: var(--neon-blue);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.corporate-theme .neon-btn {
    border-color: var(--neon-purple);
    box-shadow: none;
    font-weight: 600;
}

body.corporate-theme footer p {
    animation: none;
}

/* Responsividade para o Painel de Admin */
@media (max-width: 768px) {
    .menu-toggle-btn {
        display: block;
    }

    .container {
        padding: 10px;
        gap: 20px;
    }

    h1 { font-size: 1.8rem; }
    h1 { font-size: 1.8rem; text-align: center; }

    #admin-search-container, #admin-filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar-container {
        position: fixed;
        left: -300px; /* Começa fora da tela */
        top: 0;
        width: 280px;
        height: 100%;
        background: #0a0a0a;
        transition: left 0.4s ease-in-out;
        z-index: 9999;
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    }

    #user-profile {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        justify-content: center;
        height: 100%;
        padding-top: 20px;
    }

    header {
        padding: 20px 10px;
    }

    .card {
        flex-basis: 100%; /* Ocupa a largura total em uma única coluna */
    }

    .neon-btn {
        padding: 12px 15px; /* Aumenta a área de toque para botões */
    }

    .side-menu-open .top-bar-container {
        left: 0; /* Desliza para dentro */
    }
}

/* 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;
    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;
    }
}
