/* Main Content and Viewer Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    position: relative;
}

/* Top Bar */
.top-bar {
    height: 48px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.view-tabs {
    display: flex;
    gap: 0;
    height: 100%;
    align-items: stretch;
}

.tab {
    padding: 0 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #969696;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    gap: 6px;
}

.tab i {
    font-size: 14px;
}

.tab.active {
    color: #ffffff;
    border-bottom-color: #0078d4;
    background: #1a1a1a;
}

.tab.active i {
    color: #00d4aa;
}

.tab:hover:not(.active) {
    color: #cccccc;
    background: #383838;
}

/* Hide result tab initially */
.tab.result-tab {
    display: none;
}

.tab.result-tab.show {
    display: flex;
}

.view-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-btn {
    padding: 6px 12px;
    background: #383838;
    border: 1px solid #555555;
    border-radius: 3px;
    color: #cccccc;
    cursor: pointer;
    font-size: 11px;
    font-weight: 400;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-btn:hover {
    background: #404040;
    border-color: #666666;
    color: #ffffff;
}

.view-btn i {
    font-size: 12px;
}

/* License Key Button */
.license-key-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: #383838;
    border: 1px solid #555555;
    border-radius: 3px;
    color: #cccccc;
    cursor: pointer;
    font-size: 11px;
    font-weight: 400;
    transition: all 0.15s ease;
}

.license-key-btn:hover {
    background: #404040;
    border-color: #666666;
    color: #ffffff;
}

.license-key-btn.licensed {
    background: linear-gradient(135deg, #00d4aa20, #0078d420);
    border-color: #00d4aa;
    color: #ffffff;
}

.license-key-btn.licensed:hover {
    background: linear-gradient(135deg, #00d4aa30, #0078d430);
}

.license-key-btn i {
    font-size: 12px;
}

.license-status-text {
    font-size: 11px;
    opacity: 0.8;
}

/* Topology Controls */
.topology-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #383838;
    border-radius: 3px;
    border: 1px solid #555555;
}

.topology-label {
    font-size: 11px;
    color: #969696;
    margin-right: 4px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.topology-label i {
    font-size: 12px;
}

.toggle-switch {
    position: relative;
    width: 24px;
    height: 12px;
    background: #555555;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: #0078d4;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(12px);
}

.edge-color-picker {
    width: 18px;
    height: 12px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    background: none;
    padding: 0;
    margin-left: 4px;
}

/* Viewer Container */
.viewer-container {
    flex: 1;
    position: relative;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.viewer-placeholder {
    text-align: center;
    color: #969696;
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    background: #2a2a2a;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #555555;
    font-size: 24px;
}

.placeholder-text {
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #cccccc;
}

.placeholder-subtext {
    font-size: 11px;
    color: #969696;
    line-height: 1.4;
}

/* 3D Viewer Elements */
#originalViewer, #resultViewer {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#originalViewer canvas, #resultViewer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Loading Overlay */
.main-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.main-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-card {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    min-width: 320px;
    animation: slideInUp 0.4s ease-out;
}

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

.main-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #3e3e42;
    border-top: 3px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

.loading-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.loading-subtitle {
    font-size: 14px;
    color: #969696;
    margin-bottom: 24px;
    line-height: 1.4;
}

.loading-progress-container {
    width: 100%;
    margin-bottom: 16px;
}

.loading-progress-bar {
    width: 100%;
    height: 6px;
    background: #3e3e42;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #0078d4);
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease;
    position: relative;
}

.loading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-progress-text {
    font-size: 13px;
    color: #cccccc;
    font-weight: 500;
}

.loading-details {
    font-size: 12px;
    color: #888888;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #3e3e42;
}