/* ==================== Search Panel ==================== */

.search_panel {
    position: relative;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 32px 36px;
    margin: 25px 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(72, 138, 99, 0.12);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Loading Overlay (Glassmorphism) ==================== */

.search_loading_overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.search_loading_overlay.active {
    display: flex;
}

.search_loading_content {
    text-align: center;
}

.search_loading_spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0f4e8;
    border-top-color: #4fb479;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search_loading_content p {
    font-size: 16px;
    font-weight: 600;
    color: #488a63;
    margin: 0;
}

.search_loading_content .search_loading_subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin-top: 5px;
}

/* ==================== Panel Header ==================== */

.search_panel_header {
    margin-bottom: 28px;
    border-bottom: 2px solid #e0f4e8;
    padding-bottom: 16px;
}

.search_panel_title {
    font-size: 22px;
    font-weight: 700;
    color: #2d5a3e;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
}

.search_panel_description {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}

/* ==================== ID Search Group ==================== */

.id_search_group {
    margin-bottom: 28px;
}

.search_group_label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #2d5a3e;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
}

.id_input_wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 480px;
}

.docking_search_input {
    width: 100%;
    height: 44px;
    padding: 0 68px 0 16px;
    border: 2px solid #d0e8d9;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', Consolas, monospace;
    color: #333;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.docking_search_input:hover {
    border-color: #a0d0b4;
}

.docking_search_input:focus {
    border-color: #4fb479;
    box-shadow: 0 0 0 4px rgba(79, 180, 121, 0.15);
}

.docking_search_input::placeholder {
    color: #aaa;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
}

/* ID Validation Icon */

.id_validation_icon {
    position: absolute;
    right: 38px;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    border-radius: 50%;
}

/* ID Clear Button */

.id_clear_btn {
    position: absolute;
    right: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #d0d0d0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
}

.id_clear_btn.visible {
    display: flex;
}

.id_clear_btn:hover {
    background: #aaa;
}

.id_validation_icon.valid {
    display: flex;
    color: #fff;
    background-color: #4fb479;
}

.id_validation_icon.invalid {
    display: flex;
    color: #fff;
    background-color: #e96a6a;
}

.id_validation_icon.validating {
    display: block;
    width: 20px;
    height: 20px;
    border: 2.5px solid #e0f4e8;
    border-top-color: #4fb479;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    background: transparent;
    font-size: 0;
}

/* ID Search Hint */

.id_search_hint {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.id_search_hint .hint_text {
    color: #999;
}

.id_search_hint .example_title {
    color: #999;
    font-style: italic;
}

.id_search_hint .example_id {
    font-family: 'Courier New', Consolas, monospace;
    color: #4fb479;
    cursor: pointer;
    padding: 2px 10px;
    border-radius: 4px;
    background: rgba(79, 180, 121, 0.08);
    transition: all 0.2s ease;
}

.id_search_hint .example_id:hover {
    color: #2d8050;
    background: rgba(79, 180, 121, 0.18);
    text-decoration: underline;
}

/* ==================== Select Group ==================== */

.select_group {
    margin-bottom: 28px;
}

.select_group:last-of-type {
    margin-bottom: 10px;
}

.select_group_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.select_group_actions {
    display: flex;
    gap: 8px;
}

.select_action_btn {
    padding: 5px 16px;
    font-size: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.select_all_btn {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: #fff;
    border: none;
}

.select_all_btn:hover {
    background: linear-gradient(135deg, #3a9b63, #2d8050);
    box-shadow: 0 2px 10px rgba(79, 180, 121, 0.35);
    transform: translateY(-1px);
}

.deselect_all_btn {
    background: #fff;
    color: #777;
    border: 1.5px solid #ddd;
}

.deselect_all_btn:hover {
    border-color: #e96a6a;
    color: #e96a6a;
    background: rgba(233, 106, 106, 0.04);
    transform: translateY(-1px);
}

/* ==================== Button Grid ==================== */

.button_grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(227, 252, 221, 0.25), rgba(220, 245, 235, 0.3));
    border: 1px solid rgba(72, 138, 99, 0.1);
    border-radius: 10px;
}

.button_grid.scrollable {
    max-height: 168px;
    overflow-y: auto;
    align-content: flex-start;
}

.button_grid.scrollable::-webkit-scrollbar {
    width: 6px;
}

.button_grid.scrollable::-webkit-scrollbar-track {
    background: #f0f7f2;
    border-radius: 3px;
}

.button_grid.scrollable::-webkit-scrollbar-thumb {
    background: #c0dcc8;
    border-radius: 3px;
    transition: background 0.2s;
}

.button_grid.scrollable::-webkit-scrollbar-thumb:hover {
    background: #4fb479;
}

/* ==================== Selection Buttons ==================== */

.selection_btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1.5px solid #c0dcc8;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
}

