/* BioVanguard - Modern Split-Pane Dashboard Styling */

:root {
    --primary-color: #0C447C;
    --secondary-color: #1D9E75;
    --accent-color: #378ADD;
    --success-color: #1D9E75;
    --danger-color: #E24B4A;
    --warning-color: #BA7517;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #F1EFE8;
    --bg-dark: #1a1a1a;
    --text-primary: #2C2C2A;
    --text-secondary: #5F5E5A;
    --text-muted: #888780;
    --border-color: #D3D1C7;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a5a9e 100%);
    color: white;
    padding: 0.65rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    min-width: 0;
}

.header-left h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.header-left .subtitle {
    font-size: 0.82rem;
    opacity: 0.9;
    font-weight: 400;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Dashboard Container - Split Pane Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 450px 1fr;
    height: calc(100vh - 52px);
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
}

/* Left Panel */
.left-panel {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

/* Right Panel */
.right-panel {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Panel Headers */
.panel-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-primary);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.panel-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.panel-icon {
    display: none;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 0;
}

/* Drop Zone */
.drop-zone {
    margin: 1.5rem;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.drop-zone.dragover {
    border-color: var(--success-color);
    background: rgba(29, 158, 117, 0.1);
    transform: scale(1.02);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    min-height: 2.2rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    background: rgba(55, 138, 221, 0.08);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* File Info Panel */
.file-info-panel {
    margin: 0 1.5rem 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success-color);
}

.file-info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.4rem;
    background: white;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-clear:hover {
    background: rgba(226, 75, 74, 0.1);
    color: var(--danger-color);
}

/* SDF Preview Section */
.sdf-preview-section {
    margin: 0 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.preview-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0.2px;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.sdf-content-window {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #00ff00;
    min-height: 250px;
    max-height: 400px;
}

.sdf-content-window pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.placeholder-text p {
    margin: 0.5rem 0;
}

.placeholder-hint {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Examples Section */
.examples-section {
    margin: 1.5rem;
}

.examples-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0.2px;
    margin-bottom: 0.75rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.example-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.example-item:hover {
    border-color: var(--accent-color);
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.example-item.selected {
    border-color: var(--success-color);
    background: rgba(29, 158, 117, 0.1);
}

.example-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.example-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Action Section */
.action-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.btn-predict {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.btn-predict:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-predict:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 3D Viewer Container */
.viewer-3d-container {
    flex: 0 0 auto;
    margin: 1.5rem;
    min-height: 585px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.viewer-canvas {
    flex: 0 0 520px;
    height: 520px;
    min-height: 520px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
}

.viewer-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.viewer-count-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 3;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(125, 211, 252, 0.38);
    border-radius: 6px;
    background: rgba(16, 24, 32, 0.74);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.76rem;
    font-weight: 700;
    pointer-events: none;
}

.viewer-3d-container.has-result {
    border: 2px solid rgba(29, 158, 117, 0.35);
}

.canvas-pose-stage {
    position: absolute;
    inset: 0;
    background: #101820;
}

.pose-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

.pose-canvas:active {
    cursor: grabbing;
}

.pose-canvas-hud {
    position: absolute;
    left: 14px;
    top: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    font-weight: 700;
    pointer-events: none;
}

/* 3Dmol container styling */
#container-3dmol {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px;
}

.viewer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem;
}

.placeholder-icon-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    opacity: 0.72;
}

.placeholder-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: white;
}

.placeholder-desc {
    font-size: 1rem;
    opacity: 0.8;
    max-width: 500px;
    margin-bottom: 2rem;
}

.viewer-features {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.feature-item {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

/* Viewer Controls */
.viewer-controls {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.control-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.control-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.control-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.control-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.control-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Results Panel */
.results-panel {
    margin: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-tertiary);
}

.results-icon {
    font-size: 1.5rem;
}

.results-header h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    text-align: center;
}

.result-card.primary {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(55, 138, 221, 0.1) 0%, rgba(12, 68, 124, 0.05) 100%);
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: none;
    letter-spacing: 0.2px;
    font-weight: 600;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.result-value.small {
    font-size: 1.5rem;
}

.result-value.active {
    color: var(--success-color);
}

.result-value.inactive {
    color: var(--danger-color);
}

.result-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.result-status {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.result-status.active {
    background: rgba(29, 158, 117, 0.15);
    color: var(--success-color);
}

.result-status.inactive {
    background: rgba(226, 75, 74, 0.15);
    color: var(--danger-color);
}

.result-note {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.5rem;
    line-height: 1.3;
}

/* Diagnostics and Binding Residues */
.diagnostics-section,
.binding-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title-row .properties-header {
    margin-bottom: 0;
}

.section-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.diagnostic-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.diag-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.2px;
}

.diag-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
}

.pose-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 0.9rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pose-meta-row strong {
    color: var(--text-primary);
}

.residue-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.6rem;
}

.residue-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--warning-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.residue-row:hover {
    background: white;
    border-color: var(--warning-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.residue-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.residue-name {
    font-weight: 800;
    font-size: 0.86rem;
}

.residue-distance {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.residue-interactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.interaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
    transition: var(--transition);
}

.interaction-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.interaction-badge-empty {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-style: italic;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.pose-quality-warning {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    grid-column: 1 / -1;
    color: var(--text-primary);
    border-color: rgba(211, 47, 47, 0.35);
    background: rgba(211, 47, 47, 0.06);
}

.pose-quality-warning span {
    color: var(--text-secondary);
    line-height: 1.45;
}

.quality-contact-list {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.2rem;
}

.quality-contact {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

/* Properties Section */
.properties-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.properties-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0.2px;
    margin-bottom: 1rem;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-color);
}

.prop-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.prop-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Download Actions */
.download-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-download {
    flex: 1 1 150px;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Pose Download Modal */
.pose-download-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(16, 24, 32, 0.62);
}

.pose-download-dialog {
    width: min(560px, 100%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1.35rem;
}

.pose-download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.pose-download-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.05rem;
}

.pose-download-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.pose-download-close:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.pose-download-copy {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.pose-download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}

.pose-option-btn {
    position: relative;
    min-height: 108px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.pose-option-btn.selected {
    border-color: var(--primary-color);
    background: #EAF3FB;
    box-shadow: inset 0 0 0 1px rgba(12, 68, 124, 0.16);
}

.pose-option-btn.selected::after {
    content: "Selected";
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
}

.pose-option-btn:hover {
    border-color: var(--success-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pose-option-title,
.pose-option-note {
    display: block;
}

.pose-option-title {
    margin-bottom: 0.35rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-right: 4.5rem;
}

.pose-option-note {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.3;
}

.pose-download-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pose-cancel-btn,
.pose-confirm-btn {
    min-width: 132px;
    padding: 0.72rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.pose-cancel-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pose-confirm-btn {
    border: 1px solid var(--success-color);
    background: var(--success-color);
    color: white;
}

.pose-cancel-btn:hover,
.pose-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pose-cancel-btn:hover {
    border-color: var(--primary-color);
}

/* Progress Overlay */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.progress-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.progress-icon {
    font-size: 2rem;
}

.progress-header h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    height: 40px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color) 0%, var(--accent-color) 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.progress-step.active {
    background: var(--accent-color);
    color: white;
}

.progress-step.completed {
    background: var(--success-color);
    color: white;
}

.step-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: var(--success-color);
    color: white;
}

.alert-error {
    background: var(--danger-color);
    color: white;
}

.alert-info {
    background: var(--accent-color);
    color: white;
}

.alert-warning {
    background: var(--warning-color);
    color: white;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 400px 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .diagnostics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 600px;
    }
    
    .right-panel {
        min-height: 600px;
    }
    
    .examples-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .header-content {
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .header-left {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.1rem;
    }
    
    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }

    .diagnostics-grid,
    .residue-list {
        grid-template-columns: 1fr;
    }

    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .download-actions {
        flex-direction: column;
    }

    .pose-download-options {
        grid-template-columns: 1fr;
    }

    .pose-download-footer {
        flex-direction: column-reverse;
    }

    .pose-cancel-btn,
    .pose-confirm-btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.sdf-content-window::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.sdf-content-window::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.sdf-content-window::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.sdf-content-window::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* ============================================================================
   Interaction Detail Panel
   ============================================================================ */

.interaction-detail-panel {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-top: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.interaction-detail-panel.hidden {
    display: none;
}

.detail-panel-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a5a9e 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.btn-close-detail {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
    padding: 0;
}

.btn-close-detail:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.detail-panel-content {
    padding: 1.25rem;
}

.detail-residue-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.detail-residue-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.detail-residue-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-residue-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.detail-interactions-summary {
    margin-bottom: 1.25rem;
}

.detail-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-contact-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.detail-interaction-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-interaction-badges .interaction-badge {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid;
    transition: var(--transition);
}

.detail-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.detail-contacts-section {
    margin-bottom: 1.25rem;
}

.detail-contacts-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.detail-contact-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.detail-contact-item:last-child {
    border-bottom: none;
}

.detail-contact-item:hover {
    background: white;
}

.detail-contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.detail-contact-atoms {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-contact-distance {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    background: rgba(29, 158, 117, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.detail-contact-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.detail-contact-type-badge {
    background: rgba(12, 68, 124, 0.1);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-detail-action {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-detail-action {
    background: var(--primary-color);
    color: white;
}

.btn-detail-action:hover {
    background: #0a3a6a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-detail-action.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-detail-action.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.detail-contacts-list::-webkit-scrollbar {
    width: 6px;
}

.detail-contacts-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.detail-contacts-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.detail-contacts-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Animation for panel appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.interaction-detail-panel:not(.hidden) {
    animation: slideDown 0.3s ease-out;
}

/* Drug-Likeness Scorecard Styles */
.druglikeness-section {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.druglikeness-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.druglikeness-badge.excellent {
    background: linear-gradient(135deg, #1D9E75 0%, #16a085 100%);
    color: white;
}

.druglikeness-badge.good {
    background: linear-gradient(135deg, #378ADD 0%, #2980b9 100%);
    color: white;
}

.druglikeness-badge.moderate {
    background: linear-gradient(135deg, #BA7517 0%, #d68910 100%);
    color: white;
}

.druglikeness-badge.poor {
    background: linear-gradient(135deg, #E24B4A 0%, #c0392b 100%);
    color: white;
}

.radar-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
    margin: 1rem 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.radar-chart-container canvas {
    max-width: 100%;
    height: auto;
}

.druglikeness-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.metric-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.metric-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.metric-status.pass {
    background: #d4edda;
    color: #155724;
}

.metric-status.warn {
    background: #fff3cd;
    color: #856404;
}

.metric-status.fail {
    background: #f8d7da;
    color: #721c24;
}

.metric-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
