@charset "utf-8";
/* CSS Document */
:root {
            --bg-primary: #0a0e1a;
            --bg-secondary: #141824;
            --accent-cyan: #00ffff;
            --accent-magenta: #ff00ff;
            --accent-yellow: #ffff00;
            --accent-green: #00ff88;
            --accent-orange: #ff8800;
            --accent-purple: #8800ff;
            --accent-red: #ff0044;
            --text-primary: #e0e6ff;
            --text-secondary: #8b92b0;
            --glow-cyan: 0 0 20px rgba(0, 255, 255, 0.5);
            --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'JetBrains Mono', monospace;
            background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1234 100%);
            color: var(--text-primary);
            overflow: hidden;
            height: 100vh;
            position: relative;
        }

        /* Grid background */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: 
                linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
            background-size: 50px 50px;
            pointer-events: none;
            z-index: 0;
        }

        .container {
            position: relative;
            z-index: 1;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* Header */
        header {
            padding: 0px 30px;
            background: rgba(20, 24, 36, 0);
            backdrop-filter: blur(10px);
            border-bottom: 0px solid rgba(0, 255, 255, 0.2);
            display: flex;
            justify-content: space-between;
            align-items: center; height: 60px; line-height: 60px;justify-content: center;
        }

        h1 {
            font-family: 'Orbitron', sans-serif;
            font-size: 28px;
            font-weight: 900;
            letter-spacing: 3px;
            text-transform: uppercase;
            background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: var(--glow-cyan);
            animation: pulse 3s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .controls {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap; width: 100%; position: fixed; bottom: 0; left: 0; z-index: 1; height: 120px; background-color: rgba(0,0,0,0);justify-content: center;
        }

        .add-buttons-container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            transform: translateY(100%);
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .add-buttons-container.open {
            transform: translateY(0);
        }

        .add-buttons-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
            padding: 20px;
            background: rgba(20, 24, 36, 0.95);
            backdrop-filter: blur(20px);
            border-top: 2px solid rgba(0, 255, 255, 0.3);
        }

        .add-buttons-grid button {
            padding: 10px 20px;
            font-size: 14px;
            min-height: 44px;
        }

        .add-toggle-btn {
            position: fixed;
            top: 70px;
            right: 20px;
            z-index: 100;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: none;
            cursor: pointer; background-color: rgba(255,255,255,0.20); border-radius: 50%;
        }

        .add-toggle-btn .material-symbols-outlined {
            font-family: 'Material Symbols Outlined';
            font-weight: normal;
            font-style: normal;
            font-size: 32px;
            line-height: 1;
            letter-spacing: normal;
            text-transform: none;
            display: inline-block;
            white-space: nowrap;
            word-wrap: normal;
            direction: ltr;
            -webkit-font-feature-settings: 'liga';
            font-feature-settings: 'liga';
            -webkit-font-smoothing: antialiased;
            color: #fff ;
        }

        .add-toggle-btn:hover .material-symbols-outlined {
            filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
        }

        button {
            font-family: 'JetBrains Mono', monospace;
            padding: 8px 12px;
            border: 2px solid var(--accent-cyan);
            background: rgba(0, 255, 255, 0.1);
            color: var(--accent-cyan);
            cursor: pointer;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            white-space: nowrap;
        }

        button::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(0, 255, 255, 0.3);
            transform: translate(-50%, -50%);
            transition: width 0.6s, height 0.6s;
        }

        button:hover::before {
            width: 300px;
            height: 300px;
        }

        button:hover {
            background: rgba(0, 255, 255, 0.2);
            box-shadow: var(--glow-cyan);
            transform: translateY(-2px);
        }

        button:active {
            transform: translateY(0);
        }

        button.active {
            background: var(--accent-cyan);
            color: var(--bg-primary);
            box-shadow: var(--glow-cyan);
        }

        button.delete {
            border-color: var(--accent-magenta);
            color: var(--accent-magenta);
            background: rgba(255, 0, 255, 0.1);
        }

        button.delete:hover {
            background: rgba(255, 0, 255, 0.2);
            box-shadow: var(--glow-magenta);
        }

        button.delete.active {
            background: var(--accent-magenta);
            color: var(--bg-primary);
            box-shadow: var(--glow-magenta);
        }

        button.play-btn,
        button.stop-btn {
            width: 80px;
            height: 80px;
            padding: 0;
            background: none;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        button.play-btn.hidden,
        button.stop-btn.hidden {
            display: none;
        }

        button.play-btn .material-symbols-outlined,
        button.stop-btn .material-symbols-outlined {
            font-family: 'Material Symbols Outlined';
            font-weight: normal;
            font-style: normal;
            font-size: 48px;
            line-height: 1;
            letter-spacing: normal;
            text-transform: none;
            display: inline-block;
            white-space: nowrap;
            word-wrap: normal;
            direction: ltr;
            -webkit-font-feature-settings: 'liga';
            font-feature-settings: 'liga';
            -webkit-font-smoothing: antialiased;
            color: #FFF;
        }

        button.stop-btn .material-symbols-outlined {
            color: #FFF;
        }

        button.play-btn:hover .material-symbols-outlined {
            color: var(--accent-green);
            filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.8));
        }

        button.stop-btn:hover .material-symbols-outlined {
            color: var(--accent-red);
            filter: drop-shadow(0 0 10px rgba(255, 0, 68, 0.8));
        }

        #scaleSelect {
            outline: none; display: none;
        }

        #scaleSelect:hover {
            background: rgba(0, 255, 255, 0.2);
        }

        #scaleSelect option {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .status {
            font-size: 11px;
            color: var(--text-secondary);
            letter-spacing: 1px; padding: 1em; position: fixed; bottom: 120px; width: calc(100% - 20px); left: 50%; transform: translateX(-50%); text-align: right; box-sizing: border-box;
        }

        .status span {
            color: var(--accent-cyan);
            font-weight: 700;
        }

        /* Canvas */
        .canvas {
            flex: 1;
            position: relative;
            overflow: hidden;
            margin: 0px;
            background: linear-gradient(
                90deg,
                rgba(0, 255, 255, 0.1) 0%,
                rgba(255, 0, 255, 0.1) 12.5%,
                rgba(0, 255, 136, 0.1) 25%,
                rgba(136, 0, 255, 0.1) 37.5%,
                rgba(255, 136, 0, 0.1) 50%,
                rgba(0, 136, 255, 0.1) 62.5%,
                rgba(255, 255, 0, 0.1) 75%,
                rgba(0, 255, 255, 0.15) 87.5%,
                rgba(0, 255, 255, 0.2) 100%
            );
             position: fixed; top:60px; left: 10px; width: calc( 100% - 20px ); height: calc( 100svh - 120px - 60px );border: 1px solid rgba(0, 255, 255, 0.2); box-sizing: border-box;
        }

        .canvas::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(
                180deg,
                rgba(255, 255, 255, 0.05) 0%,
                transparent 50%,
                rgba(0, 0, 0, 0.3) 100%
            );
            pointer-events: none;
        }

        .canvas::after {
            /*content: 'C | Am | F | G | Em | Dm | G7 | C';*/
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 9px;
            color: rgba(255, 255, 255, 0.3);
            letter-spacing: 2px;
            font-weight: 700;
            pointer-events: none;
        }

        /* Elements */
        .element {
            position: absolute;
            cursor: grab;
            padding: 12px 16px;
            border-radius: 8px;
            background: rgba(20, 24, 36, 0.9);
            border: 2px solid;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
            min-width: 150px;
            user-select: none;
            -webkit-user-select: none;
        }

        .element.dragging {
            cursor: grabbing;
            opacity: 0.9;
            transform: scale(1.05);
            transition: none !important;
            z-index: 1000;
        }

        .element.input-type {
            border-color: var(--accent-cyan);
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
        }

        .element.textarea-type {
            border-color: var(--accent-magenta);
            box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
        }

        .element.radio-type {
            border-color: var(--accent-yellow);
            box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
        }

        .element.checkbox-type {
            border-color: var(--accent-green);
            box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
        }

        .element.button-type {
            border-color: var(--accent-orange);
            box-shadow: 0 0 15px rgba(255, 136, 0, 0.3);
        }

        .element.select-type {
            border-color: var(--accent-purple);
            box-shadow: 0 0 15px rgba(136, 0, 255, 0.3);
        }

        .element.range-type {
            border-color: var(--accent-red);
            box-shadow: 0 0 15px rgba(255, 0, 68, 0.3);
        }
        
        /* Nested element styles */
        .element.nested {
            pointer-events: auto;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }
        
        .element.has-children {
            border-width: 3px;
            box-shadow: 0 0 25px rgba(255, 0, 255, 0.5), 0 0 50px rgba(0, 255, 255, 0.3);
            animation: pulse-glow 2s ease-in-out infinite;
        }
        
        @keyframes pulse-glow {
            0%, 100% { 
                box-shadow: 0 0 25px rgba(255, 0, 255, 0.5), 0 0 50px rgba(0, 255, 255, 0.3);
            }
            50% { 
                box-shadow: 0 0 35px rgba(255, 0, 255, 0.7), 0 0 70px rgba(0, 255, 255, 0.5);
            }
        }

        .element::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: inherit;
            border-radius: 8px;
            filter: blur(10px);
            opacity: 0;
            transition: opacity 0.3s;
            z-index: -1;
        }

        .element:hover::before {
            opacity: 0.5;
        }

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

        .element-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
            opacity: 0.7;
        }

        .element-remove {
            background: none;
            border: none;
            color: var(--accent-magenta);
            cursor: pointer;
            font-size: 20px;
            padding: 0;
            width: 24px!important;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            opacity: 0.5;
            transition: all 0.2s; min-width: 24px;
        }

        .element-remove .material-symbols-outlined {
            font-size: 20px;
            color: inherit;
        }

        .element-remove:hover {
            opacity: 1;
            transform: rotate(90deg);
        }

        input, textarea, select, button {
            width: 100%;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(0, 255, 255, 0.2);
            color: var(--text-primary);
            padding: 8px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 12px;
            border-radius: 4px;
            outline: none;
            transition: all 0.3s;
            pointer-events: auto;
            user-select: text;
            -webkit-user-select: text;
            cursor: text;
        }
        
        select, button {
            cursor: pointer;
        }

        input:focus, textarea:focus, select:focus {
            border-color: var(--accent-cyan);
            box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
        }

        textarea {
            resize: none;
            min-height: 60px;
        }

        .element.textarea-type input,
        .element.textarea-type textarea {
            border-color: rgba(255, 0, 255, 0.2);
        }

        .element.textarea-type input:focus,
        .element.textarea-type textarea:focus {
            border-color: var(--accent-magenta);
            box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
        }

        .element.radio-type input {
            border-color: rgba(255, 255, 0, 0.2);
            width: auto;
            margin-right: 5px;
        }

        .element.radio-type input:focus {
            border-color: var(--accent-yellow);
            box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
        }

        .element.checkbox-type input {
            border-color: rgba(0, 255, 136, 0.2);
            width: auto;
            margin-right: 5px;
        }

        .element.checkbox-type input:focus {
            border-color: var(--accent-green);
            box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
        }
        
        /* Labels for radio and checkbox */
        .element label {
            pointer-events: auto;
            user-select: none;
            cursor: pointer;
            font-size: 12px;
            vertical-align: top;
        }
        
        /* Special input types */
        input[type="color"] {
            height: 40px;
            cursor: pointer;
            padding: 2px;
        }
        
        input[type="range"] {
            cursor: pointer;
        }
        
        input[type="date"],
        input[type="time"] {
            cursor: pointer;
        }
        
        /* Make option elements clickable */
        option {
            pointer-events: auto;
            cursor: pointer;
        }

        .element.button-type button {
            width: 100%;
            border-color: rgba(255, 136, 0, 0.3);
        }

        .element.select-type select {
            width: 100%;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(136, 0, 255, 0.2);
            color: var(--text-primary);
            padding: 8px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 12px;
            border-radius: 4px;
            outline: none;
        }

        .element.select-type select:focus {
            border-color: var(--accent-purple);
            box-shadow: 0 0 10px rgba(136, 0, 255, 0.3);
        }

        .element.range-type input[type="range"] {
            width: 100%;
            height: 30px;
            background: transparent;
            border: none;
        }

        .element.range-type input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            background: var(--accent-red);
            cursor: pointer;
            border-radius: 50%;
            box-shadow: 0 0 10px rgba(255, 0, 68, 0.5);
        }

        .element.range-type input[type="range"]::-moz-range-thumb {
            width: 20px;
            height: 20px;
            background: var(--accent-red);
            cursor: pointer;
            border-radius: 50%;
            box-shadow: 0 0 10px rgba(255, 0, 68, 0.5);
            border: none;
        }

        /* Info panel */
        .info-panel {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: rgba(20, 24, 36, 0.95);
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 8px;
            padding: 15px;
            font-size: 11px;
            max-width: 300px;
            backdrop-filter: blur(10px); display: none;
        }

        .info-panel h3 {
            font-family: 'Orbitron', sans-serif;
            font-size: 14px;
            margin-bottom: 10px;
            color: var(--accent-cyan);
        }

        .info-panel p {
            margin: 5px 0;
            line-height: 1.6;
            color: var(--text-secondary);
        }

        .info-panel strong {
            color: var(--accent-cyan);
        }

        /* Splash Message */
        .splash-message {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-family: 'JetBrains Mono', monospace;
            font-size: 18px;
            font-weight: 500;
            letter-spacing: 2px;
            text-transform: uppercase;
            z-index: 10000;
            pointer-events: none;
            opacity: 1; text-align: center;
            transition: opacity 0.5s ease-out; width: 100%;
        }

        .splash-message.fade-out {
            opacity: 0;
        }

        /* Visualizer */
        .visualizer {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 200px;
            height: 200px;
            transform: translate(-50%, -50%);
            pointer-events: none;
            opacity: 0.3;
        }

        .visualizer-circle {
            position: absolute;
            top: 50%;
            left: 50%;
            border: 2px solid var(--accent-cyan);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            animation: ripple 3s ease-out infinite;
        }

        .visualizer-circle:nth-child(2) {
            animation-delay: 1s;
            border-color: var(--accent-magenta);
        }

        .visualizer-circle:nth-child(3) {
            animation-delay: 2s;
            border-color: var(--accent-yellow);
        }

        @keyframes ripple {
            0% {
                width: 0;
                height: 0;
                opacity: 1;
            }
            100% {
                width: 400px;
                height: 400px;
                opacity: 0;
            }
        }

        /* Mobile optimizations */
        @media (max-width: 768px) {
            header {
                flex-direction: column;
                gap: 12px;
                padding: 0 12px;
            }

            h1 {
                font-size: 18px;
            }

            .controls {
                flex-wrap: wrap;
                justify-content: center;
                gap: 6px;
            }

            .add-buttons-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 5px;
                padding: 15px;
            }

            .add-buttons-grid button {
                padding: 10px 16px;
                font-size: 12px;
                min-height: 44px;
            }

            .add-toggle-btn {
                font-size: 20px;
            }

            button {
                padding: 8px 10px;
                font-size: 9px;
                min-width: 55px;
            }

            button.play-btn,
            button.stop-btn {
                width: 80px;
                height: 80px;
            }

            #scaleSelect {
                padding: 8px 10px;
                font-size: 9px;
                min-width: 90px;
            }

            .canvas {
                margin: 0px;
            }

            .canvas::after {
                display: none;
            }

            .element {
                min-width: 150px;
                touch-action: none;
            }

            .info-panel {
                display: none;
            }

            .status {
                width: 100%;
                text-align: center;
                font-size: 10px;
            }
        }

        @media (max-width: 480px) {
            h1 {
                font-size: 14px;
                letter-spacing: 1px;
            }

            button {
                padding: 6px 8px;
                font-size: 8px;
                min-width: 50px;
            }

            button.play-btn,
            button.stop-btn {
                width: 80px;
                height: 80px;
            }

            #scaleSelect {
                padding: 6px 8px;
                font-size: 8px;
                min-width: 80px;
            }

            .element {
                min-width: 150px;
                padding: 8px 10px;
            }

            input, textarea, select {
                font-size: 10px;
            }
        }

