/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

.app-container {
    display: flex;
    height: 100vh;
    background: #0f0f0f;
}

/* Left Sidebar - Meshy Style */
.sidebar {
    width: 280px;
    background: #1a1a1a;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00d4aa, #0078d4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.logo-text p {
    font-size: 12px;
    color: #888888;
}

/* Upload section */
.upload-section {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.section-title {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 14px;
    color: #00d4aa;
}

.upload-area {
    background: #222222;
    border: 2px dashed #333333;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    background: #252525;
    border-color: #444444;
}

.upload-icon {
    width: 48px;
    height: 48px;
    background: #2a2a2a;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #888888;
    font-size: 20px;
    transition: all 0.2s ease;
}

.upload-area:hover .upload-icon {
    background: #333333;
    color: #00d4aa;
}

.upload-text {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 6px;
    font-weight: 500;
}

.upload-subtext {
    font-size: 12px;
    color: #888888;
}

.file-input {
    display: none;
}

/* File info */
.file-info-compact {
    margin-top: 16px;
    padding: 16px;
    background: #222222;
    border-radius: 8px;
    display: none;
}

.file-info-compact.show {
    display: block;
}

.file-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 13px;
    margin-bottom: 4px;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-name i {
    color: #00d4aa;
    font-size: 14px;
}

.file-size {
    font-size: 11px;
    color: #888888;
}

/* Scrollable content */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-scroll::-webkit-scrollbar {
    display: none;
}

/* Collapsible sections */
.collapsible-section {
    border-bottom: 1px solid #2a2a2a;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.section-header:hover {
    background: #222222;
}

.section-title-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
}

.section-title-flex i {
    font-size: 14px;
    color: #00d4aa;
}

.section-chevron {
    font-size: 12px;
    color: #888888;
    transition: transform 0.2s ease;
}

.section-content {
    padding: 0 20px 20px 20px;
    display: none;
}

.section-content.show {
    display: block;
}

.collapsible-section.expanded .section-chevron {
    transform: rotate(180deg);
}

/* Settings */
.setting-group {
    margin-bottom: 24px;
}

.setting-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 10px;
}

/* Enhanced slider container with input */
.slider-container {
    position: relative;
}

.slider-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.slider {
    flex: 1;
    height: 6px;
    background: #333333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.slider-value-input {
    background: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    padding: 4px 8px;
    width: 80px;
    text-align: center;
    transition: border-color 0.2s ease;
}

.slider-value-input:focus {
    outline: none;
    border-color: #00d4aa;
}

.slider-value {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
}

/* Target count specific styling */
.target-count-info {
    font-size: 11px;
    color: #888888;
    margin-top: 4px;
    line-height: 1.3;
}

.target-count-warning {
    color: #ff6b6b;
    font-weight: 500;
}

.target-count-optimal {
    color: #00d4aa;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.checkbox {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    accent-color: #00d4aa;
}

.checkbox-label {
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
}

.symmetry-controls {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}


   /* Enabled/Active state - bright and glowing */
#remeshBtn:not(:disabled) {
    background: #1a1a1a !important;
    color: #00d4aa !important;
    border-color: #00d4aa !important;
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.2), inset 0 0 20px rgba(0, 212, 170, 0.05) !important;
    opacity: 1 !important;
}

#remeshBtn:not(:disabled) i {
    color: #00d4aa !important;
    filter: drop-shadow(0 0 3px rgba(0, 212, 170, 0.8)) !important;
}

/* Hover state - even brighter */
#remeshBtn:hover:not(:disabled) {
    background: #00d4aa !important;
    color: #000000 !important;
    border-color: #00d4aa !important;
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.4), inset 0 0 30px rgba(0, 212, 170, 0.1) !important;
    transform: translateY(-1px);
}

#remeshBtn:hover:not(:disabled) i {
    color: #000000 !important;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3)) !important;
}

/* Disabled state - dark and muted */
#remeshBtn:disabled {
    cursor: not-allowed;
    transform: none !important;
}

/* Optional: Pulsing animation when enabled */
#remeshBtn:not(:disabled) {
    animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 212, 170, 0.2), inset 0 0 20px rgba(0, 212, 170, 0.05);
    }
    50% { 
        box-shadow: 0 0 25px rgba(0, 212, 170, 0.3), inset 0 0 25px rgba(0, 212, 170, 0.08);
    }
}