.selection_btn:hover {
    border-color: #4fb479;
    color: #3a9b63;
    background: rgba(79, 180, 121, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(79, 180, 121, 0.15);
}

.selection_btn.selected {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(79, 180, 121, 0.3);
}

.selection_btn.selected:hover {
    background: linear-gradient(135deg, #3a9b63, #2d8050);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(79, 180, 121, 0.4);
}

.selection_btn .btn_label {
    pointer-events: none;
}

.selection_btn .member_count {
    font-size: 11px;
    opacity: 0.6;
    pointer-events: none;
}

.selection_btn.selected .member_count {
    opacity: 0.85;
}

/* Remove icon */

.selection_btn .remove_icon {
    display: none;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.selection_btn.selected .remove_icon {
    display: inline-flex;
}

.selection_btn.selected .remove_icon:hover {
    background: rgba(255, 255, 255, 0.55);
}

/* ==================== TF Family Disabled State ==================== */

.tf_family_select_group.disabled .select_group_actions .select_action_btn {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

.tf_family_select_group.disabled .button_grid {
    opacity: 0.5;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(220, 220, 220, 0.2), rgba(210, 210, 210, 0.25));
}

.tf_family_select_group.disabled .selection_btn {
    cursor: not-allowed;
}

.tf_family_select_group.disabled .selection_btn.selected {
    background: linear-gradient(135deg, #88c9a0, #6fb48a);
    box-shadow: none;
}

/* ==================== Submit Button ==================== */

.submit_group {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.docking_submit_btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 52px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.3px;
}

.docking_submit_btn:hover {
    background: linear-gradient(135deg, #3a9b63, #2d8050);
    box-shadow: 0 4px 16px rgba(79, 180, 121, 0.4);
    transform: translateY(-2px);
}

.docking_submit_btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 180, 121, 0.3);
}

.docking_submit_btn.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

.submit_btn_icon {
    font-size: 15px;
    transition: transform 0.2s ease;
}

.docking_submit_btn:hover .submit_btn_icon {
    transform: translateX(3px);
}

/* ====================================================================
   Section 2: Docking Table Panel
   ==================================================================== */

/* ==================== Table Panel Container ==================== */

.docking_table_panel {
    position: relative;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 28px 32px;
    margin: 0 0 25px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(72, 138, 99, 0.12);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.docking_table_panel.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== Table Loading Overlay ==================== */

.table_loading_overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.table_loading_overlay.active {
    display: flex;
}

.table_loading_content {
    text-align: center;
}

.table_loading_spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0f4e8;
    border-top-color: #4fb479;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

.table_loading_content p {
    font-size: 16px;
    font-weight: 600;
    color: #488a63;
    margin: 0;
}

.table_loading_content .table_loading_subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin-top: 5px;
}

/* ==================== Table Panel Header ==================== */

.table_panel_header {
    margin-bottom: 18px;
    border-bottom: 2px solid #e0f4e8;
    padding-bottom: 14px;
}

.table_panel_title_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table_panel_title {
    font-size: 20px;
    font-weight: 700;
    color: #2d5a3e;
    font-family: 'Poppins', sans-serif;
}

.table_download_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #488a63;
    background: #fff;
    border: 1.5px solid #c0dcc8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Poppins', sans-serif;
}

.table_download_btn:hover {
    background: #f0faf4;
    border-color: #4fb479;
    color: #2d8050;
    box-shadow: 0 2px 8px rgba(79, 180, 121, 0.15);
    transform: translateY(-1px);
}

.table_download_btn.downloading {
    opacity: 0.6;
    pointer-events: none;
}

.download_icon {
    font-size: 14px;
}

/* ==================== Table Scroll Wrapper ==================== */

.docking_table_scroll_wrapper {
    overflow-x: auto;
    border: 1px solid #d0e8d9;
    border-radius: 8px;
}

.docking_table_scroll_wrapper.scrollable {
    max-height: 520px;
    overflow-y: auto;
}

.docking_table_scroll_wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.docking_table_scroll_wrapper::-webkit-scrollbar-track {
    background: #f0f7f2;
}

.docking_table_scroll_wrapper::-webkit-scrollbar-thumb {
    background: #c0dcc8;
    border-radius: 3px;
}

.docking_table_scroll_wrapper::-webkit-scrollbar-thumb:hover {
    background: #4fb479;
}

/* ==================== Table ==================== */

.docking_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
    min-width: 1400px;
}

.docking_table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.docking_table th {
    background: linear-gradient(135deg, #488a63, #3a7554);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease;
}

.docking_table th:last-child {
    border-right: none;
}

.docking_table th:hover {
    background: linear-gradient(135deg, #3a7554, #2d5a3e);
}

.docking_table td {
    padding: 9px 12px;
    color: #444;
    border-bottom: 1px solid #e8f0eb;
    white-space: nowrap;
    font-size: 13px;
}

.docking_table tbody tr:nth-child(even) {
    background-color: #f5faf7;
}

.docking_table tbody tr:hover {
    background-color: #e0f4e8;
}

.table_empty_msg {
    text-align: center;
    padding: 40px 16px !important;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* ==================== Sort Indicator ==================== */

.sort_indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
    vertical-align: middle;
}

.sort_arrows {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
    font-size: 8px;
    gap: 0;
}

.sort_arrows::before {
    content: '▲';
    opacity: 0.35;
    transition: opacity 0.2s;
}

.sort_arrows::after {
    content: '▼';
    opacity: 0.35;
    transition: opacity 0.2s;
}

.sort_indicator.asc .sort_arrows::before {
    opacity: 1;
}

.sort_indicator.desc .sort_arrows::after {
    opacity: 1;
}

.sort_priority {
    font-size: 9px;
    font-weight: 700;
    min-width: 10px;
    text-align: center;
    opacity: 0.85;
}

/* ==================== Protein ID Link ==================== */

.protein_id_link {
    color: #3a7554;
    cursor: pointer;
    font-family: 'Courier New', Consolas, monospace;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

.protein_id_link:hover {
    color: #2d5a3e;
    text-decoration: underline;
}

/* ==================== Confidence Badge ==================== */

.confidence_badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
}

.confidence_high {
    background: rgba(79, 180, 121, 0.15);
    color: #2d8050;
}

.confidence_medium {
    background: rgba(240, 173, 78, 0.15);
    color: #b8860b;
}

.confidence_low {
    background: rgba(233, 106, 106, 0.15);
    color: #c0392b;
}

/* ==================== Confidence Tooltip ==================== */

.confidence_tooltip {
    display: none;
    position: absolute;
    z-index: 200;
    background: #fff;
    border: 1px solid #d0e8d9;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    min-width: 420px;
    cursor: default;
    user-select: text;
}

.confidence_tooltip.visible {
    display: block;
}

.conf_tooltip_row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #444;
    line-height: 1.8;
    white-space: nowrap;
}

.conf_color_block {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.conf_tooltip_note {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
    font-size: 11.5px;
    color: #888;
    font-style: italic;
}

/* ==================== Pagination ==================== */

.table_pagination_container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 0 4px;
}

.table_pagination_info {
    font-size: 13px;
    color: #666;
    font-family: 'Poppins', sans-serif;
}

.table_pagination_controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.table_pagination_nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page_btn,
.page_nav_btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid #d0e8d9;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page_btn:hover,
.page_nav_btn:hover:not(:disabled) {
    border-color: #4fb479;
    color: #2d8050;
    background: #f0faf4;
}

.page_btn.active {
    background: linear-gradient(135deg, #4fb479, #3a9b63);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 180, 121, 0.3);
}

.page_nav_btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f9f9f9;
}

.page_ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 32px;
    color: #999;
    font-size: 14px;
    letter-spacing: 2px;
}

/* Page input & size select */

.table_page_input_group,
.table_page_size_group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table_page_input_group label,
.table_page_size_group label {
    font-size: 12px;
    color: #888;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
}

.table_page_input {
    width: 56px;
    height: 32px;
    text-align: center;
    border: 1px solid #d0e8d9;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: #444;
    outline: none;
    transition: border-color 0.2s;
}

.table_page_input:focus {
    border-color: #4fb479;
    box-shadow: 0 0 0 3px rgba(79, 180, 121, 0.12);
}

.page_go_btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d0e8d9;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.page_go_btn:hover {
    border-color: #4fb479;
    color: #2d8050;
    background: #f0faf4;
}

.page_go_btn:active {
    transform: scale(0.95);
}

.table_page_size_select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid #d0e8d9;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: #444;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.table_page_size_select:focus {
    border-color: #4fb479;
    box-shadow: 0 0 0 3px rgba(79, 180, 121, 0.12);
}

