/**
 * Visual Code Designer Public Styles
 */

/* Ensure full width and height within WordPress content areas */
.entry-content .visual-code-designer,
.wp-block-group__inner-container .visual-code-designer,
.wp-block-column .visual-code-designer,
.wp-block-group .visual-code-designer,
.site-content .visual-code-designer,
.content-area .visual-code-designer,
.main-content .visual-code-designer {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
}

/* Remove padding/margin from parent containers that might offset the app */
body:has(.visual-code-designer) .entry-content,
body.vcd-fullpage-mode .entry-content,
body:has(.visual-code-designer) .site-content,
body.vcd-fullpage-mode .site-content,
body:has(.visual-code-designer) .content-area,
body.vcd-fullpage-mode .content-area,
body:has(.visual-code-designer) .main-content,
body.vcd-fullpage-mode .main-content,
body:has(.visual-code-designer) .wp-block-group__inner-container,
body.vcd-fullpage-mode .wp-block-group__inner-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* Override WordPress container constraints */
html:has(.visual-code-designer),
html.vcd-fullpage-mode,
body:has(.visual-code-designer),
body.vcd-fullpage-mode {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}

/* Hide WordPress admin bar when app is active */
body:has(.visual-code-designer) #wpadminbar,
body.vcd-fullpage-mode #wpadminbar {
    display: none !important;
}

body:has(.visual-code-designer) .site-header,
body:has(.visual-code-designer) .site-footer,
body:has(.visual-code-designer) .site-navigation,
body:has(.visual-code-designer) .wp-block-template-part,
body.vcd-fullpage-mode .site-header,
body.vcd-fullpage-mode .site-footer,
body.vcd-fullpage-mode .site-navigation,
body.vcd-fullpage-mode .wp-block-template-part,
body.vcd-fullpage-mode header,
body.vcd-fullpage-mode footer,
body.vcd-fullpage-mode nav {
    display: none !important;
}

.visual-code-designer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Pro Display', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f172a 100%);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    box-sizing: border-box;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 99999 !important;
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.vcd-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    color: #e2e8f0;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    position: relative;
}

.vcd-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
}

.vcd-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #ffffff;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vcd-icon {
    font-size: 1.8rem;
}

.vcd-language-indicator {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
}

.vcd-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vcd-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vcd-btn::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;
}

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

.vcd-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.vcd-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vcd-btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
}

.vcd-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

.vcd-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.vcd-btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.vcd-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.vcd-btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.vcd-btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.vcd-btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.vcd-btn-icon {
    font-size: 1rem;
}

/* Main Container */
.vcd-main-container {
    display: grid;
    grid-template-columns: 300px 1fr 450px;
    grid-template-rows: 1fr;
    min-height: 0;
    height: 100%;
    flex: 1;
    gap: 0;
    width: 100%;
    overflow: hidden;
}

/* Large screens (1920px and above) */
@media (min-width: 1920px) {
    .vcd-main-container {
        grid-template-columns: 320px 1fr 500px;
    }
}

/* Extra large screens (1600px - 1919px) */
@media (min-width: 1600px) and (max-width: 1919px) {
    .vcd-main-container {
        grid-template-columns: 300px 1fr 480px;
    }
}

/* Large screens (1400px - 1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
    .vcd-main-container {
        grid-template-columns: 280px 1fr 420px;
    }
}

/* Medium-large screens (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .vcd-main-container {
        grid-template-columns: 260px 1fr 380px;
    }
}

/* Medium screens (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .vcd-main-container {
        grid-template-columns: 240px 1fr 340px;
    }
}

/* Small-medium screens (900px - 1023px) */
@media (min-width: 900px) and (max-width: 1023px) {
    .vcd-main-container {
        grid-template-columns: 220px 1fr 320px;
    }
}

/* Tablet and below (768px - 899px) */
@media (min-width: 768px) and (max-width: 899px) {
    .vcd-main-container {
        grid-template-columns: 200px 1fr 280px;
    }
}

