/* =====================================================
   CSS IMPROVEMENTS - Discord Bot Hosting
   Miglioramenti per accessibilità, contrasto e UX
   ===================================================== */

/* =====================================================
   1. MIGLIORAMENTI GENERALI ACCESSIBILITÀ
   ===================================================== */

/* Focus outline migliorato per accessibilità */
*:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25) !important;
}

/* Rimozione outline solo per mouse, mantenimento per tastiera */
*:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

/* =====================================================
   2. CORREZIONI CONTRASTO TESTO
   ===================================================== */

/* Assicura contrasto minimo per testo su sfondi chiari */
.text-muted {
    color: #495057 !important; /* Più scuro del default Bootstrap */
}

/* Miglioramento contrasto per link */
a.text-muted:hover,
a.text-muted:focus {
    color: #212529 !important;
}

/* Placeholder con contrasto migliorato */
::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* =====================================================
   3. MIGLIORAMENTI FORM E INPUT
   ===================================================== */

/* Stati di validazione più visibili */
.form-control:invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-control:valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Label più visibili */
.form-label {
    font-weight: 600 !important;
    color: #212529 !important;
    margin-bottom: 0.5rem !important;
}

/* =====================================================
   4. MIGLIORAMENTI BOTTONI
   ===================================================== */

/* Stati hover più evidenti */
.btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease !important;
}

/* Bottoni disabilitati più chiari */
.btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* =====================================================
   5. MIGLIORAMENTI ALERT E NOTIFICHE
   ===================================================== */

/* Alert con bordi più definiti */
.alert {
    border-width: 2px !important;
    border-style: solid !important;
    font-weight: 500 !important;
}

.alert-success {
    background-color: #d1f2eb !important;
    border-color: #28a745 !important;
    color: #155724 !important;
}

.alert-danger {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
    color: #721c24 !important;
}

.alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
    color: #856404 !important;
}

.alert-info {
    background-color: #d1ecf1 !important;
    border-color: #17a2b8 !important;
    color: #0c5460 !important;
}

/* =====================================================
   6. MIGLIORAMENTI TABELLE
   ===================================================== */

/* Tabelle più leggibili */
.table {
    font-size: 0.95rem !important;
}

.table th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
    font-weight: 600 !important;
    color: #495057 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa !important;
}

.table-hover tbody tr:hover {
    background-color: #e9ecef !important;
}

/* =====================================================
   7. MIGLIORAMENTI CARD E CONTENITORI
   ===================================================== */

/* Card con ombre più definite */
.card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    border: 1px solid #dee2e6 !important;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
    transition: box-shadow 0.3s ease !important;
}

/* Header card più definiti */
.card-header {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
    font-weight: 600 !important;
}

/* =====================================================
   8. MIGLIORAMENTI BADGE E STATUS
   ===================================================== */

/* Badge con contrasto migliorato */
.badge {
    font-weight: 600 !important;
    font-size: 0.8em !important;
    padding: 0.4em 0.8em !important;
}

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

/* Status indicators più visibili */
.status-indicator {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    margin-right: 8px !important;
    border: 2px solid white !important;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1) !important;
}

.status-online {
    background-color: #28a745 !important;
}

.status-offline {
    background-color: #dc3545 !important;
}

.status-warning {
    background-color: #ffc107 !important;
}

.status-pending {
    background-color: #6c757d !important;
}

/* =====================================================
   9. MIGLIORAMENTI RESPONSIVE
   ===================================================== */

/* Testo più leggibile su mobile */
@media (max-width: 768px) {
    body {
        font-size: 16px !important; /* Previene zoom su iOS */
    }
    
    .btn {
        min-height: 44px !important; /* Touch target minimo */
        padding: 12px 16px !important;
    }
    
    .form-control {
        min-height: 44px !important;
        font-size: 16px !important; /* Previene zoom su iOS */
    }
    
    .card {
        margin-bottom: 1rem !important;
    }
}

/* =====================================================
   10. MIGLIORAMENTI SIDEBAR E NAVIGAZIONE
   ===================================================== */

/* Sidebar con contrasto migliorato */
.sidebar .nav-link {
    color: #495057 !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    margin: 2px 0 !important;
    transition: all 0.2s ease !important;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef !important;
    color: #0d6efd !important;
    transform: translateX(4px) !important;
}

.sidebar .nav-link.active {
    background-color: #0d6efd !important;
    color: white !important;
    font-weight: 600 !important;
}

.sidebar .nav-link i {
    width: 20px !important;
    text-align: center !important;
    margin-right: 10px !important;
}

/* =====================================================
   11. MIGLIORAMENTI LOADING E SPINNER
   ===================================================== */

/* Spinner più visibili */
.spinner-border {
    border-width: 3px !important;
}

.spinner-border-sm {
    width: 1.5rem !important;
    height: 1.5rem !important;
    border-width: 2px !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

/* =====================================================
   12. MIGLIORAMENTI PROGRESS BAR
   ===================================================== */

/* Progress bar più visibili */
.progress {
    height: 12px !important;
    border-radius: 6px !important;
    background-color: #e9ecef !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
}

.progress-bar {
    border-radius: 6px !important;
    transition: width 0.6s ease !important;
}

/* Resource bars specifiche */
.resource-bar {
    height: 8px !important;
    border-radius: 4px !important;
    background-color: #e9ecef !important;
    overflow: hidden !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
}

.resource-fill {
    height: 100% !important;
    border-radius: 4px !important;
    transition: width 0.3s ease !important;
}

.resource-fill.cpu {
    background: linear-gradient(90deg, #28a745 0%, #ffc107 70%, #dc3545 100%) !important;
}

.resource-fill.memory {
    background: linear-gradient(90deg, #17a2b8 0%, #6f42c1 100%) !important;
}

.resource-fill.storage {
    background: linear-gradient(90deg, #fd7e14 0%, #e83e8c 100%) !important;
}

/* =====================================================
   13. MIGLIORAMENTI DARK MODE SUPPORT
   ===================================================== */

/* Preparazione per dark mode futuro */
@media (prefers-color-scheme: dark) {
    /* Mantenere colori attuali per ora, ma preparare struttura */
    :root {
        --bs-body-bg: #ffffff;
        --bs-body-color: #212529;
    }
}

/* =====================================================
   14. MIGLIORAMENTI PRINT
   ===================================================== */

/* Stili per stampa */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
    }
}

/* =====================================================
   15. UTILITY CLASSES AGGIUNTIVE
   ===================================================== */

/* Utility per accessibilità */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link per navigazione da tastiera */
.skip-link {
    position: absolute !important;
    top: -40px !important;
    left: 6px !important;
    background: #000 !important;
    color: #fff !important;
    padding: 8px !important;
    text-decoration: none !important;
    z-index: 10000 !important;
}

.skip-link:focus {
    top: 6px !important;
}

/* Animazioni ridotte per utenti che le preferiscono */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

