/* ========================================
   STILE MINIMO - SOLO FUNZIONALITÀ ESSENZIALI
   ======================================== */

/* Stili essenziali per funzionalità base */
.feature-item {
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    margin-bottom: 0.5rem;
}

.feature-item i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.feature-item small {
    font-weight: 500;
}

/* Stili per tracce duplicate */
.duplicate-track {
    border-left: 4px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.duplicate-track .track-item {
    border: 1px solid #dc3545;
    border-radius: 8px;
}

/* Stili per duplicati sospetti */
.suspicious-duplicate-track {
    border-left: 4px solid #ffc107;
    background-color: rgba(255, 193, 7, 0.05);
}

.suspicious-duplicate-track .track-item {
    border: 1px solid #ffc107;
    border-radius: 8px;
}

.problematic-track {
    margin-bottom: 8px;
}

.duplicate-badge {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.problematic-track {
    order: -1;
}

/* Stili per log e indicatori */
.log-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
}

.log-entry {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    border-left: 4px solid #dee2e6;
}

.log-entry.log-success {
    background-color: #d1e7dd;
    border-left-color: #198754;
}

.log-entry.log-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.log-entry.log-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

.log-entry.log-info {
    background-color: #d1ecf1;
    border-left-color: #0dcaf0;
}

.log-timestamp {
    font-size: 0.875rem;
    color: #6c757d;
    margin-right: 0.5rem;
}

.log-message {
    font-weight: 500;
}

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.connection-status, .sync-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.connection-status.online {
    background-color: #d1e7dd;
    color: #0f5132;
}

.connection-status.offline {
    background-color: #f8d7da;
    color: #721c24;
}

.sync-status.success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.sync-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.settings-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #1DB954;
}

.settings-section h3 {
    color: #1DB954;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-check {
    margin-bottom: 15px;
}

.form-check-input:checked {
    background-color: #1DB954;
    border-color: #1DB954;
}

.btn-save {
    background-color: #1DB954;
    border-color: #1DB954;
    padding: 10px 30px;
    font-weight: 600;
}

.btn-save:hover {
    background-color: #1ed760;
    border-color: #1ed760;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

.alert {
    border-radius: 10px;
    border: none;
}

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0 !important;
}

.btn-group .btn {
    margin-right: 5px;
    margin-bottom: 5px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* ========================================
   MEDIA QUERIES - OTTIMIZZAZIONE MOBILE
   ======================================== */

/* Tablet e dispositivi medi (max 768px) */
@media (max-width: 768px) {
    /* Sidebar nascosta di default su mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 250px;
        z-index: 1040;
        transition: left 0.3s ease;
        background-color: #f8f9fa;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .sidebar.show {
        left: 0;
    }

    /* Main content occupa tutta la larghezza su mobile */
    .col-md-9.ms-sm-auto {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Settings section - padding ridotto */
    .settings-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    /* Card - padding ridotto */
    .card {
        margin-bottom: 15px;
    }

    .card-header, .card-body {
        padding: 12px;
    }

    /* Bottoni - dimensioni ottimizzate */
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .btn-group .btn {
        margin-bottom: 8px;
    }
}

/* Smartphone (max 576px) */
@media (max-width: 576px) {
    /* Font-size ridotto per mobile */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Logo ridotto su mobile */
    .sidebar .nav-item img {
        max-width: 120px;
        margin: 0 auto;
        display: block;
    }

    /* Settings - spaziature ridotte */
    .settings-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .settings-section h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    /* Form controls - altezza ridotta */
    .form-control, .form-select {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Alert - padding ridotto */
    .alert {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* Loading indicator - dimensioni ridotte */
    .loading-indicator {
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* Log container - altezza ridotta */
    .log-container {
        max-height: 200px;
        padding: 0.75rem;
    }

    .log-entry {
        padding: 0.375rem;
        margin-bottom: 0.375rem;
        font-size: 0.875rem;
    }

    /* Modal - fullscreen su mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
    }

    /* Pulsanti stack verticalmente su mobile molto piccolo */
    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
        margin-right: 0;
    }

    /* Tabelle responsive */
    .table-responsive {
        font-size: 0.85rem;
    }

    /* Padding container ridotto */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Hamburger Menu Button (da aggiungere via JS) */
.mobile-menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1050;
    background-color: #1DB954;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mobile-menu-toggle:hover {
    background-color: #1ed760;
}

/* Overlay per chiudere sidebar su mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1030;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Nascondi hamburger menu su desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle,
    .sidebar-overlay {
        display: none !important;
    }
}
