/* ========================================== */
/* Preview AppConfig Page Styles */
/* Matches appConfig-history.css and diff-viewer.css patterns */
/* ========================================== */

/* Container */
.preview-config-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.preview-config-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 95vw;
    height: 95vh;
    margin: 2.5vh 2.5vw;
    max-width: none;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Header */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.preview-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #495057;
}

.file-info {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #6c757d;
}

.info-item {
    display: inline-block;
}

.header-right {
    display: flex;
    gap: 10px;
}

.header-right .btn i {
    margin-right: 6px;
}

/* Loading State */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.spinner-wrapper {
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073bb;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 16px;
    color: #6c757d;
}

/* Error States */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px;
}

.error-content {
    text-align: center;
    max-width: 600px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-icon.icon-info {
    color: #0073bb;
}

.error-icon.icon-clock {
    color: #ff9900;
}

.error-icon.icon-error {
    color: #d13212;
}

.error-title {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #495057;
}

.error-message {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 16px;
    line-height: 1.4;
}

.error-action {
    font-size: 14px;
    color: #0073bb;
    margin-bottom: 20px;
}

.error-action i {
    margin-right: 6px;
}

.support-link {
    display: inline-block;
    margin-left: 8px;
    color: #0073bb;
    text-decoration: none;
    font-weight: 600;
}

.retry-btn {
    margin-top: 10px;
}

.technical-details {
    margin-top: 20px;
    text-align: left;
}

.technical-details summary {
    cursor: pointer;
    color: #0073bb;
    font-size: 14px;
}

.technical-details pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    max-height: 200px;
    overflow: auto;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
}

/* Performance Warning Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-dialog.performance-warning {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
}

.modal-dialog.performance-warning .modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-dialog.performance-warning .modal-header i {
    font-size: 24px;
    color: #ff9900;
}

.modal-dialog.performance-warning .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

.modal-dialog.performance-warning .modal-body {
    padding: 20px;
}

.modal-dialog.performance-warning .modal-body p {
    margin-bottom: 12px;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

.modal-dialog.performance-warning .modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Monaco Editor */
.editor-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #fff;
}

.monaco-editor-wrapper {
    width: 100%;
    height: 100%;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #232f3e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 3000;
    animation: slideIn 0.3s ease-out;
}

.toast-notification.toast-error {
    background: #d13212;
}

.toast-notification i {
    font-size: 18px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .preview-config-container {
        width: 95%;
        height: calc(100vh - 60px);
    }

    .preview-header {
        flex-direction: column;
        gap: 15px;
    }

    .file-info {
        flex-direction: column;
        gap: 8px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
}
