/**
 * Styles for local_disciplinefilter plugin
 *
 * @package    local_disciplinefilter
 * @copyright  2025 Your Name
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/* Pulsante Filtra per Disciplina */
.discipline-filter-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.discipline-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 20px;
    padding: 0 5px;
    display: none;
}

/* Pannello filtro discipline */
.discipline-filter-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.discipline-filter-panel.active {
    right: 0;
}

/* Header pannello */
.discipline-filter-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.discipline-filter-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.discipline-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s;
}

.discipline-close:hover {
    color: #000;
}

/* Body pannello */
.discipline-filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.discipline-search {
    margin-bottom: 15px;
}

.discipline-search-input {
    width: 100%;
}

/* Lista discipline */
.discipline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.discipline-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.discipline-list li:last-child {
    border-bottom: none;
}

.discipline-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.discipline-checkbox {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.discipline-name {
    flex: 1;
    font-size: 14px;
}

.discipline-count {
    color: #999;
    font-size: 13px;
    margin-left: 8px;
}

/* Footer pannello */
.discipline-filter-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

.discipline-filter-footer button {
    width: 100%;
}

/* Overlay */
.discipline-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.discipline-filter-overlay.active {
    display: block;
    opacity: 1;
}

/* Scrollbar personalizzata */
.discipline-filter-body::-webkit-scrollbar {
    width: 8px;
}

.discipline-filter-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.discipline-filter-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.discipline-filter-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Stati hover */
.discipline-list label:hover {
    background-color: #f8f9fa;
    padding-left: 5px;
    margin-left: -5px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .discipline-filter-panel {
        width: 100%;
        right: -100%;
    }

    .discipline-filter-header h3 {
        font-size: 1.1rem;
    }

    .discipline-filter-button {
        font-size: 14px;
        padding: 8px 12px;
    }

    .discipline-filter-button i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .discipline-filter-button {
        padding: 6px 10px;
    }

    .discipline-filter-header {
        padding: 15px;
    }

    .discipline-filter-body {
        padding: 15px;
    }

    .discipline-filter-footer {
        padding: 15px;
    }
}

/* Stato loading */
.courses-container-inner.loading {
    position: relative;
    min-height: 300px;
    opacity: 0.5;
    pointer-events: none;
}

.courses-container-inner.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Stili titoli sezioni risultati */
.discipline-filter-section {
    margin-bottom: 40px;
}

.discipline-filter-section .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #3498db;
    position: relative;
}

.discipline-filter-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: #e74c3c;
}

/* Sezione professioni sanitarie con stile distinto */
.discipline-health-section .section-title {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.discipline-health-section .section-title::after {
    background: #2ecc71;
}

/* Responsive titoli */
@media (max-width: 768px) {
    .discipline-filter-section .section-title {
        font-size: 1.25rem;
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .discipline-filter-section .section-title {
        font-size: 1.1rem;
        padding-bottom: 8px;
    }
}
