/* Disable internal scrolling to allow parent iframe to handle height and scrolling */
html,
body {
    height: auto !important;
    margin: 0;
    padding: 0;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #008dd0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #008dd0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #008dd0;
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #008dd0 #fff;
}

.app-content {
    padding: 15px;
    background-color: #f5f5f5;
}

/* Enhance sort icons */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th .dash-table-column-sort {
    font-size: 16px;
    margin-left: 12px;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: color 0.3s;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th .dash-table-column-sort:hover {
    color: white !important;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th .dash-table-column-sort.active {
    color: white !important;
    opacity: 1;
}

/* Disable sorting for Stage and Action columns */
th[data-dash-column="Stage"] .dash-table-column-sort,
th[data-dash-column="Action"] .dash-table-column-sort {
    display: none !important;
}

th[data-dash-column="Stage"],
th[data-dash-column="Action"] {
    pointer-events: none !important;
    cursor: default !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 70%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: #008dd0;
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
    background-color: #f9f9f9;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.close-btn {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.form-card {
    padding: 20px;
    background-color: white;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.close-btn:hover {
    color: #e0e0e0;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    width: 30%;
    color: #008dd0;
}

.detail-value {
    width: 70%;
    color: #333;
    word-break: break-word;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: #f9fafb;
    margin: 0;
    padding: 0;
}

.objects-container {
    overflow: visible !important;
    position: relative;
    border-top: 1px dashed #aaaaaa;
    padding-top: 20px;
    margin-top: 20px;
}

.objects-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    position: relative;
    z-index: 100;
    overflow: visible !important;
}

.filter-group-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-grow: 1;
}

.filter-group-right {
    display: flex;
    align-items: center;
}

.search-group {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 2px 2px 2px 16px;
    border: 1px solid #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 200px;
    height: 36px;
    box-sizing: border-box;
}

.search-container {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    height: 100%;
}


.search-input {
    border: none !important;
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    font-size: 16px !important;
    outline: none !important;
    box-shadow: none !important;
    color: #374151 !important;
}

.search-input::placeholder {
    color: #aaa !important;
    font-size: 16px !important;
    padding: 0 !important;
}

.search-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 8px !important;
    background-color: #008dd0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin-left: 8px !important;
    padding: 0 !important;
    font-size: 16px !important;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: #007bb5 !important;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 2;
}

.clear-icon {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(156, 163, 175);
    cursor: pointer;
    font-size: 18px;
    z-index: 2;
    line-height: 2;
    display: none;
}

.search-container:hover .clear-icon {
    display: block;
}

.premium-dropdown {
    overflow: visible !important;
    width: 350px !important;
    /* Consistent width for all dropdowns */
}

.drug-dropdown {
    width: 250px !important;
}

.export-dropdown {
    width: 150px !important;
}

.export-dropdown .Select-placeholder {
    color: white !important;
}

.premium-dropdown .Select-control {
    border-radius: 8px !important;
    border: 1px solid #d1d5db !important;
    background-color: white !important;
    cursor: pointer !important;
}

.export-dropdown .Select-control {
    border-radius: 8px !important;
    border: 1px solid #008dd0 !important;
    background-color: #008dd0 !important;
    cursor: pointer !important;
}

.export-dropdown .Select-control:hover {
    background-color: #007bb5 !important;
}

.export-dropdown .Select-arrow {
    border-color: #fff transparent transparent !important;
}

.export-dropdown.is-open>.Select-control .Select-arrow {
    border-color: transparent transparent #fff !important;
}

.export-dropdown.has-value.Select--single>.Select-control .Select-value .Select-value-label,
.export-dropdown.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label {
    color: white !important;
}

/* Fix for dropdown menu overlap and styling */
.premium-dropdown .Select-menu-outer {
    margin-top: 4px !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    z-index: 99999 !important;
    background-color: white !important;
    overflow: visible !important;
    position: absolute !important;
    width: 100% !important;
    /* Match the width of the dropdown field */
    min-width: 100% !important;
}

.premium-dropdown .Select-menu {
    max-height: 300px !important;
    overflow-y: auto !important;
    background-color: white !important;
}

/* Premium Table Styles */
.premium-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    max-width: 100%;
}

.premium-table.full-layout {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100%;
}

.premium-table.full-layout th {
    white-space: nowrap !important;
    max-width: none !important;
}

.premium-table td {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    /* overflow: hidden; Removed to allow tooltip to show */
    position: relative;
    cursor: default;
    /* Arrow cursor */
    max-width: 200px;
    word-wrap: break-word;
    /* Limit column width in full view */
}

.premium-table td.has-overflow:hover {
    z-index: 1000 !important;
    /* Ensure tooltip is above sticky headers */
}

.cell-content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    line-height: 40px;
    position: relative;
}

