/**
 * Admin Dashboard CSS - Pace Pro
 * Estilos customizados para o dashboard administrativo
 */

/* ========================================
   FILTROS DE PERÍODO
   ======================================== */

.periodo-btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.periodo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.periodo-btn.active {
    background-color: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
}

#btn-custom-period {
    transition: all 0.3s ease;
}

#btn-custom-period:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* ========================================
   SMALL BOXES (KPIs)
   ======================================== */

.small-box {
    transition: all 0.3s ease;
}

.small-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.small-box .icon {
    transition: all 0.3s ease;
}

.small-box:hover .icon {
    font-size: 100px;
}

.small-box h3 {
    font-weight: 700;
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   INFO BOXES (ENGAJAMENTO)
   ======================================== */

.info-box {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.info-box:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.info-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-box-number {
    font-size: 2rem;
    font-weight: 700;
}

.info-box .progress {
    height: 4px;
    margin-top: 8px;
    background-color: rgba(255,255,255,0.3);
}

.info-box .progress-bar {
    background-color: rgba(255,255,255,0.8);
}

/* ========================================
   CARDS E GRÁFICOS
   ======================================== */

.card {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.card-header .card-title {
    margin: 0;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Canvas para gráficos */
canvas {
    max-height: 400px;
    cursor: pointer;
}

canvas:hover {
    opacity: 0.95;
}

/* ========================================
   TABELAS
   ======================================== */

.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.badge {
    padding: 0.4em 0.6em;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ========================================
   BADGES DE RANKING
   ======================================== */

.badge-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
    box-shadow: 0 2px 4px rgba(255,193,7,0.3);
}

.badge-secondary {
    background-color: #6c757d !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(108,117,125,0.3);
}

.badge-dark {
    background-color: #343a40 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(52,58,64,0.3);
}

.badge-light {
    background-color: #e9ecef !important;
    color: #495057 !important;
    border: 1px solid #dee2e6;
}

/* ========================================
   MODAL
   ======================================== */

.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background-color: #007bff;
    color: white;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-footer {
    border-top: 2px solid #dee2e6;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */

.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* ========================================
   BREADCRUMB
   ======================================== */

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ========================================
   SCROLLBAR CUSTOMIZADA
   ======================================== */

.card-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    .small-box h3 {
        font-size: 1.8rem;
    }

    .small-box p {
        font-size: 0.9rem;
    }

    .info-box-number {
        font-size: 1.5rem;
    }

    .periodo-btn {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }

    canvas {
        max-height: 300px;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .small-box .icon {
        font-size: 60px;
    }

    .small-box:hover .icon {
        font-size: 65px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .periodo-btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .table {
        font-size: 0.85rem;
    }
}

/* ========================================
   ANIMAÇÕES E TRANSIÇÕES
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

/* ========================================
   ESTADOS DE LOADING
   ======================================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0.5rem;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .small-box,
    .info-box,
    .card {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .btn,
    .card-tools,
    .breadcrumb,
    #btn-custom-period,
    .periodo-btn {
        display: none !important;
    }

    .card-header {
        background-color: white !important;
        border-bottom: 2px solid #000 !important;
    }

    canvas {
        max-height: none !important;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

.text-muted {
    color: #6c757d !important;
}

.cursor-pointer {
    cursor: pointer;
}

.no-data-message {
    padding: 3rem;
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Dark mode support (se implementado no futuro) */
@media (prefers-color-scheme: dark) {
    /* Implementar estilos dark mode aqui */
}