/* Mobile landscape and small tablets (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .vcd-main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        min-height: auto;
    }
    
    .vcd-toolbox {
        max-height: 250px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .vcd-output-panel {
        max-height: 300px;
        overflow-y: auto;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

/* Mobile portrait (below 600px) */
@media (max-width: 599px) {
    .vcd-main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        min-height: auto;
    }
    
    .vcd-toolbox,
    .vcd-output-panel {
        max-height: 250px;
        overflow-y: auto;
    }
    
    .vcd-toolbox {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .vcd-output-panel {
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

/* Toolbox */
.vcd-toolbox {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    padding: 28px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3), inset -1px 0 0 rgba(148, 163, 184, 0.1);
    min-width: 0;
    backdrop-filter: blur(20px);
}

.vcd-toolbox-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 28px 0;
    color: #ffffff;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.4);
    letter-spacing: -0.02em;
    position: relative;
}

.vcd-toolbox-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
}

.vcd-toolbox-section {
    margin-bottom: 28px;
}

.vcd-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vcd-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
}

.vcd-block-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    color: #f1f5f9;
    padding: 14px 18px;
    margin: 10px 0;
    border-radius: 10px;
    cursor: grab;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border: 1px solid rgba(99, 102, 241, 0.25);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.vcd-block-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.vcd-block-item:hover {
    transform: translateX(6px) scale(1.03);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    color: #ffffff;
}

.vcd-block-item:hover::before {
    left: 100%;
}

.vcd-block-item.vcd-structural {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-color: rgba(236, 72, 153, 0.2);
}

.vcd-block-item.vcd-structural:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(239, 68, 68, 0.25) 100%);
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.vcd-block-item.vcd-module {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.vcd-block-item.vcd-module:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.25) 100%);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.vcd-block-item:active {
    cursor: grabbing;
    transform: translateX(2px) scale(0.98);
}

/* Canvas */
.vcd-canvas-container {
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.5) 0%, rgba(30, 41, 59, 0.5) 100%);
    position: relative;
    overflow: auto;
    height: 100%;
    min-width: 0;
    flex: 1;
    backdrop-filter: blur(20px);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.vcd-canvas {
    padding: 32px;
    min-height: 100%;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.vcd-canvas.vcd-drag-over {
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed rgba(99, 102, 241, 0.5);
    border-radius: 12px;
}

.vcd-canvas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100% - 64px);
    height: auto;
    color: #64748b;
    text-align: center;
    border: 2px dashed rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    margin: 20px;
    padding: 60px 40px;
    box-sizing: border-box;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.vcd-canvas-placeholder:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(30, 41, 59, 0.7);
    transform: scale(1.02);
}

.vcd-placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.vcd-canvas-placeholder p {
    font-size: 1.1rem;
    margin: 0;
    max-width: 400px;
    color: #94a3b8;
    line-height: 1.6;
    font-weight: 500;
}

/* Blocks */
.vcd-block {
    margin: 18px 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(15px);
    border-radius: 14px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: visible;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.vcd-block:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 12px 32px rgba(99, 102, 241, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(30, 41, 59, 0.95);
}

.vcd-block::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(to bottom, 
        rgba(102, 126, 234, 0.6) 0%,
        rgba(118, 75, 162, 0.6) 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vcd-block:hover::before {
    opacity: 1;
}

.vcd-block-structural::before {
    background: linear-gradient(to bottom, 
        rgba(240, 147, 251, 0.6) 0%,
        rgba(245, 87, 108, 0.6) 100%);
}

.vcd-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    position: relative;
    min-height: 50px;
}

.vcd-block-regular .vcd-block-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.vcd-block-structural .vcd-block-header {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(239, 68, 68, 0.3) 100%);
    border-bottom: 1px solid rgba(236, 72, 153, 0.3);
}

.vcd-block-code-preview {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: white;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    cursor: text;
    user-select: text;
}

.vcd-block-code-preview .vcd-code-keyword {
    color: #ffd700;
    font-weight: 700;
}

.vcd-block-code-preview .vcd-code-function {
    color: #4ec9b0;
    font-weight: 600;
}

.vcd-block-code-preview .vcd-code-class {
    color: #dcdcaa;
    font-weight: 600;
}

.vcd-block-code-preview .vcd-code-variable {
    color: #9cdcfe;
    font-weight: 500;
}

