/* 3D Preview Page Specific Styles */

/* Preview Section */
.preview-section {
    position: relative;
    background: #18181c;
}

/* Preview Header */
.preview-header {
    color: #fff;
}

.preview-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
}

@media (max-width: 768px) {
    .preview-title {
        font-size: 1.8rem;
    }
}

/* File Info */
.file-info {
    color: #999;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.file-name {
    color: #ccc;
    font-family: monospace;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.preview-actions .btn {
    min-width: 150px;
    padding: 0.75rem 1.5rem;
}

/* Preview Tips */
.preview-tips {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.preview-tips i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Model Viewer Container */
.preview-container {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#container {
    width: 100%;
    height: 600px;
    position: relative;
    /* 居中显示内容 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 确保 canvas 元素居中并响应式 */
#container canvas {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: auto;
    /* 保持宽高比 */
    object-fit: contain;
}

/* 如果 three.js 使用了包装器 */
#container > div {
    width: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    #container {
        height: 400px;
    }
}

/* 全屏模式样式 */
#container:fullscreen {
    height: 100vh !important;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#container:fullscreen canvas {
    max-width: 100vw !important;
    max-height: 100vh !important;
}

/* 修复 Three.js 的默认样式 */
#container .webgl,
#container [data-engine*="three"] {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content p {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #ccc;
}

/* Error Overlay */
.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.error-content {
    text-align: center;
    color: #fff;
}

.error-content i {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.2rem;
    color: #ccc;
}

/* Model Info Panel */
.model-info-panel {
    margin-top: 3rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    color: #fff;
    height: 100%;
}

.info-card h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-card h5 i {
    margin-right: 0.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #ccc;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    max-width: 600px;
    margin: 2rem auto;
    border-radius: 8px;
    padding: 2rem;
}

.alert i {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
    color: #666;
    content: "/";
}

/* Fullscreen Mode */
#container:fullscreen {
    height: 100vh !important;
    background: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .preview-actions {
        flex-direction: column;
    }

    .preview-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .model-info-panel .col-md-6:not(:last-child) {
        margin-bottom: 1rem;
    }
}

/* Dark Theme Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* 快捷键通知样式 */
.keyboard-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.keyboard-notification.fade-out {
    animation: slideOutRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 更新快捷键列表样式 */
.info-list kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    font-family: monospace;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}