/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

/* App layout */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header-left .logo {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.framework-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 4px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #374151;
}

.tab-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.terminal-size-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
}

.terminal-size-controls label {
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.preset-select {
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    min-width: 160px;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-inputs input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.size-inputs span {
    color: #718096;
    font-weight: 500;
}

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

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #4a5568;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 20px;
}

.sidebar-section h3 {
    color: #2d3748;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.element-category {
    margin-bottom: 24px;
}

.element-category h4 {
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.element-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.element-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.element-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.element-item:active {
    cursor: grabbing;
}

.element-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.element-item span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
}

/* Canvas area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(248, 250, 252, 0.5);
}

.canvas-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-title h3 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.canvas-info {
    color: #718096;
    font-size: 14px;
    margin-left: 8px;
}

.canvas-controls {
    display: flex;
    gap: 8px;
}

.canvas-container {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas {
    position: relative;
    background: #1a202c;
    border-radius: 12px;
    border: 2px solid #2d3748;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    min-height: 400px;
}

.terminal-preview {
    width: 100%;
    height: 100%;
    position: relative;
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Lucida Console', 'Liberation Mono', monospace;
    font-size: 12px;
    line-height: 1;
    background: #1a202c;
    color: #f7fafc;
    letter-spacing: 5px;
    font-weight: 500;
}

.terminal-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    pointer-events: none;
}

.terminal-grid.visible {
    opacity: 0.3;
}

.terminal-cell {
    position: absolute;
    border: 1px solid #4a5568;
    width: var(--cell-width);
    height: var(--cell-height);
}

.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 32, 44, 0.8);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}

.drop-zone.hidden {
    opacity: 0;
    pointer-events: none;
}

.drop-zone.drag-over {
    background: rgba(102, 126, 234, 0.2);
}

.drop-zone-content {
    text-align: center;
    color: #cbd5e0;
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.drop-zone-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e2e8f0;
}

.drop-zone-content p {
    font-size: 14px;
    opacity: 0.7;
}

/* UI Elements */
.ui-element {
    position: absolute;
    border: 2px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s;
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Lucida Console', 'Liberation Mono', monospace;
    letter-spacing: 5px;
    font-weight: 500;
}

.ui-element:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.ui-element.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.ui-element.dragging {
    z-index: 1000;
    opacity: 0.8;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    background: #667eea;
    border: 2px solid white;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.ui-element.selected .resize-handle {
    opacity: 1;
}

.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.resize-handle.n { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.w { top: 50%; left: -4px; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.e { top: 50%; right: -4px; transform: translateY(-50%); cursor: e-resize; }

/* Properties panel */
.properties-panel {
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.properties-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.properties-header h3 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.properties-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.no-selection {
    text-align: center;
    color: #718096;
    padding: 40px 20px;
}

.no-selection-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.property-group {
    margin-bottom: 20px;
}

.property-group h4 {
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.property-field {
    margin-bottom: 12px;
}

.property-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-field input,
.property-field select,
.property-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.property-field input:focus,
.property-field select:focus,
.property-field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.property-field textarea {
    resize: vertical;
    min-height: 60px;
}

.color-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-input select {
    flex: 1;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal.large .modal-content {
    max-width: 900px;
    max-height: 90vh;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #2d3748;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Export modal */
.export-intro {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.export-intro p {
    color: var(--xcc-text-dim, #718096);
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.export-format-selector {
    margin-bottom: 30px;
}

.export-format-selector h4 {
    margin: 0 0 20px 0;
    color: var(--xcc-text, #2d3748);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.export-option {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.export-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.export-option:hover {
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.export-option:hover::before {
    left: 100%;
}

.export-option.active {
    border-color: var(--xcc-accent, #667eea);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.export-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.export-option label {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
}

.export-option-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--xcc-accent, #667eea), var(--xcc-accent-alt, #764ba2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.export-option-content strong {
    display: block;
    color: var(--xcc-text, #2d3748);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.export-option-content small {
    display: block;
    color: var(--xcc-text-dim, #718096);
    font-size: 14px;
    line-height: 1.3;
}

.export-preview {
    margin-bottom: 30px;
}

.export-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.export-preview-header h4 {
    margin: 0;
    color: var(--xcc-text, #2d3748);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--xcc-text-dim, #718096);
}

.export-stats span {
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    font-weight: 500;
}

.code-output {
    background: linear-gradient(145deg, #1a202c, #2d3748);
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    overflow: hidden;
    position: relative;
}

.code-output::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--xcc-accent, #667eea), var(--xcc-accent-alt, #764ba2));
}

.code-output pre {
    margin: 0;
    padding: 24px;
    overflow-x: auto;
    max-height: 400px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.code-output code {
    color: #e2e8f0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Enhanced modal actions for export */
#exportModal .modal-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

#exportModal .btn-action {
    background: linear-gradient(135deg, #38a169, #68d391);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

#exportModal .btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#exportModal .btn-action:hover::before {
    left: 100%;
}

#exportModal .btn-primary {
    background: linear-gradient(135deg, var(--xcc-accent, #667eea), var(--xcc-accent-alt, #764ba2));
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

#exportModal .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#exportModal .btn-primary:hover::before {
    left: 100%;
}

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

.code-output pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    max-height: 400px;
}

.code-output code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Import modal */
.import-intro {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.import-intro p {
    color: var(--xcc-text-dim, #718096);
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.import-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.import-method {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.import-method::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.import-method:hover {
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.import-method:hover::before {
    left: 100%;
}

.import-method-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.import-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--xcc-accent, #667eea), var(--xcc-accent-alt, #764ba2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.import-method-header h4 {
    margin: 0 0 4px 0;
    color: var(--xcc-text, #2d3748);
    font-size: 18px;
    font-weight: 600;
}

.import-method-header p {
    margin: 0;
    color: var(--xcc-text-dim, #718096);
    font-size: 14px;
    line-height: 1.4;
}

.file-drop-zone {
    position: relative;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(102, 126, 234, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.05);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.file-drop-content p {
    margin: 0 0 8px 0;
    color: var(--xcc-text, #2d3748);
    font-size: 16px;
}

.file-drop-content small {
    color: var(--xcc-text-dim, #718096);
    font-size: 14px;
}

.import-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.import-divider::before,
.import-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.import-divider span {
    padding: 0 20px;
    background: var(--xcc-bg2, #f8fafc);
    color: var(--xcc-text-dim, #718096);
    font-weight: 600;
    font-size: 14px;
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.code-input-container {
    position: relative;
}

.code-input-container textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.02);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: var(--xcc-text, #2d3748);
    resize: vertical;
    transition: all 0.3s ease;
}

.code-input-container textarea:focus {
    outline: none;
    border-color: var(--xcc-accent, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(102, 126, 234, 0.02);
}

.code-input-container textarea::placeholder {
    color: var(--xcc-text-fade, #a0aec0);
    opacity: 1;
}

/* Enhanced modal actions for import */
#importModal .modal-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
}

#importModal .btn-primary {
    background: linear-gradient(135deg, var(--xcc-accent, #667eea), var(--xcc-accent-alt, #764ba2));
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

#importModal .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#importModal .btn-primary:hover::before {
    left: 100%;
}

#importModal .btn-primary span {
    position: relative;
    z-index: 1;
}

/* Preview modal */
.preview-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-container {
    background: #1a202c;
    border-radius: 8px;
    padding: 20px;
    overflow: auto;
}

.terminal-simulation {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #1a202c;
    color: #f7fafc;
    border-radius: 4px;
    min-height: 300px;
    position: relative;
}

/* Hierarchy modal */
.hierarchy-tree {
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
}

.hierarchy-item {
    padding: 4px 0;
    cursor: pointer;
    border-radius: 4px;
    padding-left: 8px;
    padding-right: 8px;
}

.hierarchy-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.hierarchy-item.selected {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    font-weight: 500;
}

.hierarchy-indent {
    margin-left: 20px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    
    .properties-panel {
        width: 280px;
    }
    
    .element-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-center {
        order: 3;
        width: 100%;
    }
    
    .terminal-size-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Chart Designer Styles */
.chart-designer-container {
    display: flex;
    gap: 20px;
    height: 500px;
}

.chart-config-panel {
    flex: 1;
    max-width: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.chart-preview-panel {
    flex: 1;
    border-left: 1px solid #e2e8f0;
    padding-left: 20px;
}

.config-group {
    margin-bottom: 20px;
}

.config-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2d3748;
}

.config-group h5 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.config-group input,
.config-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

.series-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.series-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px;
}

.series-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.series-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
}

.series-name {
    font-weight: 600;
    color: #2d3748;
}

.series-controls-inline {
    display: flex;
    gap: 5px;
}

.data-points {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.data-points input {
    padding: 4px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-size: 12px;
}

.chart-preview {
    width: 100%;
    height: 300px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chart-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.chart-designer-controls {
    display: flex;
    flex-direction: column;
}

.chart-designer-controls textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.preview-info {
    margin-top: 10px;
    text-align: center;
    color: #718096;
}

/* Chart preview visualization */
.chart-preview-line {
    position: absolute;
    background: #3182ce;
    height: 2px;
}

.chart-preview-bar {
    position: absolute;
    background: #38a169;
    bottom: 20px;
}

.chart-preview-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #e53e3e;
    border-radius: 50%;
    transform: translate(-3px, -3px);
}

.chart-axis {
    position: absolute;
    background: #a0aec0;
}

.chart-axis-x {
    bottom: 20px;
    left: 40px;
    right: 20px;
    height: 1px;
}

.chart-axis-y {
    left: 40px;
    top: 20px;
    bottom: 20px;
    width: 1px;
}

.chart-label {
    position: absolute;
    font-size: 10px;
    color: #4a5568;
}

/* CC:Tweaked color classes */
.cc-color-white { background-color: #f0f0f0; color: #000; }
.cc-color-orange { background-color: #f2b233; color: #000; }
.cc-color-magenta { background-color: #e57fd8; color: #000; }
.cc-color-lightBlue { background-color: #99b2f2; color: #000; }
.cc-color-yellow { background-color: #dede6c; color: #000; }
.cc-color-lime { background-color: #7fcc19; color: #000; }
.cc-color-pink { background-color: #f2b2cc; color: #000; }
.cc-color-gray { background-color: #4c4c4c; color: #fff; }
.cc-color-lightGray { background-color: #999999; color: #000; }
.cc-color-cyan { background-color: #4c99b2; color: #fff; }
.cc-color-purple { background-color: #b266e5; color: #fff; }
.cc-color-blue { background-color: #3366cc; color: #fff; }
.cc-color-brown { background-color: #7f664c; color: #fff; }
.cc-color-green { background-color: #57a64e; color: #fff; }
.cc-color-red { background-color: #cc4c4c; color: #fff; }
.cc-color-black { background-color: #191919; color: #fff; }

/* Interactive Managers */
.items-manager, .nodes-manager, .series-manager {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
}

.item-entry, .node-entry, .series-entry {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.item-entry input, .node-entry input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    color: #2d3748;
    padding: 4px 8px;
    font-size: 12px;
}

.item-entry input:focus, .node-entry input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.series-entry {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px;
}

.series-entry label {
    display: block;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 2px;
}

.series-entry input, .series-entry select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    color: #2d3748;
    padding: 4px 6px;
    font-size: 11px;
}

.series-entry input:focus, .series-entry select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    font-size: 11px;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-sm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* TreeView Designer Styles */
.tree-designer-container {
    display: flex;
    gap: 20px;
    height: 500px;
}

.tree-config-panel {
    flex: 1;
    max-width: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.tree-preview-panel {
    flex: 1;
    border-left: 1px solid #e2e8f0;
    padding-left: 20px;
}

.tree-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.node-editor {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.node-editor h6 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.node-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.tree-preview {
    width: 100%;
    height: 400px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f7fafc;
    padding: 15px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
    user-select: none;
}

.tree-node:hover {
    background: #e2e8f0;
}

.tree-node.selected {
    background: #3182ce;
    color: white;
}

.tree-node-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tree-node-icon {
    width: 16px;
    text-align: center;
}

.tree-node-text {
    flex: 1;
}

.tree-node-toggle {
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.tree-node-children {
    margin-left: 20px;
    border-left: 1px solid #cbd5e0;
    padding-left: 8px;
}

.tree-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-xs {
    font-size: 11px;
    padding: 2px 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background: #e2e8f0;
    color: #2d3748;
    transition: all 0.2s;
}

.btn-xs:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* === Dark Neon Theme Overrides (aligned with landing page) === */
/* These overrides restyle the designer to match the index.html aesthetic without touching functionality */
:root {
    --xcc-accent: #00ff88;
    --xcc-accent-alt: #ff6b00;
    --xcc-bg0: #050505;
    --xcc-bg1: #0a0a0a;
    --xcc-bg2: #111111;
    --xcc-bg3: #181818;
    --xcc-border: #262626;
    --xcc-text: #ffffff;
    --xcc-text-dim: #b0b0b0;
    --xcc-text-fade: #707070;
    --xcc-gradient: linear-gradient(135deg,var(--xcc-accent),var(--xcc-accent-alt));
    --xcc-shadow-strong: 0 8px 30px -6px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.03);
    --xcc-shadow-soft: 0 4px 18px -4px rgba(0,255,136,0.35);
}

body {
    background: radial-gradient(circle at 20% 15%, rgba(0,255,136,0.08), transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(255,107,0,0.06), transparent 55%),
                linear-gradient(160deg,#0a0a0a,#050505 60%);
    color: var(--xcc-text);
    overflow: hidden;
}

.app { background: rgba(10,10,10,0.55); backdrop-filter: blur(22px) saturate(140%); }

.header { background: rgba(15,15,15,0.85); border-bottom: 1px solid var(--xcc-border); box-shadow: var(--xcc-shadow-soft); }
.header-left .logo { background: var(--xcc-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.framework-tabs { background: rgba(255,255,255,0.04); border:1px solid var(--xcc-border); border-radius:14px; }
.tab-btn { background: rgba(255,255,255,0.05); color: var(--xcc-text-dim); font-size:13px; letter-spacing:.3px; }
.tab-btn:hover { background: rgba(255,255,255,0.09); color: var(--xcc-text); }
.tab-btn.active { background: var(--xcc-gradient); color:#0d0d0d; box-shadow:0 6px 18px -4px rgba(0,255,136,0.5); }

.terminal-size-controls { background: rgba(255,255,255,0.04); border:1px solid var(--xcc-border); border-radius:18px; }
.terminal-size-controls label { color: var(--xcc-text-fade); letter-spacing:.5px; font-size:12px; text-transform:uppercase; }
.preset-select, .size-inputs input { background:#141414; border:1px solid var(--xcc-border); color:var(--xcc-text); font-size:13px; }
.preset-select:focus, .size-inputs input:focus { outline:none; border-color:var(--xcc-accent); box-shadow:0 0 0 2px rgba(0,255,136,0.35); }
.size-inputs span { color: var(--xcc-text-fade); }

.btn { border-radius:12px; font-size:13px; font-weight:600; letter-spacing:.25px; position:relative; overflow:hidden; }
.btn-primary { background: var(--xcc-gradient); color:#0d0d0d; box-shadow:0 8px 26px -6px rgba(0,255,136,0.45); }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 12px 34px -8px rgba(0,255,136,0.6); }
.btn-secondary { background:rgba(255,255,255,0.06); color:var(--xcc-text-dim); border:1px solid var(--xcc-border); }
.btn-secondary:hover { background:rgba(255,255,255,0.12); color:var(--xcc-text); }

.sidebar { background:rgba(20,20,20,0.85); border-right:1px solid var(--xcc-border); backdrop-filter: blur(18px) saturate(150%); }
.sidebar-section h3 { color:var(--xcc-text); letter-spacing:1px; font-size:14px; opacity:.9; }
.element-category h4 { color:var(--xcc-text-fade); }
.element-item { background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); border:1px solid var(--xcc-border); }
.element-item:hover { background:linear-gradient(135deg, rgba(0,255,136,0.18), rgba(0,0,0,0.15)); border-color:var(--xcc-accent); box-shadow:0 8px 26px -6px rgba(0,255,136,0.45); transform:translateY(-4px) scale(1.02); }
.element-item span { color:var(--xcc-text-dim); }

.canvas-area { background: radial-gradient(circle at 70% 30%, rgba(0,255,136,0.06), transparent 60%), linear-gradient(120deg,#0c0c0c,#0a0a0a); }
.canvas-header { background: rgba(15,15,15,0.75); border-bottom:1px solid var(--xcc-border); backdrop-filter: blur(14px) saturate(160%); }
.canvas-title h3 { color:var(--xcc-text); }
.canvas-info { color:var(--xcc-text-fade); font-size:11px; text-transform:uppercase; letter-spacing:.75px; }
.canvas-container { padding:34px; }
.canvas { background:#0f1113; border:1px solid #222; border-radius:22px; box-shadow: var(--xcc-shadow-strong); }
.terminal-preview { background:#181c20; border-radius:12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 0 18px -4px rgba(0,255,136,0.12); }

.drop-zone { background:rgba(0,0,0,0.55); backdrop-filter:blur(6px) saturate(150%); }
.drop-zone.drag-over { background:rgba(0,255,136,0.15); box-shadow: inset 0 0 0 2px var(--xcc-accent); }
.drop-zone-content { color:var(--xcc-text-dim); }
.drop-zone-icon { background:var(--xcc-gradient); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-size:54px; opacity:.35; }

.ui-element:hover { border-color: var(--xcc-accent); }
.ui-element.selected { border-color: var(--xcc-accent); box-shadow:0 0 0 2px rgba(0,255,136,0.25),0 0 14px -2px rgba(0,255,136,0.5); }

.properties-panel { background: rgba(20,20,20,0.85); border-left:1px solid var(--xcc-border); }
.properties-header { border-bottom:1px solid var(--xcc-border); }
.properties-header h3 { color:var(--xcc-text); }
.properties-content { color: var(--xcc-text-dim); }
.property-group h4 { color:var(--xcc-text-fade); border-bottom:1px solid var(--xcc-border); }
.property-field label { color:var(--xcc-text-fade); }
.property-field input, .property-field select, .property-field textarea { background:#141414; border:1px solid var(--xcc-border); color:var(--xcc-text); }
.property-field input:focus, .property-field select:focus, .property-field textarea:focus { border-color:var(--xcc-accent); box-shadow:0 0 0 2px rgba(0,255,136,0.3); }

.modal-content { background:#141414; border:1px solid var(--xcc-border); }
.modal-header { border-bottom:1px solid var(--xcc-border); }
.modal-header h3 { color:var(--xcc-text); }
.modal-body { color:var(--xcc-text-dim); }
.code-output { background:#181c20; }
.code-output code { color: var(--xcc-accent); }

/* Scrollbars (dark) */
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }

/* End Dark Neon Theme Overrides */

/* ComputerCraft Font Styling for Canvas Elements */
.ui-element,
.ui-element *,
.terminal-preview .ui-element,
.terminal-preview .ui-element *,
#terminalPreview *,
#terminalSimulation *,
.canvas .ui-element,
.canvas .ui-element * {
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Lucida Console', 'Liberation Mono', monospace !important;
    letter-spacing: 5px !important;
    font-weight: 500 !important;
}

/* Specific styling for different UI element types */
.ui-element[data-type="Label"],
.ui-element[data-type="Button"], 
.ui-element[data-type="Input"],
.ui-element[data-type="TextBox"],
.ui-element[data-type="Checkbox"],
.ui-element[data-type="List"],
.ui-element[data-type="Dropdown"],
.ui-element[data-type="Menu"] {
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Lucida Console', 'Liberation Mono', monospace !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
}

/* Override for terminal simulation in preview */
.terminal-simulation {
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Lucida Console', 'Liberation Mono', monospace !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
}

.terminal-simulation * {
    font-family: inherit !important;
    letter-spacing: inherit !important;
    font-weight: inherit !important;
}

/* Ensure all canvas text elements use retro styling */
[data-framework] .ui-element,
[data-framework] .ui-element * {
    font-family: 'Courier New', 'Monaco', 'Consolas', 'Lucida Console', 'Liberation Mono', monospace !important;
    letter-spacing: 0.5px !important;
    font-weight: 500 !important;
}
