/* Add here all your CSS customizations */

/* ===== Bootstrap 5 Compatibility ===== */
/* form-group non ha più margin-bottom in BS5 */
.form-group {
    margin-bottom: 1rem;
}
.test-result.form-check-input:disabled ~ .form-check-label {
    opacity: 1 !important;
}

#accordionSubjects .accordion-header {
    margin-top: 0 !important;
}

#accordionSubjects .accordion-item {
    margin-bottom: 20px !important;
}

/* ===== Toggle Sidebar Mobile ===== */
.header .toggle-sidebar-left {
    background: #0088cc !important;
}

.header .toggle-sidebar-left i {
    color: #fff !important;
    font-size: 14px;
    line-height: 30px;
    margin: 0 !important;
}

/* ===== Notifications Dropdown Styles ===== */
.notification-item {
    position: relative;
    transition: background-color 0.2s ease;
}

.notification-item.unread {
    background-color: #f0f8ff !important;
}

.notification-item .mark-read-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.notification-item:hover .mark-read-btn {
    opacity: 1;
}

.notification-item .mark-read-btn:hover {
    color: #47a447;
}

.notification-item a {
    display: block;
    padding-right: 40px; /* Spazio per bottone mark-read */
}

/* ===== Messages Dropdown Styles ===== */
#recent-messages-list li.unread {
    background-color: #e8f4fd !important;
    border-left: 3px solid #0084ff;
}

#recent-messages-list li.unread .title {
    font-weight: 600 !important;
    color: #212529 !important;
}

#recent-messages-list li.unread .message {
    font-weight: 500 !important;
}

/* ===== Responsive Fixes for Tablet/Mobile ===== */

/* Test page - Info bar improvements */
@media (max-width: 991px) {
    .alert strong {
        font-size: 0.9rem;
    }
}

@media (max-width: 575px) {
    .alert strong {
        font-size: 0.8rem;
    }

    /* Improve readability on small screens */
    .form-check-label {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* Better spacing for question text */
    .card-body h5.fw-bold {
        font-size: 1rem;
        line-height: 1.4;
    }

    /* Badge sizing on mobile */
    .badge {
        font-size: 0.75rem;
    }
}

/* Tablet-specific optimizations (iPad) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Better touch targets for radio buttons */
    .form-check {
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }

    .form-check-input {
        width: 1.25em;
        height: 1.25em;
        margin-top: 0.15em;
    }

    .form-check-label {
        padding-left: 0.25rem;
        font-size: 1rem;
    }

    /* Improve card spacing on tablet */
    .card-body {
        padding: 1.5rem;
    }
}

/* Study session buttons responsive */
@media (max-width: 767px) {
    .study-btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .study-btn i {
        margin-right: 6px !important;
    }

    .today-badge {
        font-size: 0.5rem;
        padding: 1px 4px;
        top: -6px;
        right: -6px;
    }
}

/* Dashboard cards responsive */
@media (max-width: 575px) {
    .daily-activity .border.rounded {
        padding: 0.75rem !important;
    }

    .daily-activity .fw-semibold {
        font-size: 0.9rem;
    }

    .daily-activity .badge.fs-6 {
        font-size: 0.85rem !important;
    }
}

/* Charts responsive */
@media (max-width: 767px) {
    canvas {
        max-height: 250px !important;
    }
}

/* Progress bars touch-friendly */
@media (max-width: 991px) {
    .progress {
        height: 10px !important;
    }
}

/* Codice Test - Extra small screens */
@media (max-width: 450px) {
    /* Test in corso - info bar */
    .result-cards code {
        font-size: 0.65rem !important;
        word-break: break-all;
        display: block;
        line-height: 1.3;
    }

    .result-cards .card-body {
        padding: 0.5rem !important;
    }

    .result-cards .h5 {
        font-size: 1rem !important;
    }

    .result-cards .small {
        font-size: 0.65rem !important;
    }

    /* Risultati test - codice test card */
    .border-left-secondary code {
        font-size: 0.6rem !important;
        word-break: break-all;
        line-height: 1.3;
    }

    .border-left-secondary .card-body {
        flex-wrap: wrap;
        justify-content: center;
    }

    .border-left-secondary .card-body span {
        width: 100%;
        text-align: center;
        margin-bottom: 0.25rem;
    }
}

