body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.metric-card {
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.metric-title {
    font-size: 14px;
    opacity: 0.9;
}

.tab-content {
    background: white;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.dashboard-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.btn-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    margin: 0 5px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-database {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-database:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.diagnostico-box {
    background: #f8f9fa;
    border-left: 4px solid #2563eb;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    line-height: 1.6;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 40px;
}

.error-message {
    display: none;
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #c00;
}

.success-message {
    display: none;
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #155724;
}

.result-section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.dataTables_wrapper {
    margin-top: 20px;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online { background-color: #28a745; }
.status-offline { background-color: #dc3545; }
.status-loading { background-color: #ffc107; }

.db-info-card {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.db-info-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.db-info-label {
    font-size: 12px;
    opacity: 0.9;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-connected {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-disconnected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.modal-database .modal-content {
    border-radius: 15px;
}

.modal-database .modal-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.database-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 20px;
}

.stat-item {
    flex: 1;
    padding: 10px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #1e3c72;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.debug-panel {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 9999;
}

.debug-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
}

.table td, .table th {
    padding: 12px 15px !important;
}

.dataTable {
    width: 100% !important;
}

/* ESTILOS CRÍTICOS PARA TABELAS */
.table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

.table thead {
    display: table-header-group !important;
    background-color: #f8f9fa;
}

.table tbody {
    display: table-row-group !important;
}

.table tr {
    display: table-row !important;
}

.table th,
.table td {
    display: table-cell !important;
    padding: 12px 15px !important;
    border: 1px solid #dee2e6 !important;
    vertical-align: middle !important;
}

/* Forçar visibilidade das tabelas */
#tabelaPicoHora,
#tabelaPicoSemana,
#tabelaReplays,
#tabelaRankingPercentual,
#tabelaPicoPorQuadra,
#tabelaDiasPicoPorQuadra,
#tabelaRankingClubes {
    display: table !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Garantir que DataTables funcione */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 10px 0;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

/* Estilo específico para tabelas em containers */
.chart-container .table {
    margin-bottom: 0;
}



/*CHATBOT*/

/* Chat Bot Styles */
.chatbot-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
}

.chatbot-container.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h6 {
    margin: 0;
    font-weight: 600;
}

.chatbot-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chatbot-input {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background: white;
    border-radius: 0 0 12px 12px;
}

.message {
    margin-bottom: 12px;
    max-width: 85%;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.user-message {
    margin-left: auto;
}

.user-message .message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message {
    margin-right: auto;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #dee2e6;
    border-bottom-left-radius: 5px;
}

.chatbot-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    transition: all 0.3s ease;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 12px;
    border-bottom-left-radius: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100% - 40px);
        height: 70vh;
        right: 20px;
        bottom: 90px;
    }
}

/* Estilos para o chat melhorado */
.message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Botões de ação no chat */
.chatbot-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Destaque para números importantes */
.highlight-number {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    color: #856404;
}

/* Status do banco no chat */
.chatbot-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

.status-connected {
    background: #d1e7dd;
    color: #0f5132;
}

.status-disconnected {
    background: #f8d7da;
    color: #842029;
}