﻿
.blockly-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    gap: 16px;
}

.app-header {
    text-align: center;
    padding: 10px 0;
}

.app-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    margin: 0;
    background: linear-gradient(90deg, #e94560, #ff6b9d, #00d4aa, #7c4dff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
}

.app-header p {
    margin: 8px 0 0;
    color: #a0a0c0;
    font-size: 0.95rem;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.workspace-wrapper {
    flex: 1;
    min-height: 400px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(110, 126, 213, 0.4);
    height: 100%;
    width: 100%;
}

#blocklyDiv {
    width: 100%;
    height: 100%;
}

.action-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 10px 0;
}

.action-bar button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-generate {
    background: linear-gradient(135deg, #7c4dff, #536dfe);
    color: white;
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.4);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(124, 77, 255, 0.6);
}

.btn-run {
    background: linear-gradient(135deg, #00d4aa, #00bfa5);
    color: #0a0a0a;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
}

.btn-run:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 170, 0.6);
}

.code-output, .run-result {
    background: rgba(15, 15, 35, 0.9);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(124, 77, 255, 0.3);
}

.code-output h3, .run-result h3 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #a0a0c0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.code-output pre, .run-result pre {
    margin: 0;
    padding: 16px;
    background: #0a0a1a;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #00d4aa;
}

.run-result.success {
    border-color: rgba(0, 212, 170, 0.5);
}

.run-result.error {
    border-color: rgba(233, 69, 96, 0.5);
}

.run-result.error pre {
    color: #e94560;
}

/* Loading animation */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e94560;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #7c4dff;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    text-align: center;
    font-weight: bold;
    color: #e94560;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading...");
}

#blazor-error-ui {
    background: linear-gradient(135deg, #e94560, #ff6b9d);
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(233, 69, 96, 0.5);
    display: none;
    left: 0;
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    text-align: center;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
}

/* Sexy rounded Blockly blocks */
.blocklyPath {
    stroke-width: 1.5px !important;
    stroke: rgba(255, 255, 255, 0.3) !important;
}

.blocklyPathDark {
    display: none !important;
}

.blocklyPathLight {
    stroke: rgba(255, 255, 255, 0.5) !important;
    stroke-width: 2px !important;
}

.blocklyText {
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 600 !important;
    /*fill: #fff !important;*/
    /*text-shadow: 0 1px 2px rgba(0,0,0,0.5);*/
}

.blocklyEditableText > rect {
    rx: 8 !important;
    ry: 8 !important;
    fill: rgba(0, 0, 0, 0.3) !important;
    stroke: rgba(255, 255, 255, 0.2) !important;
}

.blocklyDropdownText {
    fill: #fff !important;
}

.blocklySelected > .blocklyPath {
    stroke: #fff !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

.blocklyHighlightedConnectionPath {
    stroke: #00ff88 !important;
    stroke-width: 4px !important;
}

.blocklyToolboxCategory {
    border-radius: 8px !important;
    margin: 4px 8px !important;
}

.blocklyTreeRow {
    border-radius: 10px !important;
    margin: 2px 4px !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease !important;
}

.blocklyTreeRow:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.blocklyTreeSelected {
    background: rgba(233, 69, 96, 0.4) !important;
}

.blocklyFlyoutBackground {
    fill: rgba(15, 52, 96, 0.95) !important;
    rx: 16 !important;
    ry: 16 !important;
}

.blocklyScrollbarHandle {
    rx: 8 !important;
    ry: 8 !important;
}

.blocklyTrash {
    filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.5));
}

.blocklyZoom > image {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.blocklyFlyoutScrollbar {
    display: none !important;
}