﻿/* ===== CORES BITCHAT ===== */
:root {
    --bitchat-primary: #3b4db8;
    --bitchat-secondary: #2a3a9a;
    --bitchat-light: #5663d1;
    --bitchat-dark: #1f2970;
    --bitchat-green: #28a745;
    --bitchat-yellow: #ffc107;
    --bitchat-orange: #fd7e14;
    --bitchat-red: #dc3545;
}

/* ===== LOGO BITCHAT ===== */
.bitchat-logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    background: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

    .bitchat-logo:hover {
        transform: scale(1.05);
    }

.bitchat-logo-large {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    background: white;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

    .bitchat-logo-large:hover {
        transform: scale(1.02);
    }

.bitchat-logo-medium {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    background: white;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
}

/* Para logos na navbar */
.navbar-brand .bitchat-logo {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

/* Para logos em fundo escuro */
.dark-background .bitchat-logo {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== NAVBAR PERSONALIZADA ===== */
.navbar-bitchat {
    background: linear-gradient(135deg, var(--bitchat-primary) 0%, var(--bitchat-secondary) 100%);
}

/* ===== CARDS DAS FILAS ===== */
.queue-card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 10px;
    border-left: 3px solid;
    height: 140px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

    .queue-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

/* ===== CORES DOS CARDS BASEADAS NAS REGRAS ===== */
.queue-card-green {
    border-left-color: var(--bitchat-green);
    background: linear-gradient(135deg, #ffffff 0%, #e8f5e8 100%);
}

.queue-card-yellow {
    border-left-color: var(--bitchat-yellow);
    background: linear-gradient(135deg, #ffffff 0%, #fff8e1 100%);
}

.queue-card-orange {
    border-left-color: var(--bitchat-orange);
    background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
}

.queue-card-red {
    border-left-color: var(--bitchat-red);
    background: linear-gradient(135deg, #ffffff 0%, #ffebee 100%);
}

.queue-card-red-blinking {
    border-left-color: var(--bitchat-red);
    background: linear-gradient(135deg, #ffffff 0%, #ffebee 100%);
    animation: blink-card 1s infinite;
}

.queue-card-empty {
    border-left-color: #6c757d;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* ===== ANIMAÇÃO DE PISCAR PARA CARDS CRÍTICOS ===== */
@keyframes blink-card {
    0% {
        background: linear-gradient(135deg, #ffffff 0%, #ffebee 100%);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    50% {
        background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
        box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
    }

    100% {
        background: linear-gradient(135deg, #ffffff 0%, #ffebee 100%);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

/* ===== CORPO DOS CARDS ===== */
.queue-card .card-body {
    padding: 8px !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* ===== CONTEÚDO DOS CARDS - EVITAR TEXTO CORTADO ===== */
.queue-name {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 3px;
    margin-left: 28px; /* Espaço suficiente para ícone */
    color: #333;
    height: auto; /* Permitir altura automática */
    max-height: 32px; /* Máximo 2 linhas */
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.queue-message-count {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 3px 0;
    line-height: 1.1;
    text-align: center;
    color: inherit;
}

    .queue-message-count.green {
        color: var(--bitchat-green);
    }

    .queue-message-count.yellow {
        color: #b8860b;
    }

    .queue-message-count.orange {
        color: var(--bitchat-orange);
    }

    .queue-message-count.red {
        color: var(--bitchat-red);
    }

    .queue-message-count.red-blinking {
        color: var(--bitchat-red);
        animation: pulse-critical 2s infinite;
    }

    .queue-message-count.empty {
        color: #6c757d;
    }

.queue-status-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-block;
    max-width: calc(100% - 10px);
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255,255,255,0.9);
    color: #333;
}

.queue-rates {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.1;
}

/* ===== ÍCONE DA FILA NO CARD ===== */
.queue-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.9rem;
    color: rgba(0,0,0,0.7);
    background: rgba(255,255,255,0.9);
    padding: 3px;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* ===== GRUPOS DE FILAS ===== */
.queue-group {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
}

.queue-group-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.queue-group-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    width: 35px;
    text-align: center;
    border-radius: 50%;
    padding: 8px;
    color: white;
}

.queue-group-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.queue-group-count {
    margin-left: auto;
    background: var(--bitchat-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ===== ÍCONES POR CATEGORIA ===== */
.icon-upload {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.icon-contact {
    background: linear-gradient(135deg, #6f42c1, #5a36a3);
}

.icon-email {
    background: linear-gradient(135deg, #fd7e14, #e8650e);
}

.icon-message {
    background: linear-gradient(135deg, #20c997, #1aa179);
}

.icon-webhook {
    background: linear-gradient(135deg, #25d366, #1ebe57);
}

/* ===== SUMMARY CARDS ===== */
.summary-card {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    height: 120px;
    overflow: hidden;
}

    .summary-card h2, .summary-card h3 {
        font-size: 1.8rem;
        margin: 0;
        line-height: 1.1;
    }

    .summary-card .fa-icon-small {
        font-size: 1.2em !important;
    }

    .summary-card .card-body {
        padding: 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

/* ===== ALERT INDICATORS ===== */
.alert-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: blink 1s infinite;
    z-index: 10;
}

    .alert-indicator.critical {
        background-color: var(--bitchat-red);
    }

    .alert-indicator.warning {
        background-color: var(--bitchat-orange);
    }

.problem-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: bold;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 10;
}

/* ===== ESTILOS PARA MONITOR TV ===== */
.monitor-container .queue-card {
    height: 120px;
}

.monitor-container .queue-message-count {
    font-size: 1.5rem;
}

.monitor-container .queue-name {
    font-size: 0.75rem;
}

.monitor-container .queue-status-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
}

/* ===== CORES BITCHAT PARA ELEMENTOS ===== */
.bg-bitchat-primary {
    background-color: var(--bitchat-primary) !important;
}

.bg-bitchat-secondary {
    background-color: var(--bitchat-secondary) !important;
}

.text-bitchat {
    color: var(--bitchat-primary) !important;
}

.btn-bitchat {
    background-color: var(--bitchat-primary);
    border-color: var(--bitchat-primary);
    color: white;
}

    .btn-bitchat:hover {
        background-color: var(--bitchat-secondary);
        border-color: var(--bitchat-secondary);
        color: white;
    }

/* ===== LAYOUT FLEXÍVEL ===== */
.queue-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.queue-stats-row {
    font-size: 0.65rem;
    margin: 2px 0;
}

    .queue-stats-row .row {
        margin: 0;
    }

    .queue-stats-row .col-4 {
        padding: 0 2px;
        text-align: center;
    }

/* ===== UTILITÁRIOS ===== */
.text-nowrap-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-sm th, .table-sm td {
    padding: 0.3rem;
    font-size: 0.85rem;
}

.queue-action-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
}

/* ===== ANIMAÇÕES ===== */
@keyframes pulse-critical {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0.3;
    }
}

.blink {
    animation: blink-animation 2s infinite;
}

@keyframes blink-animation {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0.3;
    }
}

/* ===== ESTADOS DE LOADING ===== */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid #ccc;
        border-top: 2px solid #007bff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== ALERTAS ESTILIZADOS ===== */
.alert-item {
    border-left: 4px solid;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 0 5px 5px 0;
    transition: all 0.3s ease;
}

    .alert-item:hover {
        transform: translateX(5px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    }

.alert-critical {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
}

.alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
}

/* ===== CARDS DE MENSAGENS ===== */
.message-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

    .message-card:hover {
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

.message-error {
    border-left: 4px solid #dc3545;
}

.message-warning {
    border-left: 4px solid #ffc107;
}

.message-normal {
    border-left: 4px solid #28a745;
}

.message-processed {
    border-left: 4px solid #28a745 !important;
}

/* ===== STATUS DAS FILAS ===== */
.queue-status-good {
    color: #28a745;
}

.queue-status-warning {
    color: #ffc107;
}

.queue-status-critical {
    color: #dc3545;
}

/* ===== HOVER EFFECTS ===== */
.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.card:hover {
    transform: translateY(-2px);
}

/* ===== FADE IN ANIMATION ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BADGES E ÍCONES ===== */
.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.time-badge {
    font-size: 0.8em;
}

.ip-badge {
    font-family: monospace;
    font-size: 0.9em;
}

.badge {
    font-size: 0.75em;
}

.nav-tabs .nav-link {
    color: #495057;
}

    .nav-tabs .nav-link.active {
        color: #007bff;
        font-weight: bold;
    }

/* ===== SCROLLBAR CUSTOMIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1400px) {
    .queue-card {
        height: 135px;
    }

    .queue-message-count {
        font-size: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .queue-message-count {
        font-size: 1.4rem;
    }

    .queue-card {
        height: 130px;
    }

    .queue-name {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
        max-height: 16px;
    }
}

@media (max-width: 768px) {
    .queue-message-count {
        font-size: 1.3rem;
    }

    .queue-card {
        height: 125px;
    }

    .queue-name {
        font-size: 0.7rem;
        margin-left: 25px;
    }

    .queue-icon {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .queue-group {
        padding: 10px;
    }

    .queue-group-header {
        margin-bottom: 10px;
    }

    .summary-card h2, .summary-card h3 {
        font-size: 1.5rem;
    }

    .summary-card .fa-icon-small {
        font-size: 1em !important;
    }

    .table-responsive {
        font-size: 0.9rem;
    }
}