.vcd-block-code-preview .vcd-code-string {
    color: #ce9178;
}

.vcd-block-code-preview .vcd-code-number {
    color: #b5cea8;
}

.vcd-block-code-preview .vcd-code-operator {
    color: #d4d4d4;
    font-weight: 500;
}

.vcd-block-code-preview .vcd-code-value {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: text;
    min-width: 60px;
    display: inline-block;
    transition: all 0.2s ease;
}

.vcd-block-code-preview .vcd-code-value:hover {
    background: rgba(255, 255, 255, 0.25);
}

.vcd-block-code-preview .vcd-code-text {
    color: #ffffff;
}

/* Editable value in code preview */
.vcd-block-code-preview .vcd-code-value[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.vcd-block-label {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-right: 8px;
    font-weight: 600;
}

.vcd-block-value {
    flex: 1;
    font-weight: 600;
    cursor: text;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 24px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.vcd-block-value:hover {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
}

.vcd-block-value:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.vcd-block-static-value {
    flex: 1;
    font-weight: 600;
}

.vcd-block-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    outline: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    transition: all 0.2s ease;
}

.vcd-block-input:focus {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    color: #f1f5f9;
}

.vcd-delete-block {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
    opacity: 0;
    margin-left: 8px;
}

.vcd-block:hover .vcd-delete-block {
    opacity: 1;
}

.vcd-delete-block:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.vcd-block-children {
    margin-left: 40px;
    padding-left: 32px;
    border-left: 3px solid rgba(99, 102, 241, 0.4);
    margin-top: 16px;
    margin-bottom: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 0 12px 12px 0;
    position: relative;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.vcd-block-children:hover {
    background: rgba(15, 23, 42, 0.4);
    border-left-color: rgba(99, 102, 241, 0.6);
}

.vcd-block-children::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, 
        rgba(99, 102, 241, 0.6) 0%,
        rgba(139, 92, 246, 0.4) 50%,
        rgba(99, 102, 241, 0.6) 100%);
    border-radius: 2px 0 0 2px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.vcd-block-children:empty::after {
    content: '💡 Drop blocks here to build your code';
    display: block;
    color: rgba(148, 163, 184, 0.5);
    font-style: italic;
    padding: 24px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.vcd-block-children:empty:hover::after {
    color: rgba(148, 163, 184, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(15, 23, 42, 0.2);
}

.vcd-block-end {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(99, 102, 241, 0.3) 100%);
    color: rgba(226, 232, 240, 0.9);
    padding: 10px 18px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 12px;
    margin-left: 40px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

/* Output Panel */
.vcd-output-panel {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3), inset 1px 0 0 rgba(148, 163, 184, 0.1);
    min-width: 0;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    overflow-x: hidden;
}

.vcd-output-header {
    padding: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
}

.vcd-output-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

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

/* AI Features Header */
.vcd-ai-features-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.vcd-ai-features-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vcd-ai-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.vcd-btn-ai {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.vcd-btn-ai:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

.vcd-btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vcd-btn-ai .vcd-btn-icon {
    font-size: 1rem;
}

/* AI Results Panel */
.vcd-ai-results-panel {
    margin-top: 16px;
    margin-bottom: 16px;
    border-top: 2px solid rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
    min-height: 200px;
    display: none; /* Hidden by default */
    flex-shrink: 0;
    order: 100; /* Ensure it appears after other panels */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.vcd-ai-results-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vcd-ai-results-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vcd-ai-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: white;
    letter-spacing: -0.01em;
}

.vcd-btn-close-ai-results {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.vcd-btn-close-ai-results:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.vcd-ai-results-content {
    padding: 28px 32px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.7);
    transition: all 0.3s ease;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.vcd-ai-results-content::-webkit-scrollbar {
    width: 10px;
}

.vcd-ai-results-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 5px;
}

.vcd-ai-results-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 5px;
}

.vcd-ai-results-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

.vcd-ai-loading {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
    font-size: 1.1rem;
}

.vcd-ai-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.vcd-ai-result {
    color: #f1f5f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    filter: none !important;
    backdrop-filter: none !important;
    font-size: 1.1rem;
    line-height: 1.9;
}

.vcd-ai-result h1,
.vcd-ai-result h2,
.vcd-ai-result h3,
.vcd-ai-result h4 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    color: #f1f5f9;
    font-weight: 700;
    line-height: 1.4;
}

.vcd-ai-result h1 {
    font-size: 1.75rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    padding-bottom: 0.6em;
}

.vcd-ai-result h2 {
    font-size: 1.5rem;
}

.vcd-ai-result h3 {
    font-size: 1.3rem;
}

.vcd-ai-result h4 {
    font-size: 1.15rem;
}

.vcd-ai-result p {
    margin: 1.2em 0;
    color: #f1f5f9;
    font-size: 1.1rem;
    line-height: 1.9;
    font-weight: 400;
}

.vcd-ai-result ul,
.vcd-ai-result ol {
    margin: 1.2em 0;
    padding-left: 2.5em;
    color: #f1f5f9;
}

.vcd-ai-result li {
    margin: 0.8em 0;
    line-height: 1.9;
    font-size: 1.1rem;
    color: #f1f5f9;
}

.vcd-ai-result code {
    background: rgba(99, 102, 241, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Fira Code', monospace;
    font-size: 0.95em;
    color: #fbbf24;
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-weight: 500;
}

.vcd-ai-code-block {
    background: rgba(15, 23, 42, 0.95);
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    filter: none !important;
    backdrop-filter: none !important;
}

.vcd-ai-code-block code {
    background: transparent;
    padding: 0;
    color: #d4d4d4;
    font-size: inherit;
}

.vcd-ai-inline-code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.vcd-ai-result strong {
    font-weight: 700;
    color: #f1f5f9;
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

.vcd-ai-result em {
    font-style: italic;
    color: #cbd5e1;
}

.vcd-ai-result blockquote {
    border-left: 4px solid rgba(99, 102, 241, 0.5);
    padding-left: 1.5em;
    margin: 1.5em 0;
    color: #cbd5e1;
    font-style: italic;
    background: rgba(99, 102, 241, 0.1);
    padding: 1em 1.5em;
    border-radius: 6px;
}

.vcd-ai-error {
    padding: 20px;
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    color: #fca5a5;
    border-radius: 8px;
    margin: 1.5em 0;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Code Editor Wrapper */
.vcd-code-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}

.vcd-code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vcd-code-language-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: rgba(99, 102, 241, 0.15);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.vcd-btn-copy-code {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vcd-btn-copy-code:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.vcd-code-editor {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #1e1e1e;
}

.vcd-generated-code {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px 20px 20px 70px;
    border: none;
    outline: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: transparent;
    color: transparent;
    resize: none;
    overflow: auto;
    box-sizing: border-box;
    cursor: text;
    caret-color: #aeafad;
    tab-size: 4;
    white-space: pre;
    word-wrap: normal;
    z-index: 2;
}

.vcd-code-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px 20px 20px 70px;
    margin: 0;
    overflow: hidden;
    background: #1e1e1e;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d4d4d4;
    box-sizing: border-box;
    white-space: pre;
    word-wrap: normal;
    z-index: 1;
    pointer-events: none;
}

.vcd-code-display code {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Python Syntax Highlighting */
.language-python .vcd-code-display code {
    color: #d4d4d4;
}

.language-python .vcd-code-display code .vcd-keyword {
    color: #569cd6;
    font-weight: 600;
}

.language-python .vcd-code-display code .vcd-string {
    color: #ce9178;
}

.language-python .vcd-code-display code .vcd-function {
    color: #dcdcaa;
}

.language-python .vcd-code-display code .vcd-class {
    color: #4ec9b0;
}

.language-python .vcd-code-display code .vcd-comment {
    color: #6a9955;
    font-style: italic;
}

.language-python .vcd-code-display code .vcd-number {
    color: #b5cea8;
}

.language-python .vcd-code-display code .vcd-operator {
    color: #d4d4d4;
}

/* Ruby Syntax Highlighting */
.language-ruby .vcd-code-display code {
    color: #d4d4d4;
}

.language-ruby .vcd-code-display code .vcd-keyword {
    color: #569cd6;
    font-weight: 600;
}

.language-ruby .vcd-code-display code .vcd-string {
    color: #ce9178;
}

.language-ruby .vcd-code-display code .vcd-function {
    color: #dcdcaa;
}

.language-ruby .vcd-code-display code .vcd-class {
    color: #4ec9b0;
}

.language-ruby .vcd-code-display code .vcd-comment {
    color: #6a9955;
    font-style: italic;
}

.language-ruby .vcd-code-display code .vcd-number {
    color: #b5cea8;
}

.language-ruby .vcd-code-display code .vcd-symbol {
    color: #d7ba7d;
}

/* Line Numbers Area */
.vcd-code-editor::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 100%;
    background: #252526;
    border-right: 1px solid #2d2d2d;
    z-index: 1;
    pointer-events: none;
}

.vcd-line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 100%;
    padding: 20px 10px 20px 10px;
    background: #252526;
    border-right: 1px solid #2d2d2d;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #858585;
    text-align: right;
    z-index: 1;
    pointer-events: none;
    box-sizing: border-box;
    user-select: none;
    overflow: hidden;
}

.vcd-line-numbers div {
    min-height: 1.6em;
}

.vcd-generated-code:focus {
    outline: none;
}

.vcd-generated-code::placeholder {
    color: #858585;
}

/* Scrollbar Styling */
.vcd-code-editor::-webkit-scrollbar,
.vcd-generated-code::-webkit-scrollbar,
.vcd-code-display::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.vcd-code-editor::-webkit-scrollbar-track,
.vcd-generated-code::-webkit-scrollbar-track,
.vcd-code-display::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.vcd-code-editor::-webkit-scrollbar-thumb,
.vcd-generated-code::-webkit-scrollbar-thumb,
.vcd-code-display::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 6px;
}

.vcd-code-editor::-webkit-scrollbar-thumb:hover,
.vcd-generated-code::-webkit-scrollbar-thumb:hover,
.vcd-code-display::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

/* Validation Panel */
.vcd-validation-panel {
    margin-top: 16px;
    margin-bottom: 16px;
    border-top: 2px solid rgba(239, 68, 68, 0.3);
    background: rgba(30, 41, 59, 0.9);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.2);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    order: 1;
}