/* Tooltip styles - Only show when has-overflow class is added by JS */
.premium-table td.has-overflow[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 16px;
    background: white;
    color: #333;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    white-space: normal;
    width: max-content;
    max-width: 400px;
    pointer-events: none;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

.premium-table td.has-overflow[data-tooltip]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 30px;
    border-width: 6px;
    border-style: solid;
    border-color: white transparent transparent transparent;
    z-index: 1000000;
    margin-bottom: -2px;
}

/* Frozen columns for full table layout */
.frozen-col-drug {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    box-sizing: border-box !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.frozen-col-tumor {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    box-sizing: border-box !important;
}

.frozen-col-stage {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
    box-sizing: border-box !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.premium-table th {
    height: 40px;
    padding: 0 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: white !important;
    /* White text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #008dd0;
    background-color: #008dd0 !important;
    /* Sky blue background */
    max-width: 400px;
    position: sticky;
    top: 0;
    z-index: 0;
}

.premium-table th.expand-col,
.premium-table td.expand-col {
    min-width: 100px !important;
    width: 100px !important;
}

.premium-table th.sortable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.premium-table th.sortable:hover {
    background-color: #007bb5 !important;
}


.premium-table tr:hover {
    background-color: #f9fafb;
}

.row-expand-btn {
    cursor: pointer;
    color: #0d8dd0 !important;
    transition: all 0.2s;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: white !important;
    width: 26px !important;
    height: 26px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.row-expand-btn:hover {
    border-color: #0d8dd0 !important;
    background-color: #f0f9ff !important;
    color: #007bb5 !important;
}

.header-expand-btn {
    background-color: white !important;
    color: #008dd0 !important;
    border-color: white !important;
    width: auto !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.header-expand-btn:hover {
    background-color: #f0f9ff !important;
    border-color: white !important;
}

.checkbox-cell {
    width: 40px;
}

/* Accordion Content Styles */
.accordion-content-wrapper {
    background-color: #f9fafb;
    padding: 16px 24px;
    /* Reduced from 24px */
    border-bottom: 1px solid #f3f4f6;
}

.accordion-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    /* Reduced from 24px */
}

.accordion-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    /* Reduced from 20px */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

.card-title {
    font-size: 14px;
    /* Reduced from 16px */
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    /* Reduced from 16px */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nested-table {
    width: 100%;
    border-collapse: collapse;
}

.nested-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    padding: 6px 12px;
    /* Reduced from 8px */
    border-bottom: 1px solid #f3f4f6;
    width: 30%;
}

.nested-table td {
    padding: 8px 12px;
    /* Reduced from 12px */
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background-color: #ecfdf5;
    color: #059669;
}

/* Pagination Styles */
.premium-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: white;
    overflow: visible !important;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.page-size-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-dropdown {
    width: 100px !important;
}

.page-size-dropdown .Select-control {
    height: 32px !important;
    min-height: 32px !important;
}

.page-size-dropdown .Select-value-label,
.page-size-dropdown .Select-placeholder {
    line-height: 30px !important;
    width: calc(100% - 30px) !important;
}

.Select--single>.Select-control .Select-value,
.Select-placeholder {
    padding-right: 50px !important;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: #008dd0;
    color: #008dd0;
}

.page-btn.active {
    background: #008dd0;
    border-color: #008dd0;
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-right {
    display: flex;
    gap: 8px;
}



.details-container {
    background-color: white;
    border-radius: 12px;
    padding: 24px 32px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.details-header {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    /* Separation between header and content */
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    column-gap: 32px;
    row-gap: 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 4px;
    border-bottom: 1px dashed #e5e7eb;
}

.detail-key {
    font-size: 11px;
    font-weight: 700;
    color: #008dd0;
    /* Sky Blue */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 13px;
    color: #111827;
    word-break: break-word;
    line-height: 1.5;
}

/* Global fix for Dash Dropdowns */
.Select {
    overflow: visible !important;
}

/* Button Loader */
.btn-loader {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 14px;
    font-weight: normal;
    color: #666;
    margin-left: 10px;
    font-style: italic;
}

/* Error message styling */
.error-message,
.stat-label.error {
    color: #dc2626 !important;
    font-weight: 500 !important;
}

/* Controls Wrapper - Container for Layout Toggle and Export */
.controls-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

/* Layout Toggle - Switch with Labels */
.layout-toggle-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.toggle-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #667085 !important;
    transition: color 0.2s !important;
    cursor: pointer !important;
}

.layout-toggle-wrapper.show-accordion #label-accordion {
    color: #008dd0 !important;
    font-weight: 600 !important;
}

.layout-toggle-wrapper.show-full #label-full {
    color: #008dd0 !important;
    font-weight: 600 !important;
}

.toggle-switch {
    width: 36px !important;
    height: 20px !important;
    background-color: #008dd0 !important;
    border-radius: 12px !important;
    position: relative !important;
    border: 1px solid #008dd0 !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.toggle-thumb {
    width: 16px !important;
    height: 16px !important;
    background-color: white !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 1px !important;
    left: 1px !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05) !important;
    transition: transform 0.2s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    border: 1px solid #d0d5dd !important;
}

/* Active State (Full View) */
.layout-toggle-wrapper.show-full .toggle-switch {
    background-color: #008dd0 !important;
    border-color: #008dd0 !important;
}

.layout-toggle-wrapper.show-full .toggle-thumb {
    transform: translateX(16px) !important;
    border-color: white !important;
}

/* Export Buttons Group */
.export-btn-group {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.export-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    border: none !important;
    color: #008dd0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

.export-btn.csv {
    background-color: white !important;
    border: 1px solid #008dd0 !important;
}

.export-btn.csv:hover {
    background-color: #008dd0 !important;
    color: white !important;
}

.export-btn.excel {
    background-color: white !important;
    border: 1px solid #008dd0 !important;
}

.export-btn.excel:hover {
    background-color: #008dd0 !important;
    color: white !important;
}

.export-btn i {
    font-size: 12px !important;
}

/* Stage Dropdown */
.stage-dropdown {
    width: 200px !important;
}

/* Custom Dropdown Styles */
.custom-dropdown-container {
    position: relative;
    width: 200px;
    font-family: 'Inter', sans-serif;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    height: 38px;
    box-sizing: border-box;
}

.custom-dropdown-trigger:hover {
    border-color: #008dd0;
    box-shadow: 0 0 0 2px rgba(0, 141, 208, 0.1);
}

.custom-dropdown-label {
    font-size: 14px;
    color: #344054;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-arrow {
    font-size: 12px;
    color: #667085;
    transition: transform 0.2s;
}

.custom-dropdown-container.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: white;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.custom-dropdown-menu.show {
    display: block;
}

.custom-dropdown-option {
    padding: 10px 12px;
    font-size: 14px;
    color: #344054;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f2f4f7;
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background-color: #f9fafb;
    color: #008dd0;
}

/* Scrollbar for the menu */
.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.custom-dropdown-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-dropdown-clear {
    font-size: 16px;
    color: #98a2b3;
    cursor: pointer;
    transition: color 0.2s;
}

.custom-dropdown-clear:hover {
    color: #667085;
}

.clear-all-btn {
    background: none;
    border: 1px solid #0d8dd0;
    color: #0d8dd0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 12px;
    transition: color 0.2s;
    border-radius: 8px;
}

.clear-all-btn:hover {
    background-color: #0d8dd0;
    color: white;
}

/* Dropdown Backdrop */
.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    background: transparent;
    display: none;
}

/* Search Input in Dropdown */
.dropdown-search-container {
    padding: 8px;
    border-bottom: 1px solid #eee;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-search-input {
    flex-grow: 1;
    padding: 6px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.dropdown-search-input:focus {
    border-color: #008dd0;
    box-shadow: 0 0 0 2px rgba(0, 141, 208, 0.1);
}

.search-clear-icon {
    color: #98a2b3;
    cursor: pointer;
    font-size: 14px;
}

.search-clear-icon:hover {
    color: #667085;
}

/* Responsive Layout Styles */

.input-row {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.input-col-half {
    width: 49%;
    display: inline-block;
}

.input-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    display: block;
}

/* Graph Header Responsiveness */
.graph-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.graph-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.graph-title {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    color: #333;
    display: inline-block;
    font-size: 1.17em;
    font-weight: bold;
}

.fullscreen-btn-style {
    background-color: #0d8dd0;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.fullscreen-btn-style:not(:disabled):hover {
    background-color: #007bb5;
    opacity: 1;
}

.fullscreen-btn-style:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Graph Container Style */
.graph-container-style {
    height: 800px !important;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    width: 96%;
    margin: 0 auto;
}

.view-toggle-radio {
    display: flex;
}

@media (max-width: 768px) {

    /* Stack input columns on mobile */
    .input-col-half {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 15px;
        display: block !important;
    }

    .input-row {
        flex-direction: column;
        margin-bottom: 10px;
    }

    /* Adjust padding for main containers */
    .container,
    .main-content {
        padding: 0 !important;
    }

    /* Adjust Graph Container Height */
    .graph-container-style {
        height: 600px !important;
        width: 100%;
    }

    /* Adjust Table Styles for Mobile */
    .premium-table {
        font-size: 12px !important;
    }

    .premium-table th,
    .premium-table td {
        padding: 8px 10px !important;
    }

    /* Hide less important columns or ensure scroll */
    .table-container {
        overflow-x: auto;
    }

    /* Adjust Modal width */
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
    }

    /* Adjust Headings */
    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    h3 {
        font-size: 18px !important;
    }

    /* Adjust Button Sizes */
    button,
    .btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
        width: 100%;
        /* Full width buttons on mobile often look better */
        margin-bottom: 10px;
    }

    /* Adjust Dropdown font size */
    .Select-control {
        font-size: 14px !important;
    }

    /* Adjust Filter Bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group-left {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .controls-wrapper {
        flex-direction: column;
        width: 100%;
        gap: 15px !important;
        margin-top: 10px;
    }

    .export-btn-group {
        width: 100%;
        justify-content: space-between;
    }

    .export-btn {
        flex: 1;
    }

    .search-group {
        width: 100%;
    }

    .premium-dropdown {
        width: 100% !important;
    }

    .custom-dropdown-container {
        width: 100% !important;
    }

    .layout-toggle-wrapper {
        display: none !important;
    }

    /* Pagination Responsiveness */
    .premium-pagination-container {
        flex-direction: column;
        gap: 15px;
        align-items: center !important;
        padding: 12px 10px !important;
    }

    .pagination-left {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        text-align: center;
    }

    .pagination-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    .app-content {
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
    }



    .graph-header-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .graph-title-group {
        justify-content: space-between;
        width: 100%;
        margin-bottom: 10px;
    }

    .graph-controls-group {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .view-toggle-container {
        display: none !important;
    }

    .fullscreen-btn-style {
        display: none !important;
    }

    .stat-label {
        display: block;
        width: 100%;
        margin-left: 0 !important;
        margin-top: 5px;
    }

    /* Ensure Plotly modebar is visible and below the title on mobile */
    .js-plotly-plot .plotly .modebar {
        top: 5px !important;
        /* Positioned below the title */
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 1001 !important;
    }

    .js-plotly-plot .plotly .modebar-group {
        padding-left: 0 !important;
        margin-left: 0 !important;
        display: flex !important;
    }

    .js-plotly-plot .plotly .modebar-group:first-child {
        border-left: none !important;
        margin-left: 0 !important;
    }

    .js-plotly-plot .plotly .modebar-btn {
        padding: 6px !important;
    }

    .js-plotly-plot .plotly .modebar-btn svg {
        transform: scale(0.9) !important;
    }

    .form-card {
        padding: 20px 0 !important;
        background-color: white !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-bottom: 3px !important;
    }

    /* Mobile Card Layout */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .card-layout-container {
        padding: 10px;
        background-color: #f6f6f6;
    }

    .mobile-card {
        background: white;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border: 1px solid #eee;
        transition: all 0.3s ease;
    }

    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    .card-main-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .card-header-item {
        display: flex;
        flex-direction: column;
    }

    .card-label {
        font-size: 11px;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }

    .card-value {
        font-size: 15px;
        color: #333;
        font-weight: 500;
    }

    .drug-value {
        color: #008dd0;
        font-weight: 700;
        font-size: 17px;
    }

    .card-expand-btn {
        background: #f0f7ff;
        color: #008dd0;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        font-weight: bold;
        cursor: pointer;
        margin-left: 10px;
        transition: background 0.2s;
    }

    .card-expand-btn:active {
        background: #e0efff;
    }

    .card-details {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #f0f0f0;
        overflow: hidden;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Responsive Expanded Details */
    .details-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        column-gap: 15px !important;
    }

    @media (max-width: 480px) {
        .details-grid {
            grid-template-columns: 1fr !important;
        }
    }

    .details-container {
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .detail-item {
        padding: 10px 0 !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }

    /* Responsive Column Shifting */
    .responsive-detail-item {
        display: none !important;
    }

    @media (max-width: 1200px) {
        .responsive-column-hide {
            display: none !important;
        }

        .responsive-detail-item {
            display: flex !important;
        }
    }
}

/* 2D/3D View Toggle Styling */
.graph-controls-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-toggle-container {
    background: #f0f7ff;
    padding: 3px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    border: 1px solid #e0efff;
}

.view-toggle-radio .dash-radioitems {
    display: flex !important;
    gap: 2px;
}

.view-toggle-radio label {
    margin: 0 !important;
    padding: 6px 16px !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #666 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.view-toggle-radio input {
    display: none !important;
}

/* Styling for checked state */
.view-toggle-radio label:has(input:checked) {
    background: #008dd0 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 141, 208, 0.2) !important;
}

.view-toggle-radio label:not(:has(input:checked)):hover {
    background: #e0efff !important;
    color: #008dd0 !important;
}

/* Fallback for browsers that don't support :has() */
.view-toggle-radio label.checked {
    background: #008dd0 !important;
    color: white !important;
}