/*

██████╗ ██╗      █████╗  ██████╗██╗  ██╗ ██████╗██╗  ██╗ ██████╗ ██████╗ ██╗███╗   ███╗ █████╗          ██████╗ ██████╗ ███╗   ███╗
██╔══██╗██║     ██╔══██╗██╔════╝██║ ██╔╝██╔════╝██║  ██║██╔═══██╗██╔══██╗██║████╗ ████║██╔══██╗        ██╔════╝██╔═══██╗████╗ ████║
██████╔╝██║     ███████║██║     █████╔╝ ██║     ███████║██║   ██║██████╔╝██║██╔████╔██║███████║        ██║     ██║   ██║██╔████╔██║
██╔══██╗██║     ██╔══██║██║     ██╔═██╗ ██║     ██╔══██║██║   ██║██╔══██╗██║██║╚██╔╝██║██╔══██║        ██║     ██║   ██║██║╚██╔╝██║
██████╔╝███████╗██║  ██║╚██████╗██║  ██╗╚██████╗██║  ██║╚██████╔╝██║  ██║██║██║ ╚═╝ ██║██║  ██║ █████╗ ╚██████╗╚██████╔╝██║ ╚═╝ ██║
╚═════╝ ╚══════╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═╝╚═╝╚═╝     ╚═╝╚═╝  ╚═╝ ╚════╝  ╚═════╝ ╚═════╝ ╚═╝     ╚═╝
*/

:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #64748b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Light Theme - Elegant Black Glass */
body.light-mode {
    --bg-color: #ffffff;
    --glass-bg: rgba(0, 0, 0, 0.85);
    --glass-border: rgba(0, 0, 0, 0.95);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #475569;
    --text-main: #ffffff;
    --text-muted: #e2e8f0;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* --- Layout --- */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* --- Glassmorphism --- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

/* --- Sidebar: Palette --- */
.sidebar-palette {
    display: flex;
    flex-direction: column;
    padding: 15px 12px;
    overflow-y: auto;
}

/* --- Styles Tab Controls --- */
.style-target-selector {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    padding: 5px;
    background: var(--glass-bg);
    border-radius: 6px;
}

.style-target-btn {
    flex: 1;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    font-weight: 500;
}

.style-target-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.style-target-btn.active {
    background: var(--primary);
    color: white;
}

.style-group-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.style-group-header:first-child {
    margin-top: 0;
}

.sidebar-header h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.palette-category {
    grid-column: 1 / -1;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    margin-bottom: 3px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.palette-category:first-child {
    margin-top: 0;
}

.palette-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 0;
}

.palette-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.palette-item i {
    font-size: 1.1rem;
    color: var(--primary);
}

.palette-item span {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
    text-align: center;
}

/* --- Main: Canvas --- */
.main-canvas {
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.canvas-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.canvas-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    width: 100%;
    margin-top: 15px;
    justify-content: center;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.canvas-area {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    overflow-y: auto;
    padding: 30px;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.canvas-area.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* --- Form Elements in Canvas --- */
.form-element-wrapper {
    position: relative;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.form-element-wrapper:hover {
    background: rgba(255, 255, 255, 0.05);
}

.form-element-wrapper.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

/* Delete button for selected elements */
.delete-element-btn {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    border: 2px solid var(--bg-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.form-element-wrapper.selected .delete-element-btn {
    display: flex;
}

.delete-element-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.delete-element-btn i {
    color: white;
    font-size: 12px;
    pointer-events: none;
}

.form-element-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Visual controls - Elements representation */
.form-control-view {
    width: 100%;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    /* Prevent interaction in canvas */
}

/* --- Container Styles --- */
.form-element-wrapper[data-type="container"] {
    min-height: 100px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    padding: 0;
}

.form-element-wrapper[data-type="container"].selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.container-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 6px;
}

.container-label i {
    font-size: 0.7rem;
    color: var(--primary);
}

.container-drop-zone {
    min-height: 80px;
    padding: 10px;
    position: relative;
}

.container-drop-zone.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container-drop-zone.empty::after {
    content: "Arrastra elementos aquí";
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    pointer-events: none;
}

.container-drop-zone.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 6px;
}

/* Layout modes */
.layout-flex {
    display: flex !important;
}

.layout-grid {
    display: grid !important;
}

/* Nested element styling */
.container-drop-zone>.form-element-wrapper {
    margin-bottom: 0;
}

/* --- Fieldset Styles --- */
.fieldset-container {
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
}

.fieldset-container legend {
    padding: 0 10px;
    color: var(--text-main);
    font-weight: 500;
}

.fieldset-drop-zone {
    min-height: 60px;
    padding: 10px;
    position: relative;
}

.fieldset-drop-zone.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fieldset-drop-zone.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 6px;
}

/* Nested fieldset element styling */
.fieldset-drop-zone>.form-element-wrapper {
    margin-bottom: 10px;
}

.fieldset-drop-zone>.form-element-wrapper:last-child {
    margin-bottom: 0;
}


.inspector-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

/* --- Floating Inspector Panel --- */
.inspector-panel {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%) translateX(450px);
    width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.inspector-panel.active {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: all;
}

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.inspector-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.close-inspector {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-inspector:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.inspector-panel .tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    margin: 0 20px 20px 20px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--secondary);
    color: white;
}

.inspector-panel .tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

.inspector-panel .tab-content.active {
    display: block;
}

/* Inspector Forms */
.inspector-group {
    margin-bottom: 15px;
}

.inspector-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.inspector-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.inspector-input:focus {
    border-color: var(--primary);
}

.inspector-input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.inspector-input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.inspector-input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.inspector-input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Options Manager for Groups */
.options-manager {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.option-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 6px;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

.option-item .inspector-input {
    margin-bottom: 0;
    font-size: 0.85rem;
    padding: 6px 8px;
}

.option-item .checkbox-label {
    font-size: 0.8rem;
    margin: 0;
}

.btn-remove-option {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-option:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Code Editor in Inspector */
.code-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#code-editor {
    flex: 1;
    width: 100%;
    min-height: 300px;
    background: #0f172a;
    color: #a5b4fc;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    resize: none;
    outline: none;
    line-height: 1.4;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 600px;
    padding: 30px;
    background: #1e293b;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal h2 {
    margin-bottom: 10px;
}

#export-code {
    width: 100%;
    height: 300px;
    margin: 20px 0;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 15px;
    font-family: monospace;
    resize: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Utility */
.text-muted {
    color: var(--text-muted);
}

/* --- Advanced Form States --- */
.form-control-view:focus,
.inspector-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Focus visible para accesibilidad */
.form-control-view:focus-visible,
.inspector-input:focus-visible,
button:focus-visible,
.palette-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Estados de validación */
.form-control-view:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

.form-control-view:valid:not(:placeholder-shown) {
    border-color: var(--success);
}

.form-control-view:disabled,
.inspector-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

/* --- Custom Range Input --- */
input[type="range"].form-control-view {
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, #334155 50%, #334155 100%);
    border-radius: 3px;
    padding: 0;
}

input[type="range"].form-control-view::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

input[type="range"].form-control-view::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

input[type="range"].form-control-view::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

input[type="range"].form-control-view::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* --- Custom Color Input --- */
input[type="color"].form-control-view {
    height: 50px;
    cursor: pointer;
    border: 2px solid var(--glass-border);
    padding: 4px;
}

input[type="color"].form-control-view::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"].form-control-view::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* --- Custom File Input --- */
input[type="file"].form-control-view {
    padding: 8px;
    cursor: pointer;
}

input[type="file"].form-control-view::file-selector-button {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s;
}

input[type="file"].form-control-view::file-selector-button:hover {
    background: var(--primary-hover);
}

/* --- Custom Checkbox and Radio (for export preview) --- */
.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--glass-border);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    margin-right: 8px;
}

.checkbox-label input[type="radio"] {
    border-radius: 50%;
}

.checkbox-label input[type="checkbox"]:checked,
.checkbox-label input[type="radio"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked::before {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label input[type="radio"]:checked::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- Button Micro-animations --- */
.btn {
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* --- Fieldset styling --- */
.form-element-wrapper fieldset {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 15px;
    margin: 10px 0;
}

.form-element-wrapper legend {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 10px;
}

/* --- Config Form --- */
.config-form {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    padding-right: 10px;
}

.config-form::-webkit-scrollbar {
    width: 6px;
}

.config-form::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.config-form::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

/* --- Range value display --- */
.range-value-display {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

/* --- Light Theme (for projectors) --- */
[data-theme="light"] {
    --bg-color: #f5f5f5;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #475569;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="light"] body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
}

[data-theme="light"] .canvas-area {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .canvas-area.drag-over {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

[data-theme="light"] .form-control-view,
[data-theme="light"] .inspector-input,
[data-theme="light"] #code-editor {
    background: #fff;
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .palette-item {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .palette-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .form-element-wrapper {
    background: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .form-element-wrapper:hover {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .form-element-wrapper.selected {
    background: rgba(37, 99, 235, 0.1);
}

[data-theme="light"] input[type="range"].form-control-view {
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, #cbd5e1 50%, #cbd5e1 100%);
}

[data-theme="light"] .empty-state {
    color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-content {
    background: #fff;
}

[data-theme="light"] #export-code {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Theme toggle button */
#theme-toggle {
    width: 42px;
    padding: 10px;
}

#theme-toggle i {
    transition: transform 0.3s ease;
}

#theme-toggle:hover i {
    transform: scale(1.1);
}
/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.5s ease-in forwards 4.5s;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast.warning {
    border-left-color: #f59e0b; /* Amber 500 */
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

.toast i {
    font-size: 1.2rem;
}

.toast.warning i {
    color: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Select dropdowns in inspector - dark theme styling */
select.inspector-input {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.inspector-input option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 8px;
}