.vcd-validation-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vcd-validation-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.vcd-btn-close-validation {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.vcd-btn-close-validation:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.vcd-validation-content {
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.vcd-validation-errors,
.vcd-validation-warnings {
    margin-bottom: 16px;
}

.vcd-validation-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vcd-validation-error-item,
.vcd-validation-warning-item {
    background: rgba(15, 23, 42, 0.5);
    border-left: 3px solid rgba(239, 68, 68, 0.5);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.vcd-validation-warning-item {
    border-left-color: rgba(245, 158, 11, 0.5);
}

.vcd-validation-error-item:hover,
.vcd-validation-warning-item:hover {
    background: rgba(15, 23, 42, 0.7);
    transform: translateX(4px);
}

.vcd-error-line {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fca5a5;
    margin-bottom: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

.vcd-validation-warning-item .vcd-error-line {
    color: #fbbf24;
}

.vcd-error-message {
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.5;
}

.vcd-error-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #c7d2fe;
    margin-top: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.vcd-suggestion-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.vcd-validation-content::-webkit-scrollbar {
    width: 8px;
}

.vcd-validation-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
}

.vcd-validation-content::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.4);
    border-radius: 4px;
}

.vcd-validation-content::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.6);
}

/* Error highlighting on blocks */
.vcd-block-error {
    border-left: 4px solid rgba(239, 68, 68, 0.6) !important;
    background: rgba(239, 68, 68, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.vcd-block-error::after {
    content: '⚠️';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
    z-index: 10;
}

.vcd-block-error .vcd-block-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%) !important;
}

