/* WrittenReportsSection Component Styles */

.written-reports-section {
    margin-top: 1.5rem;
    padding: 0;
}

.written-reports-header {
    margin-bottom: 1rem;
}

.written-reports-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.written-reports-title-row h3 {
    color: #372562;
    font-size: 1.1rem;
    font-weight: 700;
    font-weight: 600;
}

.written-reports-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Template Dropdown */
.report-template-dropdown {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 200px;
}

.report-template-dropdown:focus {
    outline: none;
    border-color: #ec5f59;
}

/* Loading State */
.written-reports-loading {
    text-align: center;
    padding: 1.5rem;
    color: #666;
}

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

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

.written-reports-loading p {
    margin: 0;
    font-size: 0.85rem;
}

/* Error State */
.written-reports-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #fee2e2;
    color: #dc2626;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.written-reports-section .btn-retry {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.written-reports-section .btn-retry:hover {
    background: #b91c1c;
}

/* Reports List */
.written-reports-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.report-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.report-row:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.report-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.report-type-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.report-version-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e8ecf1;
    color: #4a6fa5;
    border-radius: 10px;
    white-space: nowrap;
}

.report-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: capitalize;
}

.report-status-badge.status-draft {
    background: #e5e7eb;
    color: #4b5563;
}

.report-status-badge.status-submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.report-status-badge.status-returned {
    background: #fef3c7;
    color: #b45309;
}

.report-status-badge.status-approved {
    background: #d1fae5;
    color: #047857;
}

.report-dates {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.report-date {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}

/* Empty State */
.written-reports-empty {
    text-align: center;
    padding: 1.5rem;
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

.written-reports-empty p {
    margin: 0;
}

/* Section Selection Modal */
.section-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.section-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-modal-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-modal-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.section-modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.section-modal-close-btn:hover {
    opacity: 1;
}

.section-modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.section-modal-instructions {
    font-size: 0.85rem;
    color: #555;
    margin: 0 0 0.75rem 0;
}

.section-select-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-select-all,
.btn-deselect-all {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9fafb;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-select-all:hover,
.btn-deselect-all:hover {
    background: #e5e7eb;
}

.section-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.section-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    transition: background 0.15s;
}

.section-checkbox-label:hover {
    background: #f3f4f6;
}

.section-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ec5f59;
}

.section-modal-footer {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.written-reports-section .btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.section-modal-footer .btn-cancel {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    background: #e5e7eb;
    color: #374151;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.section-modal-footer .btn-cancel:hover {
    background: #d1d5db;
}

.section-modal-footer .btn-continue {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.section-modal-footer .btn-continue:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.section-modal-footer .btn-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .written-reports-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .written-reports-controls {
        width: 100%;
    }

    .report-template-dropdown {
        flex: 1;
        width: 100%;
    }

    .report-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .report-dates {
        width: 100%;
        justify-content: flex-start;
    }
}
