/* InterventionsSection Component Styles */

.interventions-section {
    padding: 0;
    color: #372562;
}

.interventions-header {
    margin-bottom: 1rem;
}

.interventions-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #372562;
}

/* Loading State */
.interventions-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.interventions-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #97c1bc;
    border-radius: 50%;
    animation: interventions-spin 1s linear infinite;
    margin: 0 auto 0.75rem;
}

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

.interventions-loading p {
    margin: 0;
    font-size: 0.85rem;
    color: #372562;
}

/* Error State */
.interventions-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

/* Success State */
.interventions-success {
    background: #d4edda;
    color: #155724;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

/* Checkbox List */
.interventions-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.intervention-item {
    border: 1px solid #C8DDD8;
    border-radius: 8px;
    padding: 0.75rem;
    background: #F0F7F5;
    transition: border-color 0.2s, background 0.2s;
}

.intervention-item:has(input[type="checkbox"]:checked) {
    border-color: #372562;
    background: #F0F7F5;
}

.intervention-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #372562;
}

.intervention-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #372562;
}

.intervention-checkbox-label input[type="checkbox"]:disabled {
    cursor: default;
    opacity: 0.6;
}

/* Other name field */
.other-name-field {
    margin-top: 0.5rem;
    padding-left: 1.8rem;
}

.other-name-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #372562;
    margin-bottom: 0.25rem;
}

.other-name-field input {
    width: 100%;
    max-width: 300px;
    padding: 0.4rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #372562;
}

.other-name-field input:disabled {
    background: #F0F7F5;
    cursor: default;
}

/* Detail fields */
.intervention-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #C8DDD8;
}

.detail-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-field-wide {
    grid-column: 1 / -1;
}

.detail-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #372562;
}

.detail-field input {
    padding: 0.4rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #372562;
}

.detail-field input:disabled {
    background: #F0F7F5;
    cursor: default;
}

.detail-field input:focus {
    outline: none;
    border-color: #372562;
    box-shadow: 0 0 0 2px rgba(232, 114, 106, 0.15);
}

/* Validation error */
.field-error {
    font-size: 0.75rem;
    color: #dc2626;
    font-weight: 500;
}

/* File uploads */
.file-uploads-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.file-upload-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.file-upload-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #372562;
}

.file-upload-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.download-link {
    font-size: 0.8rem;
    color: #372562;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-block;
}

.download-link:hover {
    text-decoration: underline;
    color: #7c3aed;
}

.upload-btn-wrapper {
    position: relative;
    display: inline-block;
}

.upload-btn-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-btn-wrapper input[type="file"]:disabled {
    cursor: default;
}

.btn-upload {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    background: #F0F7F5;
    color: #372562;
    border: 1px solid #C8DDD8;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-upload:hover:not(:disabled) {
    background: #A8C9C0;
}

.btn-upload:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Save button footer */
.interventions-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.interventions-section .btn-save {
    padding: 0.5rem 1.5rem;
    border: none;
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s, transform 0.2s;
}

.interventions-section .btn-save:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.interventions-section .btn-save:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* Assessment Groups */
.assessment-groups-section { margin-top: 0.75rem; }
.assessment-groups-header { display: flex; align-items: center; margin-bottom: 0.5rem; }
.add-group-form { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.add-group-input { padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.82rem; font-family: inherit; }
.no-groups-msg { font-size: 0.8rem; color: #999; font-style: italic; padding: 0.25rem 0; }

.group-accordion { border: 1px solid #ddd; border-radius: 6px; margin-bottom: 0.4rem; overflow: hidden; }
.group-accordion-header { display: flex; align-items: center; gap: 0.4rem; padding: 8px 12px; background: #F0F7F5; cursor: pointer; font-size: 0.82rem; color: #372562; }
.group-accordion-header:hover { background: #e4f0ec; }
.group-expand-icon { font-size: 0.7rem; width: 14px; }
.group-name { font-weight: 600; }
.group-subtype { color: #7c3aed; font-size: 0.75rem; }
.group-pupil-count { margin-left: auto; color: #888; font-size: 0.75rem; }
.group-delete-btn { background: none; border: none; color: #c62828; font-size: 1.1rem; cursor: pointer; padding: 0 4px; margin-left: 4px; line-height: 1; }
.group-delete-btn:hover { color: #b71c1c; }
.group-accordion-body { padding: 8px 12px; border-top: 1px solid #ddd; }

.legacy-files { margin-top: 0.5rem; }

/* Responsive */
@media (max-width: 600px) {
    .detail-fields-grid {
        grid-template-columns: 1fr;
    }

    .file-uploads-row {
        grid-template-columns: 1fr;
    }

    .detail-field-wide {
        grid-column: 1;
    }
}
