/* static/css/carica_statistiche.css */

.search-bar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}
.table th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}
.table th:hover {
    background-color: #e9ecef;
}
.table th .sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
}
.table th.active .sort-icon {
    opacity: 1;
    color: #0d6efd;
}
.table th .sort-icon i {
    margin-left: 2px;
}
.no-results {
    padding: 30px;
    text-align: center;
    color: #6c757d;
}
.badge-count {
    font-size: 14px;
    background: #0d6efd;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 10px;
}
.stat-card {
    border-left: 4px solid #0d6efd;
    margin-bottom: 10px;
}
.stat-card .stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #0d6efd;
}
.stat-card .stat-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
}
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* Menu contestuale per tendina tasto destro */
.context-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 5px 0;
    min-width: 220px;
    max-width: 300px;
    z-index: 99999;
    pointer-events: auto;
}
.context-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    background: transparent;
}
.context-menu .menu-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.context-menu .menu-item:hover {
    background: #f0f0f0;
}
.context-menu .menu-item i {
    width: 18px;
    color: #6c757d;
}
.context-menu .menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 10px;
}
.context-menu .menu-sub {
    padding-left: 30px;
    font-size: 12px;
}
.context-menu .menu-item .badge {
    font-size: 10px;
    margin-left: 5px;
}

/* Evidenzia riga al passaggio del mouse */
#statistiche-table tbody tr {
    cursor: context-menu;
}
#statistiche-table tbody tr:hover {
    background-color: #e3f2fd !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-bar .row {
        gap: 8px;
    }
    .search-bar .col-md-3,
    .search-bar .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .stat-card .stat-value {
        font-size: 14px;
    }
    .stat-card .stat-label {
        font-size: 9px;
    }
    .table-responsive {
        max-height: 400px;
    }
    .table th, .table td {
        font-size: 11px;
        padding: 4px 6px;
    }
    .table .badge {
        font-size: 9px !important;
        padding: 1px 5px !important;
    }
    .card-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch !important;
    }
    .card-header .d-flex {
        flex-wrap: wrap;
        justify-content: center;
    }
    .card-header .btn {
        font-size: 12px;
        padding: 4px 8px;
    }
    .context-menu {
        min-width: 180px;
        max-width: 250px;
    }
    .context-menu .menu-item {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 576px) {
    .table {
        font-size: 10px;
    }
    .table th, .table td {
        padding: 2px 4px;
        white-space: nowrap;
    }
    .table .badge {
        font-size: 8px !important;
        padding: 1px 4px !important;
    }
    .stat-card {
        padding: 6px !important;
    }
    .stat-card .stat-value {
        font-size: 12px;
    }
    .stat-card .stat-label {
        font-size: 8px;
    }
    .modal-dialog {
        margin: 10px;
    }
    .modal-body {
        padding: 12px;
    }
}