.vcd-block[data-error-message]:hover::before {
    content: attr(data-error-message);
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vcd-block[data-error-message]:hover::before {
    content: attr(data-error-message);
}

/* Error line highlighting */
.vcd-line-number.vcd-line-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-weight: 700;
    border-left: 3px solid rgba(239, 68, 68, 0.6);
}

.vcd-code-display code .vcd-line-error {
    background: rgba(239, 68, 68, 0.15);
    display: block;
    padding: 2px 0;
    border-left: 3px solid rgba(239, 68, 68, 0.6);
    padding-left: 4px;
}

/* Variable Inspector */
.vcd-variable-inspector {
    padding: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    position: relative;
    order: 2;
}

.vcd-variable-inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.vcd-variable-inspector-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vcd-variable-inspector-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vcd-btn-refresh-variables {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.vcd-btn-refresh-variables:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
    transform: rotate(180deg);
}

.vcd-btn-expand-variables {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.vcd-btn-expand-variables:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: scale(1.1);
}

.vcd-variable-inspector-content {
    position: relative;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.vcd-variables-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.vcd-variables-empty p {
    font-size: 0.95rem;
    margin: 0;
    font-style: italic;
}

.vcd-variables-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vcd-variable-scope-group {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.vcd-variable-scope-header {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}

.vcd-scope-icon {
    font-size: 1.2rem;
}

.vcd-scope-name {
    flex: 1;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

.vcd-scope-type {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 12px;
}

.vcd-variable-scope-variables {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vcd-variable-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    transition: all 0.2s ease;
}

.vcd-variable-item:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.vcd-variable-name {
    font-weight: 700;
    color: #f1f5f9;
    font-size: 0.95rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

.vcd-variable-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: lowercase;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.vcd-variable-value {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: #94a3b8;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    padding: 8px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    word-break: break-word;
    margin-top: 4px;
}

.vcd-variable-line {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    grid-column: 1 / -1;
    margin-top: 4px;
}

/* Scope visualization on blocks */
.vcd-block[data-has-variables="true"] {
    border-left: 3px solid rgba(16, 185, 129, 0.4);
}

.vcd-block[data-has-variables="true"]::before {
    background: linear-gradient(to bottom, 
        rgba(16, 185, 129, 0.6) 0%,
        rgba(5, 150, 105, 0.6) 100%);
    opacity: 1;
}

.vcd-variable-inspector-content::-webkit-scrollbar {
    width: 10px;
}

.vcd-variable-inspector-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 5px;
}

.vcd-variable-inspector-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 5px;
}

.vcd-variable-inspector-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

.vcd-variable-inspector.vcd-expanded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100000;
    pointer-events: none;
}

.vcd-execution-output {
    padding: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    position: relative;
    order: 3;
}

.vcd-execution-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vcd-execution-output h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vcd-btn-expand-output,
.vcd-btn-expand-ai-results {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.vcd-btn-expand-output:hover,
.vcd-btn-expand-ai-results:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: scale(1.1);
}

.vcd-expand-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.vcd-output-content-wrapper {
    position: relative;
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.vcd-output-content {
    background: rgba(15, 23, 42, 0.8);
    color: #10b981;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    min-height: 60px;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vcd-output-content-wrapper::-webkit-scrollbar {
    width: 10px;
}

.vcd-output-content-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 5px;
}

.vcd-output-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 5px;
}