/* Select */
.format-select {
    width: 100%;
    padding: 12px;
    background: #222222;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
}

.format-select:disabled {
    background: #2a2a2a;
    color: #555555;
    border-color: #333333;
    cursor: not-allowed;
}

.format-select option {
    background: #222222;
    color: #ffffff;
}

/* Mesh stats - clean cards */
.mesh-stats-compact {
    background: #222222;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.stats-header {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-header i {
    font-size: 14px;
    color: #00d4aa;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
}

.stats-row:last-child {
    margin-bottom: 0;
}

.stat-name {
    color: #888888;
    font-weight: 400;
}

.stat-value {
    color: #ffffff;
    font-weight: 500;
}

.stat-value.result {
    color: #00d4aa;
}

/* Main Content Area - Now using consistent background */
.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;
}

/* Topology Controls - Clean and Compact */
.topology-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #333333;
}

.topology-label {
    font-size: 12px;
    color: #969696;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.topology-label i {
    font-size: 14px;
    color: #00d4aa;
}

/* Simple, Clean Toggle Switch */
.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #404040;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #00d4aa;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

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

/* Compact Color Picker */
.edge-color-picker {
    width: 24px;
    height: 24px;
    border: 1px solid #444444;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
    transition: all 0.2s ease;
}
.edge-color-picker:focus {
    outline: none;
    border-color: #00d4aa;
}

/* Edge Loading State */
.edge-loading-inline {
    margin-left: 8px;
    color: #00d4aa;
    font-size: 12px;
    display: inline-block;
}

.edge-loading-inline i {
    display: inline-block;
    animation: spin 0.8s linear infinite;
    /* Force hardware acceleration */
    transform-origin: center center;
    will-change: transform;
}

/* Alternative spinning class */
.spinning {
    animation: spin 0.8s linear infinite !important;
}

/* Wireframe Toggle Text - Clean and Simple */
.wireframe-toggle-overlay {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    text-align: center;
}

.wireframe-toggle-text {
    color: #00d4aa;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
    background: rgba(26, 26, 26, 0.8);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

/* Viewer Loading Overlay */
.viewer-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.viewer-loading-content {
    text-align: center;
}

.viewer-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 3px solid rgba(0, 212, 170, 0.2);
    border-top: 3px solid #00d4aa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.viewer-loading-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.viewer-loading-subtext {
    color: #888888;
    font-size: 13px;
}

/* Ensure the spin animation is defined */
@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

/* Alternative spinning class */
.spinning {
    animation: spin 0.8s linear infinite !important;
}

/* Ensure the spin animation is defined */
@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

/* Viewer Area - Now consistent with sidebar */
.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;
}

/* Enhanced Loading Overlay Styles */
.main-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.loading-card {
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 20px;
    padding: 48px;
    min-width: 400px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: loadingCardEntry 0.4s ease-out;
}

@keyframes loadingCardEntry {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}


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

.main-loading-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 32px;
    position: relative;
}

.main-loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid #333333;
    border-radius: 50%;
}

.main-loading-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-top-color: #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


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

.loading-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.loading-subtitle {
    font-size: 16px;
    color: #888888;
    margin-bottom: 32px;
    line-height: 1.5;
}

.loading-progress-container {
    margin-bottom: 24px;
}


/* Enhanced Progress Bar */
.loading-progress-container {
    width: 100%;
    margin-bottom: 16px;
}

.loading-progress-bar {
    height: 6px;
    background: #2a2a2a;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}


.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #0078d4);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
}

.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: 14px;
    color: #cccccc;
    font-weight: 500;
}

.loading-details {
    font-size: 13px;
    color: #666666;
    font-style: italic;
    margin-top: 16px;
    line-height: 1.5;
    min-height: 20px;
    animation: fadeInOut 0.5s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}



/* Quick loading states for smaller operations */
.quick-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00d4aa;
    font-size: 12px;
    font-weight: 500;
}

.quick-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #3e3e42;
    border-top: 2px solid #00d4aa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Fix for 3D viewer display issues */
#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;
}

/* License Key Modal */
.license-modal-overlay, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.license-modal-overlay.show, .modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.license-modal, .modal {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.4s ease-out;
}

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

.license-modal-header, .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.license-modal-icon, .modal-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4aa, #0078d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.license-modal-title, .modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.license-modal-subtitle, .modal-subtitle {
    font-size: 14px;
    color: #888888;
    margin: 0;
}

