/* Custom Premium Stylesheet for OPD Medical Formatter */

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f1f5f9;
    color: #0f172a;
}

/* Layout spacing */
.editor-height {
    min-height: 550px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    border-radius: 8px;
    background-color: #fafafa;
    border: 1px solid #cbd5e1;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.editor-height:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Premium Preview Card styling */
.preview-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    min-height: 550px;
    display: flex;
    flex-direction: column;
}

.preview-body {
    padding: 1.5rem;
    flex-grow: 1;
    background-color: #ffffff;
}

/* Spacer for blank lines */
.report-spacer {
    height: 0.5rem;
}

/* List Formatting - Removing round bullets, adding dashes (-) */
.preview-body ul {
    list-style-type: none !important;
    padding-left: 1.25rem !important;
    margin-bottom: 0.5rem;
}

.preview-body ul li {
    position: relative !important;
    list-style-type: none !important;
    padding-left: 0.15rem;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.preview-body ul li::before {
    content: "-" !important;
    position: absolute !important;
    left: -0.85rem;
    color: #475569 !important;
    font-weight: 700 !important;
}

/* Ensure nested lists are indented */
.preview-body ul ul {
    padding-left: 1.5rem !important;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
}

/* Ensure key-value field list items do not have bullets */
.preview-body li.field-item {
    padding-left: 0 !important;
    margin-left: 0 !important;
    list-style: none !important;
}

.preview-body li.field-item::before {
    content: none !important;
}

/* Field lists (key-value mapping) inside clinical cards */
.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed #e2e8f0;
}

.field:last-child {
    border-bottom: none;
}

.field .label {
    font-weight: 600;
    color: #64748b; /* Soft gray label */
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.field .value {
    color: #0f172a; /* Dark charcoal */
    font-size: 0.9rem;
    font-weight: 500;
}

/* OPD Grid Card Styling */
.opd-card {
    border-width: 1px;
    border-style: solid;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.opd-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.opd-card .card-header {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.opd-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* OPD Theme Color Classes */
.card-green {
    border-color: #86efac !important;
    background-color: #f0fdf4 !important;
}
.card-green .card-header {
    background-color: #d1fae5 !important;
    border-bottom-color: #86efac !important;
    color: #166534 !important;
}

.card-pink {
    border-color: #fbcfe8 !important;
    background-color: #fdf2f8 !important;
}
.card-pink .card-header {
    background-color: #fce7f3 !important;
    border-bottom-color: #fbcfe8 !important;
    color: #9d174d !important;
}

.card-orange {
    border-color: #fed7aa !important;
    background-color: #fff7ed !important;
}
.card-orange .card-header {
    background-color: #ffedd5 !important;
    border-bottom-color: #fed7aa !important;
    color: #9a3412 !important;
}

.card-cyan {
    border-color: #a5f3fc !important;
    background-color: #ecfeff !important;
}
.card-cyan .card-header {
    background-color: #cffafe !important;
    border-bottom-color: #a5f3fc !important;
    color: #0369a1 !important;
}

.card-gray {
    border-color: #cbd5e1 !important;
    background-color: #f8fafc !important;
}
.card-gray .card-header {
    background-color: #e2e8f0 !important;
    border-bottom-color: #cbd5e1 !important;
    color: #475569 !important;
}

.card-blue {
    border-color: #bfdbfe !important;
    background-color: #eff6ff !important;
}
.card-blue .card-header {
    background-color: #dbeafe !important;
    border-bottom-color: #bfdbfe !important;
    color: #1e40af !important;
}

/* Demographics Panel (OPD Case Module Header) */
.opd-demographics-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #bfdbfe;
}

.opd-demographics-card .card-header {
    background-color: #1e3a8a !important; /* Rich deep blue */
    color: #ffffff !important;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.demographic-field {
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0.75rem;
    background-color: #ffffff;
    border-radius: 6px;
    border-left: 3.5px solid #2563eb;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    height: 100%;
}

.demographic-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.demographic-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

/* Button & toolbar icons */
.btn-copy-section {
    transition: color 0.2s, transform 0.1s;
}
.btn-copy-section:hover {
    color: #1e293b !important;
    transform: scale(1.1);
}
.btn-copy-section:active {
    transform: scale(0.95);
}

/* Placeholder and Loading indicators */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    height: 100%;
    min-height: 400px;
}

.placeholder-content i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

/* CSS Print Media Styling */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt;
    }
    
    .d-print-none {
        display: none !important;
    }
    
    .container, .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .preview-card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .preview-body {
        padding: 0 !important;
    }

    .opd-card {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1.5rem !important;
    }

    .opd-demographics-card {
        margin-bottom: 1.5rem !important;
        border: 1px solid #000000 !important;
    }

    .opd-demographics-card .card-header {
        background-color: #e2e8f0 !important;
        color: #000000 !important;
        border-bottom: 1px solid #000000 !important;
    }

    .demographic-field {
        border: 1px solid #cbd5e1 !important;
        border-left: 3px solid #000000 !important;
        background-color: #ffffff !important;
    }

    @page {
        size: letter;
        margin: 1cm;
    }
}
