/* Professional Medical Information Display Styling */

.medicalInfo {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 420px;
    max-height: calc(100vh - 100px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Maximized state */
.medicalInfo-maximized {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    width: calc(100% - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    transition: all 0.3s ease;
}

.medicalInfo-maximized .medicalInfo-content {
    max-height: calc(100vh - 120px) !important;
    columns: 2;
    column-gap: 30px;
}

.medicalInfo-maximized .medicalInfo-section {
    break-inside: avoid;
}

.medicalInfo-maximized .medicalInfo-header h2 {
    font-size: 28px;
}

.medicalInfo-maximized .medicalInfo-section h3 {
    font-size: 20px;
}

.medicalInfo-maximized .medicalInfo-section p {
    font-size: 18px;
    line-height: 1.8;
}

/* Smooth transition for normal state */
.medicalInfo {
    transition: all 0.3s ease;
}

.medicalInfo-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #e74c3c;
}

.medicalInfo-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex: 1;
}

.medicalInfo-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.medicalInfo-maximize,
.medicalInfo-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.medicalInfo-close {
    font-size: 28px;
}

.medicalInfo-maximize:hover,
.medicalInfo-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.medicalInfo-close:hover {
    transform: rotate(90deg);
}

.medicalInfo-content {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.medicalInfo-content::-webkit-scrollbar {
    width: 8px;
}

.medicalInfo-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.medicalInfo-content::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.medicalInfo-content::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

.medicalInfo-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.medicalInfo-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.medicalInfo-section h3 {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
}

.medicalInfo-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #3498db;
    margin-right: 10px;
    border-radius: 2px;
}

.medicalInfo-section p {
    color: #4a4a4a;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
    text-align: justify;
}

.medicalInfo-clinical {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffcccb;
    border-bottom: none;
}

.medicalInfo-clinical h3 {
    color: #c0392b;
}

.medicalInfo-clinical h3::before {
    background: #e74c3c;
}

.medicalInfo-clinical p {
    color: #8e2d2d;
}

/* RTL Support for Arabic */
[dir="rtl"] .medicalInfo,
.medicalInfo [lang="ar"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .medicalInfo-section h3::before,
.medicalInfo [lang="ar"] .medicalInfo-section h3::before {
    margin-right: 0;
    margin-left: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .medicalInfo {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        top: 70px;
    }
    
    .medicalInfo-header h2 {
        font-size: 18px;
    }
    
    .medicalInfo-section h3 {
        font-size: 15px;
    }
    
    .medicalInfo-section p {
        font-size: 13px;
    }
}

/* Print styles */
@media print {
    .medicalInfo-close {
        display: none;
    }
    
    .medicalInfo {
        position: static;
        box-shadow: none;
        page-break-inside: avoid;
    }
}