.vcd-output-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

/* Expanded state overlay */
.vcd-execution-output.vcd-expanded::before,
.vcd-ai-results-panel.vcd-expanded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: none !important;
    filter: none !important;
    z-index: 100000;
    pointer-events: none;
}

.vcd-ai-results-panel.vcd-expanded {
    position: fixed !important;
    z-index: 100001 !important;
    margin: 0 !important;
    backdrop-filter: none !important;
    filter: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    background: rgba(30, 41, 59, 1) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
}

.vcd-ai-results-panel.vcd-expanded * {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.vcd-ai-results-panel.vcd-expanded .vcd-ai-results-content {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    transform: none !important;
    will-change: auto !important;
    background: rgba(15, 23, 42, 1) !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.vcd-ai-results-panel.vcd-expanded .vcd-ai-result {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    filter: none !important;
}

.vcd-ai-results-panel.vcd-expanded .vcd-ai-results-header {
    backdrop-filter: none !important;
    filter: none !important;
}

.vcd-output-content:empty::before {
    content: attr(data-placeholder);
    color: #6b7280;
    font-style: italic;
}

.vcd-mock-output .vcd-output-content {
    border-left: 3px solid #f59e0b;
    padding-left: 12px;
}

.vcd-mock-output::before {
    content: '⚠️ Mock Output';
    display: block;
    font-size: 0.75rem;
    color: #f59e0b;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Loading States */
.vcd-loading {
    opacity: 0.6;
    pointer-events: none;
}

.vcd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: vcd-spin 1s linear infinite;
}

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

/* Error States */
.vcd-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin: 10px 0;
}

/* Responsive Header */
@media (max-width: 900px) {
    .vcd-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 20px;
    }
    
    .vcd-controls {
        justify-content: center;
        width: 100%;
    }
    
    .vcd-title {
        font-size: 1.3rem;
        justify-content: center;
    }
}