/* ====================================================================
   Section 3: 3D Structure Viewer Panel
   ==================================================================== */

/* ==================== Structure Panel Container ==================== */

.structure_panel {
    position: relative;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 28px 32px;
    margin: 0 0 25px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(72, 138, 99, 0.12);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.structure_panel.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== Structure Loading Overlay ==================== */

.structure_loading_overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.structure_loading_overlay.active {
    display: flex;
}

.structure_loading_content {
    text-align: center;
}

.structure_loading_spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0f4e8;
    border-top-color: #4fb479;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

.structure_loading_content p {
    font-size: 16px;
    font-weight: 600;
    color: #488a63;
    margin: 0;
}

.structure_loading_content .structure_loading_subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin-top: 5px;
}

/* ==================== Structure Panel Header ==================== */

.structure_panel_header {
    margin-bottom: 18px;
    border-bottom: 2px solid #e0f4e8;
    padding-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.structure_panel_title {
    font-size: 20px;
    font-weight: 700;
    color: #2d5a3e;
    font-family: 'Poppins', sans-serif;
}

.structure_panel_subtitle {
    font-size: 13px;
    color: #777;
    font-family: 'Courier New', Consolas, monospace;
}

/* ==================== Top Row: 70/30 Layout ==================== */

.structure_top_row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 520px;
}

