/* Ligand Detail Page Specific Styles */

/* Information Items - inherit from base style.css */
.info-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.info-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
}

/* Lipinski Property Card */
.lipinski-property-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.lipinski-property-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.lipinski-badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.lipinski-badge.pass {
    background: #dcfce7;
    color: #166534;
}

.lipinski-badge.fail {
    background: #fecaca;
    color: #991b1b;
}


/* Drug Property Cards */
.drug-property-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.drug-property-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.property-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #475569;
}

/* QED Components */
.qed-breakdown {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

/* 修改 QED Components Grid */
.qed-components-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 改为3列 */
    gap: 1rem;
}

.qed-component {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.qed-component-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    min-width: 3rem;
    text-align: center;
}

.qed-component-bar {
    flex: 1;
    height: 0.5rem;
    background: #e2e8f0;
    border-radius: 0.25rem;
    overflow: hidden;
    position: relative;
}

.qed-component-range {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
    text-align: center;
}

.qed-component-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    border-radius: 0.25rem;
    transition: width 0.8s ease;
}

.qed-component-value {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    min-width: 2.5rem;
    text-align: right;
}

/* QED Color Classes - 复用现有的颜色定义，只需要修改 .qed-component-fill */
.qed-component-fill.qed-excellent {
    background: #10b981; /* 覆盖渐变，使用纯色 */
}

.qed-component-fill.qed-good {
    background: #f59e0b; /* 覆盖渐变，使用纯色 */
}

.qed-component-fill.qed-poor {
    background: #ef4444; /* 覆盖渐变，使用纯色 */
}


/* QED Total Component - 重新设计 */
.qed-total-component {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.qed-total-component:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.qed-total-label {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    min-width: auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qed-total-score {
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.qed-total-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    grid-column: 1 / -1;
    font-weight: 500;
}

/* QED Total Score 颜色类 - 重新设计为带阴影的渐变 */
.qed-total-score.qed-excellent {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.qed-total-score.qed-good {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

.qed-total-score.qed-poor {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.3));
}

/* 备用方案：如果浏览器不支持background-clip */
@supports not (-webkit-background-clip: text) {
    .qed-total-score.qed-excellent {
        color: #059669;
        text-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
    
    .qed-total-score.qed-good {
        color: #d97706;
        text-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    }
    
    .qed-total-score.qed-poor {
        color: #dc2626;
        text-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    }
}

/* QED Range Indicators - 调整为水平紧凑布局 */
.qed-range-indicators {
    padding: 0; /* 移除padding */
    border: none; /* 移除border */
}

.qed-range-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.qed-range-dot {
    width: 6px;  /* 减小尺寸 */
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qed-range-text {
    color: #6b7280;
    font-weight: 400;  /* 减小字重 */
    font-size: 0.625rem;  /* 更小的字体 */
    white-space: nowrap;  /* 防止换行 */
}

.qed-range-dot.qed-excellent {
    background-color: #10b981;
}

.qed-range-dot.qed-good {
    background-color: #f59e0b;
}

.qed-range-dot.qed-poor {
    background-color: #ef4444;
}

.qed-range-text {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.75rem;
}


/* Structure Preview */
.structure-preview-container {
    position: sticky;
    top: 2rem;
    margin-bottom: 1.5rem;
    z-index: 5; /* 添加层级 */
}

.structure-preview-box {
    width: 100%;
    height: 200px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.structure-preview-box:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.structure-svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.structure-loading {
    text-align: center;
    color: #6b7280;
}

/* 3D Model Container */
.model-container {
    position: sticky;
    top: calc(160px + 4rem + 1.5rem); /* 结构预览高度 + top值 + margin */
    z-index: 4; /* 稍低于2D结构 */
}

#mol-viewer {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    transition: all 0.3s ease;
    height: 24rem; /* h-96 equivalent */
}

#mol-viewer:hover {
    border-color: #94a3b8;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Cross References */
.cross-references-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fafafa;
}

.cross-references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
}

.cross-ref-item {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.cross-ref-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.cross-ref-db {
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
    margin-right: 0.5rem;
}

.cross-ref-id {
    font-size: 0.75rem;
    color: #374151;
    font-family: 'Courier New', monospace;
    flex: 1;
    text-align: right;
}

.cross-ref-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Protein Table Styles */
.protein-table-container {
    max-height: 600px;
    overflow-y: auto;
    border-top: 1px solid #e5e7eb;
}

.protein-table-header {
    position: sticky;
    top: 0;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    z-index: 10;
}

.protein-th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid #e5e7eb;
}

.protein-table-body tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.protein-table-body tr:hover {
    background-color: #f8fafc;
}

.protein-table-body td {
    padding: 1rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

/* Action Buttons in Table */
.protein-action-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    margin-right: 0.25rem;
}

.protein-action-btn-primary {
    background-color: #10b981;
    color: white;
}

.protein-action-btn-primary:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.protein-action-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.protein-action-btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Page Navigation */
.page-number {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.page-number:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.page-number.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-number.active:hover {
    background-color: #2563eb;
}

/* Responsive Design */
/* 响应式调整 */
@media (max-width: 1024px) {
    .structure-preview-container {
        position: static; /* 在中等屏幕取消sticky */
    }
    
    .model-container {
        position: static; /* 在中等屏幕取消sticky */
    }
    
    .qed-components-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cross-references-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .info-item {
        padding: 0.75rem;
    }
    
    .drug-property-card {
        padding: 0.75rem;
    }
    
    .qed-breakdown {
        padding: 1rem;
    }
    
    .qed-component {
        padding: 0.5rem;
    }
    
    .qed-components-grid {
        grid-template-columns: 1fr;
    }
    
    .structure-preview-box {
        height: 120px;
    }
    
    #mol-viewer {
        height: 16rem;
    }
    
    .protein-th,
    .protein-table-body td {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }
    
    .structure-preview-container {
        position: static; /* 在小屏幕取消sticky */
    }
    
    .model-container {
        position: static; /* 在小屏幕取消sticky */
    }
    
    .cross-references-grid {
        grid-template-columns: 1fr;
    }
}

/* QED Information Panel - 适配右侧列 */
.qed-info-panel {
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.qed-info-panel:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.qed-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.qed-info-content {
    color: #374151;
}

.qed-components-explanation {
    display: grid;
    grid-template-columns: 1fr; /* 右侧列较窄，使用单列 */
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #f3f4f6;
}

.qed-component-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

.qed-component-abbr {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
    background: #dbeafe;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    min-width: 2.75rem;
    text-align: center;
    margin-right: 0.5rem;
}

.qed-component-desc {
    font-size: 0.75rem;
    color: #6b7280;
    flex: 1;
}

/* QED Score Legend */
.qed-score-legend {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.qed-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.qed-legend-color {
    width: 0.75rem;
    height: 0.375rem;
    border-radius: 0.25rem;
}

.qed-excellent {
    background: linear-gradient(90deg, #10b981, #059669);
}

.qed-good {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.qed-poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .qed-info-panel {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .qed-info-panel {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .qed-component-abbr {
        min-width: 2.5rem;
        font-size: 0.625rem;
    }
    
    .qed-component-desc {
        font-size: 0.6875rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Custom Scrollbar for Table */
.protein-table-container::-webkit-scrollbar,
.cross-references-container::-webkit-scrollbar {
    width: 8px;
}

.protein-table-container::-webkit-scrollbar-track,
.cross-references-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.protein-table-container::-webkit-scrollbar-thumb,
.cross-references-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.protein-table-container::-webkit-scrollbar-thumb:hover,
.cross-references-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