@media (max-width: 599px) {
    .vcd-header {
        padding: 18px 15px;
    }
    
    .vcd-title {
        font-size: 1.2rem;
    }
    
    .vcd-canvas {
        min-height: 300px;
        padding: 20px;
    }
    
    .vcd-canvas-placeholder {
        min-height: 250px;
        padding: 30px 20px;
        margin: 10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .vcd-header {
        padding: 16px 15px;
    }
    
    .vcd-title {
        font-size: 1.1rem;
    }
    
    .vcd-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .vcd-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }
    
    .vcd-toolbox,
    .vcd-canvas,
    .vcd-output-panel {
        padding: 15px;
    }
    
    .vcd-canvas-placeholder {
        padding: 25px 15px;
        margin: 10px;
    }
    
    .vcd-toolbox-title,
    .vcd-output-title {
        font-size: 1rem;
    }
}

/* Accessibility */
.vcd-btn:focus,
.vcd-block-item:focus,
.vcd-block-value:focus,
.vcd-delete-block:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Templates Button */
.vcd-btn-templates {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.vcd-btn-templates:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Templates Modal */
.vcd-templates-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vcd-templates-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.vcd-templates-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.vcd-templates-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.vcd-templates-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.vcd-btn-close-templates-modal {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.vcd-btn-close-templates-modal:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.vcd-templates-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.vcd-templates-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.3);
    padding: 0 24px;
    flex-shrink: 0;
}

.vcd-templates-tab {
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.vcd-templates-tab:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.1);
}

.vcd-templates-tab.vcd-tab-active {
    color: #f1f5f9;
    border-bottom-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
}

.vcd-templates-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.vcd-templates-search {
    margin-bottom: 24px;
}

.vcd-templates-search-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.vcd-templates-search-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.vcd-templates-search-input::placeholder {
    color: #64748b;
}

.vcd-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.vcd-template-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vcd-template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(30, 41, 59, 0.8);
}

.vcd-template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.vcd-template-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #f1f5f9;
    flex: 1;
    line-height: 1.3;
}

.vcd-template-delete {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.vcd-template-delete:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.vcd-template-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.vcd-template-card-description {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.vcd-template-card-code-preview {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 12px;
    max-height: 120px;
    overflow: hidden;
}

.vcd-template-card-code-preview pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.vcd-template-card-code-preview code {
    color: #94a3b8;
}

.vcd-template-use-btn {
    width: 100%;
    margin-top: auto;
}

.vcd-templates-loading,
.vcd-templates-error,
.vcd-templates-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 1rem;
}

.vcd-templates-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.vcd-templates-empty p {
    font-size: 1.1rem;
    margin: 0;
}

/* Save Template Form */
.vcd-save-template-form {
    max-width: 600px;
    margin: 0 auto;
}

.vcd-form-group {
    margin-bottom: 24px;
}

.vcd-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.vcd-template-input,
.vcd-template-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.vcd-template-input:focus,
.vcd-template-textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.vcd-template-textarea {
    resize: vertical;
    min-height: 80px;
}

.vcd-template-input::placeholder,
.vcd-template-textarea::placeholder {
    color: #64748b;
}

/* Print Styles */
@media print {
    .vcd-controls,
    .vcd-delete-block,
    .vcd-toolbox {
        display: none !important;
    }
    
    .vcd-main-container {
        grid-template-columns: 1fr;
    }
    
    .vcd-canvas {
        break-inside: avoid;
    }
}