/* report.css - Styles for the Doctor Report Interface */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f8fafc;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e0e6ed;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e0e6ed;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.consultation-list {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.consultation-list h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consultation-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.consultation-item {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.consultation-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.consultation-item.active {
    border-color: #3498db;
    background: #f0f9ff;
}

.consultation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.consultation-id {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.consultation-priority {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-high {
    background: #e74c3c;
    color: white;
}

.priority-medium {
    background: #f39c12;
    color: white;
}

.priority-low {
    background: #2ecc71;
    color: white;
}

.consultation-patient {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.consultation-symptoms {
    color: #7f8c8d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.consultation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
}

.report-header {
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.report-header-left h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.report-header-left p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.report-actions {
    display: flex;
    gap: 12px;
}

.language-select {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 6px 10px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 0.9rem;
}

.rtl {
    direction: rtl;
}

.report-btn {
    background: white;
    border: 1px solid #e0e6ed;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.report-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.report-btn.primary {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.report-btn.primary:hover {
    background: #2980b9;
}

.report-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Report Sections */
.report-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e6ed;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f8f9fa;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.section-action-btn {
    background: white;
    border: 1px solid #e0e6ed;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.section-action-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

/* Patient Info */
.patient-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.info-card h4 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.info-card p {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Symptoms & History */
.symptoms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.symptom-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.symptom-text {
    color: #2c3e50;
    font-weight: 500;
}

.symptom-severity {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.severity-high {
    background: #e74c3c;
    color: white;
}
.severity-medium {
    background: #f39c12;
    color: white;
}
.severity-low {
    background: #2ecc71;
    color: white;
}

/* AI Diagnosis */
.diagnosis-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e3f2fd 100%);
    border: 1px solid #bbdefb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.diagnosis-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.diagnosis-header h4 {
    color: #1565c0;
    font-size: 1.1rem;
}

.diagnosis-confidence {
    background: #1565c0;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.diagnosis-description {
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 12px;
}

.diagnosis-recommendations {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #1565c0;
}

.diagnosis-recommendations h5 {
    color: #1565c0;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.recommendation-list {
    list-style: none;
    padding-left: 0;
}

.recommendation-list li {
    padding: 6px 0;
    color: #2c3e50;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.recommendation-list li:before {
    content: "•";
    color: #1565c0;
    font-weight: bold;
}

/* Reference Materials */
.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.reference-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e0e6ed;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reference-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}

.reference-icon {
    color: #3498db;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.reference-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.reference-description {
    color: #7f8c8d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Medical Images */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.image-type-section {
    margin-bottom: 30px;
}

.image-type-section:last-child {
    margin-bottom: 0;
}

.image-type-section h4 {
    margin: 24px 0 16px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.image-type-section h4 i {
    color: #3498db;
    font-size: 1rem;
}

.image-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e0e6ed;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.image-card:hover {
    border-color: #3498db;
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.image-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    color: #3498db;
    font-size: 2.5rem;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview.has-thumb {
    padding: 0;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-info {
    flex: 1;
}

.image-filename {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-type {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.image-caption {
    color: #546e7a;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.image-confidence {
    color: #2ecc71;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.image-confidence:before {
    content: "✓";
    font-weight: bold;
}

/* Image Action Buttons */
.image-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.image-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.image-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.image-action-btn.view-btn {
    background: #3498db;
    color: white;
}

.image-action-btn.view-btn:hover:not(:disabled) {
    background: #2980b9;
}

.image-action-btn.analyze-btn {
    background: #27ae60;
    color: white;
}

.image-action-btn.analyze-btn:hover:not(:disabled) {
    background: #219653;
}

.image-action-btn.analysis-btn {
    background: #6c5ce7;
    color: white;
}

.image-action-btn.analysis-btn:hover:not(:disabled) {
    background: #5b4cd6;
}

.analysis-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.analysis-modal.open {
    display: flex;
}

.analysis-modal-content {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.analysis-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.analysis-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f2937;
}

.analysis-modal-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
}

.analysis-modal-body {
    padding: 20px 22px 24px 22px;
    overflow-y: auto;
}

.analysis-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 16px;
}

.analysis-text {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 14px 16px;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}

.analysis-text h1,
.analysis-text h2,
.analysis-text h3 {
    margin: 12px 0 8px;
    color: #0f172a;
}

.analysis-text ul,
.analysis-text ol {
    margin: 8px 0 8px 18px;
}

.analysis-text code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
    font-size: 0.9em;
}

.analysis-text pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px 14px;
    border-radius: 10px;
    overflow-x: auto;
}

.references-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.references-modal.open {
    display: flex;
}

.references-modal-content {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.references-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.references-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f2937;
}

.references-modal-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
}

.references-modal-body {
    padding: 20px 22px 24px 22px;
}

.references-list {
    display: grid;
    gap: 14px;
}

.references-item {
    border: 1px solid #e6edf5;
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8fbff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.references-item-title {
    font-weight: 600;
    color: #1f2d3d;
    font-size: 0.98rem;
    line-height: 1.3;
}

.references-item-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.references-item-excerpt {
    margin-top: 10px;
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.references-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.references-empty {
    text-align: center;
    color: #7f8c8d;
    padding: 30px 0;
}

/* Doctor Assessment */
.assessment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.form-group textarea {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group select {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.submit-assessment {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    margin-top: 10px;
}

.submit-assessment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: #d5f4e6;
    color: #27ae60;
}

.status-inactive {
    background: #ffeaea;
    color: #e74c3c;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

html[dir="rtl"] .toast-container {
    right: auto;
    left: 24px;
}

.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #1f2a37;
    background: #f8fafc;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: #fff7ed;
}

.toast-error {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e0e6ed;
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

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