/* =============================================
   MODERN CLINICAL TRIAL REPORT CSS
   ============================================= */

html {
    scroll-behavior: smooth;
}

/* Main Title (Page Header) */
.mainTitle {
    color: #003366;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #0066cc;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-gap: 0;
    align-items: start;
    width: 100%;
}

/* Section Subheadings */
.ctSubHeading {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 0.5rem;
}

.report-label {
    padding-right: 8px;
}

/* Brief Title */
.brief-title {
    color: #1e293b;
    font-size: 1.375rem;
    font-weight: 600;
    font-style: normal;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Report Body Container */
.ctReportBody {
    margin-left: 220px;
    padding: 1.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    color: #334155;
}

/* Report Tables */
.ctReportTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ctReportTable td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.ctReportTable tr:last-child td {
    border-bottom: none;
}

.ctReportTable tr:hover {
    background-color: #f8fafc;
}

/* Form Container */
.ctReportForm {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Table Labels (Left Column) */
.label {
    font-weight: 600;
    width: 200px;
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Readonly Fields */
.readonly-field {
    background-color: transparent;
    border: none;
    width: 100%;
    color: #334155;
}

/* Show More/Less Functionality */
.collapsed {
    max-height: 4.5em;
    overflow: hidden;
}

.toggle-link {
    color: #1a80b6;
    cursor: pointer;
    display: inline-block;
    margin-top: 0.25rem;
    text-decoration: none;
    font-size: 0.875rem;
    padding-left: 0.25rem;
    font-weight: 600;
}

.toggle-link:hover {
    color: #0891b2;
    text-decoration: underline;
}

.description-field {
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0.25rem 0.25rem 0.25rem 0;
}

/* Side Navigation */
.sidenav {
    width: 200px;
    position: fixed;
    z-index: 100;
    background-color: white;
    border-right: 1px solid #e2e8f0;
    overflow-x: hidden;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidenav a {
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: block;
    padding: 0.625rem 1.125rem;
    color: #1a80b6;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidenav a:hover {
    background-color: #f1f5f9;
    color: #0891b2;
    border-left-color: #1a80b6;
}

/* External Links Section */
.link-type-heading {
    color: #1e293b;
    font-weight: 600;
    font-size: 1.125rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-top: 1.5rem;
    margin-left: 0.625rem;
    margin-bottom: 0.75rem;
}

.external-links-list {
    list-style-type: disc;
    padding-left: 3rem;
    margin-bottom: 1.25rem;
}

.external-links-list li {
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
    color: #475569;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.external-links-list li a {
    color: #1a80b6;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.external-links-list li a:hover {
    color: #0891b2;
    border-bottom-color: #0891b2;
    text-decoration: none;
}

/* Status Badges */
.status-container {
    display: inline-block;
    border: 1px solid;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    width: fit-content;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: capitalize;
}

.status-recruiting {
    background-color: #059669;
    border-color: #059669;
}

.status-other {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Form Controls */
.form-control {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #1a80b6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 128, 182, 0.1);
}

.form-control.modified {
    border-color: #f59e0b;
    background-color: #fffbeb;
    transition: all 0.2s;
}

.form-control.modified:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-block;
    margin: 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #1a80b6;
    color: white;
}

.btn-primary:hover {
    background: #0891b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 128, 182, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(100, 116, 139, 0.3);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* External Links Edit Table */
.ext-links-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ext-links-table th,
.ext-links-table td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
}

.ext-links-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: left;
}

.ext-links-table tbody tr:hover {
    background-color: #f8fafc;
}

.ext-links-table colgroup col:nth-child(1) { width: 21%; }
.ext-links-table colgroup col:nth-child(2) { width: 35%; }
.ext-links-table colgroup col:nth-child(3) { width: 35%; }
.ext-links-table colgroup col:nth-child(4) { width: 9%; }

.ext-links-table select,
.ext-links-table textarea {
    width: 100%;
    box-sizing: border-box;
}

/* FDA Designations Checkboxes */
.fda-designations-container {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    appearance: none;
    background: white;
}

.checkbox-item input[type="checkbox"]:checked {
    background: #1a80b6;
    border-color: #1a80b6;
    position: relative;
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
}

.checkbox-item label {
    margin: 0;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    font-size: 0.875rem;
}

/* HR Dividers */
hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1rem 0;
}

/* Dynamic Headings */
.dynamic-heading {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.dynamic-heading:first-child {
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidenav {
        display: none;
    }

    .ctReportBody {
        margin: 0;
        padding: 1rem;
    }

    .mainTitle {
        font-size: 1.5rem;
    }

    .brief-title {
        font-size: 1.125rem;
    }

    .ctSubHeading {
        font-size: 1.125rem;
    }

    .label {
        width: auto;
        display: block;
        padding: 0.5rem;
        border-bottom: none;
    }

    .ctReportTable td {
        display: block;
        width: 100%;
        padding: 0.5rem;
    }

    .ctReportTable tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
    }

    .ext-links-table,
    .ext-links-table thead,
    .ext-links-table tbody,
    .ext-links-table tr,
    .ext-links-table th,
    .ext-links-table td {
        display: block;
    }

    .ext-links-table thead {
        display: none;
    }

    .ext-links-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
    }
}

/* Print Styles */
@media print {
    .sidenav,
    .btn,
    a[href*="edit=true"] {
        display: none !important;
    }

    .ctReportBody {
        margin-left: 0;
    }

    .ctReportTable {
        box-shadow: none;
    }
}