/* ========================================
   FB Orders - Custom Styles
   Responsive Design inspired by CrewManager
   ======================================== */

/* === VARIABILI COLORE === */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* === GENERAL === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* === NAVBAR === */
.navbar-brand {
    font-size: 1.25rem;
}

.navbar .nav-link.active {
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 0.375rem;
}

/* === SIDEBAR/OFFCANVAS === */
.offcanvas {
    width: 280px !important;
}

.offcanvas-body .nav-link {
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    margin: 0.25rem 0.5rem;
}

.offcanvas-body .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.offcanvas-body .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.offcanvas-body .nav-link i {
    font-size: 1.1rem;
}

/* === CARDS === */
.card {
    border-radius: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

/* === BUTTONS === */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* === TABLES === */
.table-responsive {
    border-radius: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* === FORMS === */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.625rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* === BADGES === */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* === ALERTS === */
.alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 991.98px) {
    .offcanvas {
        width: 280px !important;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* === CUSTOM UTILITIES === */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* === LOADING SPINNER === */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* === STATUS BADGES === */
.status-bozza {
    background-color: #6c757d;
}

.status-inviato {
    background-color: #0dcaf0;
}

.status-ricevuto {
    background-color: #fd7e14;
}

.status-chiuso {
    background-color: #198754;
}

/* === DIFFERENZE ORDINI (per registra consegna) === */
.diff-positiva {
    color: #fd7e14;
    font-weight: 600;
}

.diff-negativa {
    color: #dc3545;
    font-weight: 600;
}

.diff-ok {
    color: #198754;
}

/* === SCROLLBAR CUSTOM (optional) === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* === CLICKABLE ROWS ===
   Righe di tabella navigabili al click. Vedi modulo "Clickable Rows" in
   static/js/main.js. Uso: <tr class="clickable-row" data-href="..."> */
.clickable-row {
    cursor: pointer;
}