.license-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.license-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.license-input-label {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
}

.license-input {
    padding: 12px 16px;
    background: #222222;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.license-input:focus {
    outline: none;
    border-color: #00d4aa;
}

.license-input::placeholder {
    color: #666666;
}

.license-modal-buttons, .modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.license-btn, .modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.license-btn-primary, .modal-btn-primary {
    background: #00d4aa;
    color: #000000;
}

.license-btn-primary:hover, .modal-btn-primary:hover {
    background: #00c298;
    transform: translateY(-1px);
}

.license-btn-secondary, .modal-btn-secondary {
    background: #333333;
    color: #ffffff;
    border: 1px solid #444444;
}

.license-btn-secondary:hover, .modal-btn-secondary:hover {
    background: #3a3a3a;
    border-color: #555555;
}

/* License Key Button in Top Bar */
.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;
}

/* Setting group headers */
.setting-group-header {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Subscription Modal */
.subscription-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.subscription-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.subscription-iframe-container {
    width: 100%;
    height: 100%;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    animation: subscriptionModalSlideIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
}

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

.subscription-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

.subscription-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.subscription-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.subscription-header {
    background: linear-gradient(135deg, #00d4aa, #0078d4);
    color: white;
    padding: 20px 24px;
    flex-shrink: 0;
}

.subscription-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.subscription-header p {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Triangle Limit Modal Styles */
.triangle-limit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.triangle-limit-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.triangle-limit-modal {
    background: #2d2d30;
    border: 1px solid #ff6b6b;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.3);
    animation: triangleLimitModalSlideIn 0.4s ease-out;
}

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

.triangle-limit-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ff6b6b40;
}

.triangle-limit-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.triangle-limit-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.triangle-limit-subtitle {
    font-size: 14px;
    color: #cccccc;
    margin: 0;
}

.triangle-limit-content {
    margin-bottom: 24px;
}

.triangle-limit-stats {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #333333;
}

.limit-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.limit-stat:last-child {
    margin-bottom: 0;
    border-top: 1px solid #333333;
    padding-top: 12px;
}

.limit-label {
    font-size: 14px;
    color: #888888;
    font-weight: 500;
}

.limit-value {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.limit-value.exceeded {
    color: #ff6b6b;
}

.triangle-limit-message {
    font-size: 15px;
    color: #cccccc;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.triangle-limit-benefits {
    background: #222222;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #333333;
}

.triangle-limit-benefits h4 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.triangle-limit-benefits h4::before {
    content: '🚀';
    font-size: 16px;
}

.triangle-limit-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.triangle-limit-benefits li {
    font-size: 13px;
    color: #cccccc;
    margin-bottom: 6px;
    padding-left: 0;
}

.triangle-limit-benefits li:last-child {
    margin-bottom: 0;
}

.triangle-limit-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.triangle-limit-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.triangle-limit-btn-primary {
    background: linear-gradient(135deg, #00d4aa, #0078d4);
    color: #000000;
}

.triangle-limit-btn-primary:hover {
    background: linear-gradient(135deg, #00c298, #0066b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.triangle-limit-btn-secondary {
    background: #333333;
    color: #ffffff;
    border: 1px solid #555555;
}

.triangle-limit-btn-secondary:hover {
    background: #3a3a3a;
    border-color: #666666;
}

/* Plan-specific license button styles */
.license-key-btn.plan-hobby {
    background: linear-gradient(135deg, #888888, #666666);
    border-color: #888888;
}

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

.license-key-btn.plan-lifetime {
    background: linear-gradient(135deg, #ffd70020, #ff880020);
    border-color: #ffd700;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    .loading-card {
        min-width: 280px;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
    
    .top-bar {
        height: 40px;
        padding: 0 12px;
    }
    
    .tab {
        padding: 0 12px;
        font-size: 11px;
    }
    
    .loading-card {
        min-width: 250px;
        padding: 24px;
        margin: 20px;
    }
    
    .main-loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .loading-title {
        font-size: 16px;
    }
    
    /* Mobile responsiveness for triangle limit modal */
    .triangle-limit-modal {
        margin: 20px;
        padding: 24px;
        max-width: none;
    }
    
    .triangle-limit-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .triangle-limit-buttons {
        flex-direction: column;
    }
    
    .triangle-limit-btn {
        margin-bottom: 8px;
    }
    
    .triangle-limit-btn:last-child {
        margin-bottom: 0;
    }
    
    /* Minimalist Upgrade Button - Add to existing <style> section */
    .upgrade-section {
        padding: 0 20px 20px 20px;
    }
    
    .upgrade-container {
        display: none; /* Hidden by default */
        padding: 0;
        margin-top: 12px;
    }
    
    .upgrade-btn {
        width: 100%;
        padding: 10px 12px;
        background: #2a2a2a;
        border: 1px solid #3a3a3a;
        border-radius: 6px;
        color: #cccccc;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    
    .upgrade-btn:hover {
        background: #333333;
        border-color: #00d4aa;
        color: #ffffff;
    }
    
    .upgrade-btn i {
        font-size: 12px;
        opacity: 0.7;
    }
    
    .upgrade-btn:hover i {
        opacity: 1;
        color: #00d4aa;
    }
}

/* Premium Upgrade Button Styles - Unified Colors */
.upgrade-section {
    padding: 16px 20px 20px 20px;
}

.upgrade-container {
    display: none; /* Hidden by default */
    padding: 0;
    margin-top: 0;
}

.upgrade-btn {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e2a2e, #2a3a3e);
    border: 1px solid #00d4aa40;
    border-radius: 10px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.15), transparent);
    transition: left 0.6s ease;
}

.upgrade-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05), rgba(0, 120, 212, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upgrade-btn:hover::before {
    left: 100%;
}

.upgrade-btn:hover::after {
    opacity: 1;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #2a3a3e, #334a4e);
    border-color: #00d4aa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.25);
}

.upgrade-btn i {
    font-size: 16px;
    color: #00d4aa;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.upgrade-btn:hover i {
    transform: translateY(-1px) scale(1.1);
    filter: brightness(1.3) drop-shadow(0 0 4px rgba(0, 212, 170, 0.6));
}

.upgrade-btn span {
    position: relative;
    z-index: 1;
}

/* Subtle pulse animation for the icon */
@keyframes upgradeIconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.upgrade-btn i {
    animation: upgradeIconPulse 3s ease-in-out infinite;
}

.upgrade-btn:hover i {
    animation: none;
}

/* Upgrade notice and replacement styles */
.upgrade-notice {
    background: #2a2a2a;
    border: 1px solid #ffab40;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    text-align: center;
}

.upgrade-replacement {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Estimated badge for stats */
.estimated-badge {
    background: #ffab40;
    color: #000;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

/* Triangle limit notice in upload area */
.triangle-limit-notice {
    font-size: 11px;
    color: #ffab40;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(255, 171, 64, 0.1);
    border-radius: 4px;
    text-align: center;
}

/* Direct triangle modal styles (fallback) */
.direct-triangle-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2147483647 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: white !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Worker Monitor Styles
.worker-monitor-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.worker-monitor-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}

.worker-monitor-header i {
    color: #00d4aa;
}

.worker-monitor-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.worker-monitor-panel.expanded .worker-monitor-toggle i {
    transform: rotate(180deg);
}

.worker-monitor-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.worker-monitor-panel.expanded .worker-monitor-content {
    max-height: 400px;
    overflow-y: auto;
}

.worker-item {
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a2a;
}

.worker-item:last-child {
    border-bottom: none;
}

.worker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.worker-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.worker-last-seen {
    font-size: 12px;
    color: #666;
} */

.worker-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.worker-stat {
    display: flex;
    gap: 4px;
}

.stat-label {
    color: #666;
}

.stat-value {
    color: #fff;
    font-weight: 500;
}

.worker-current-job {
    margin-top: 8px;
    padding: 4px 8px;
    background: #2a2a2a;
    border-radius: 4px;
    font-size: 11px;
    color: #ffab40;
}

.worker-idle {
    opacity: 0.8;
}

.worker-busy {
    background: rgba(255, 171, 64, 0.1);
}

.worker-offline {
    opacity: 0.5;
}

/* Close button for daily limit modal */
.daily-limit-modal .modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.daily-limit-modal .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.daily-limit-modal .modal-close-btn:active {
    transform: scale(0.95);
}

/* Make sure the modal has relative positioning for the absolute close button */
.daily-limit-modal {
    position: relative;
    background: #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    text-align: center;
}