.structure_left_col {
    flex: 7;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.structure_viewer_wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    border: 1px solid #d0e8d9;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.molstar_container {
    width: 100%;
    height: 100%;
    min-height: 520px;
    position: relative;
}

.structure_right_col {
    flex: 3;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==================== pLDDT Help Row (centered above viewer) ==================== */

.plddt_help_row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    position: relative;
}

.plddt_help_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #488a63;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    transition: background 0.2s ease;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}

.plddt_help_icon:hover {
    background: #2d5a3e;
}

.plddt_help_label {
    font-size: 12px;
    color: #777;
    font-family: 'Poppins', sans-serif;
    cursor: help;
}

.plddt_tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    background: #fff;
    border: 1px solid #d0e8d9;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    min-width: 240px;
    z-index: 60;
}

.plddt_tooltip.visible {
    display: block;
}

.plddt_tooltip_title {
    font-size: 13px;
    font-weight: 700;
    color: #2d5a3e;
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
}

.plddt_tooltip_row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #444;
    line-height: 1.9;
    white-space: nowrap;
}

.plddt_color_block {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ==================== PAE Section ==================== */

.pae_section {
    border: 1px solid #d0e8d9;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pae_section_title {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a3e;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
}

.pae_image_wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: #f8faf9;
    min-height: 160px;
    position: relative;
}

.pae_image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    transition: opacity 0.3s ease;
}

.pae_image.loaded {
    display: block;
}

.pae_placeholder {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.pae_image.loaded ~ .pae_placeholder {
    display: none;
}

/* ==================== Detail Info Section ==================== */

.detail_section {
    border: 1px solid #d0e8d9;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.detail_section_title {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a3e;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
}

.detail_table_wrapper {
    flex: 1;
    overflow-y: auto;
}

.detail_table_wrapper::-webkit-scrollbar {
    width: 5px;
}

.detail_table_wrapper::-webkit-scrollbar-track {
    background: #f0f7f2;
    border-radius: 3px;
}

.detail_table_wrapper::-webkit-scrollbar-thumb {
    background: #c0dcc8;
    border-radius: 3px;
}

.detail_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.detail_table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eef4f0;
}

.detail_table .detail_key {
    font-weight: 600;
    color: #488a63;
    white-space: nowrap;
    width: 45%;
    font-family: 'Poppins', sans-serif;
}

.detail_table .detail_value {
    color: #444;
    font-family: 'Courier New', Consolas, monospace;
    word-break: break-all;
}

/* ==================== Download Row ==================== */

.structure_download_row {
    border-top: 2px solid #e0f4e8;
    padding-top: 16px;
}

.download_row_title {
    font-size: 14px;
    font-weight: 600;
    color: #2d5a3e;
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
}

.download_links_group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.raw_download_link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #488a63;
    background: #fff;
    border: 1.5px solid #c0dcc8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.raw_download_link:hover {
    background: #f0faf4;
    border-color: #4fb479;
    color: #2d8050;
    box-shadow: 0 2px 8px rgba(79, 180, 121, 0.15);
    transform: translateY(-1px);
}

.raw_dl_icon {
    font-size: 15px;
}

/* ==================== PAE Fullscreen Modal ==================== */

.pae_modal_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.pae_modal_overlay.active {
    display: flex;
}

.pae_modal_container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pae_modal_toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    z-index: 10001;
    pointer-events: auto;
}

.pae_modal_btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pae_modal_btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.pae_modal_close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(233, 106, 106, 0.3);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.pae_modal_close:hover {
    background: rgba(233, 106, 106, 0.6);
}

.pae_modal_image_wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.pae_modal_image {
    transition: width 0.15s ease, height 0.15s ease;
    border-radius: 6px;
    object-fit: contain;
}

/* ==================== Responsive ==================== */

@media screen and (max-width: 768px) {
    .search_panel {
        padding: 20px 18px;
        margin: 15px 0;
    }

    .search_panel_title {
        font-size: 18px;
    }

    .search_panel_description {
        font-size: 13px;
    }

    .select_group_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .id_input_wrapper {
        max-width: 100%;
    }

    .button_grid.scrollable {
        max-height: 140px;
    }

    .selection_btn {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Section 2 responsive */
    .docking_table_panel {
        padding: 18px 14px;
    }

    .table_panel_title {
        font-size: 17px;
    }

    .table_panel_title_row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table_pagination_container {
        flex-direction: column;
        align-items: flex-start;
    }

    .table_pagination_controls {
        flex-wrap: wrap;
    }

    .confidence_tooltip {
        min-width: 300px;
        right: auto;
        left: 0;
    }

    /* Section 3 responsive */
    .structure_panel {
        padding: 18px 14px;
    }

    .structure_panel_header {
        flex-direction: column;
        gap: 6px;
    }

    .structure_top_row {
        flex-direction: column;
        min-height: auto;
    }

    .structure_left_col {
        flex: none;
    }

    .molstar_container {
        min-height: 380px;
    }

    .structure_right_col {
        flex: none;
    }

    .pae_image_wrapper {
        min-height: 200px;
    }

    .download_links_group {
        flex-direction: column;
    }

    .raw_download_link {
        justify-content: center;
    }
}

