/**
 * BYDOP Visual Editor v4 Styles
 * Tabs, Colors, Gradients, Shapes
 */

/* Editor Panel */
#visual-editor-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(249, 115, 22, 0.1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    width: 420px;
    min-width: 320px;
    max-width: 90vw;
    max-height: calc(100vh - 40px);
    backdrop-filter: blur(10px);
    overflow: hidden;
    resize: both;
}

.ve-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
}

.ve-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.ve-panel-body {
    padding: 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    resize: vertical;
}

/* Buttons */
.ve-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ve-btn-small {
    padding: 6px 10px;
    font-size: 11px;
}

.ve-btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
}

.ve-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.ve-btn-active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.ve-btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.ve-btn-warning {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: #000;
}

.ve-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.ve-btn-copy {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    padding: 8px 12px;
}

.ve-btn:hover {
    opacity: 0.9;
}

/* Tabs */
.ve-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.ve-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ve-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ve-tab.active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
}

.ve-tab-content {
    display: none;
}

.ve-tab-content.active {
    display: block;
}

/* Info Section */
.ve-info {
    margin-bottom: 12px;
    display: flex;
    gap: 20px;
}

.ve-coords,
.ve-size {
    display: flex;
    gap: 12px;
    color: #94a3b8;
    font-size: 12px;
}

.ve-coords strong,
.ve-size strong {
    color: #f97316;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Selector Box */
.ve-selector-box {
    margin-bottom: 12px;
}

.ve-selector-box label,
.ve-control-row>label {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ve-selector-row {
    display: flex;
    gap: 8px;
}

.ve-selector-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 10px;
    color: #f97316;
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.ve-selector-row input:focus {
    outline: none;
    border-color: #f97316;
}

/* Control Row */
.ve-control-row {
    margin-bottom: 8px;
}

.ve-control-row select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.ve-control-row select:focus {
    outline: none;
    border-color: #f97316;
}

.ve-control-row select option {
    background: #1a1a2e;
    color: #fff;
}

/* Slider Row */
.ve-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ve-slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    appearance: none;
    -webkit-appearance: none;
}

.ve-slider-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f97316;
    cursor: pointer;
}

.ve-slider-row span {
    color: #f97316;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    min-width: 45px;
}

/* Color Row */
.ve-color-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ve-color-row input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.ve-color-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.ve-color-row input[type="color"]::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

.ve-color-row input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #f97316;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

/* Gradient Presets */
.ve-gradient-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(249, 115, 22, 0.5) transparent;
}

.ve-gradient-presets::-webkit-scrollbar {
    width: 6px;
}

.ve-gradient-presets::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.ve-gradient-presets::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.5);
    border-radius: 3px;
}

.ve-gradient-btn {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ve-gradient-btn:hover {
    transform: scale(1.15);
    border-color: #fff;
}

.ve-gradient-none {
    background: #333 !important;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Actions */
.ve-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ve-actions .ve-btn {
    flex: 1;
    min-width: 60px;
    font-size: 12px;
    padding: 8px 10px;
}

/* Status */
.ve-status {
    margin-top: 12px;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    min-height: 20px;
}

.ve-status-success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.ve-status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ve-status-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Edit Mode Styles */
.ve-edit-mode *:not(#visual-editor-panel):not(#visual-editor-panel *):not(#ve-resize-handles):not(#ve-resize-handles *):not(script):not(style) {
    cursor: crosshair !important;
}

.ve-edit-mode *:not(#visual-editor-panel):not(#visual-editor-panel *):hover {
    outline: 2px dashed rgba(249, 115, 22, 0.4) !important;
    outline-offset: 2px;
}

.ve-selected {
    outline: 3px solid #f97316 !important;
    outline-offset: 3px;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.4) !important;
}

.ve-dragging {
    opacity: 0.8 !important;
    z-index: 99998 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

/* Resize Handles */
#ve-resize-handles {
    z-index: 999998;
    pointer-events: none;
}

.ve-resize-handle {
    position: absolute;
    background: #f97316;
    border: 2px solid #fff;
    border-radius: 4px;
    z-index: 999999;
}

.ve-resize-se {
    width: 14px;
    height: 14px;
    right: -7px;
    bottom: -7px;
    cursor: se-resize !important;
}

.ve-resize-e {
    width: 10px;
    height: 20px;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: e-resize !important;
}

.ve-resize-s {
    width: 20px;
    height: 10px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize !important;
}

.ve-resize-handle:hover {
    background: #fb923c;
    transform: scale(1.2);
}

.ve-edit-mode .ve-resize-handle {
    cursor: inherit !important;
}

/* Scrollbar */
#visual-editor-panel::-webkit-scrollbar {
    width: 6px;
}

#visual-editor-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#visual-editor-panel::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.5);
    border-radius: 3px;
}

/* Shape Buttons */
.ve-shape-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ve-btn-shape {
    flex: 1;
    min-width: 70px;
    padding: 8px 10px;
    font-size: 11px;
    background: rgba(249, 115, 22, 0.2);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: #fff;
}

.ve-btn-shape:hover {
    background: rgba(249, 115, 22, 0.4);
    border-color: #f97316;
}

/* Fade Buttons */
.ve-fade-buttons {
    display: flex;
    gap: 4px;
}

.ve-btn-fade {
    flex: 1;
    padding: 6px 8px;
    font-size: 10px;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #ccc;
}

.ve-btn-fade:hover {
    background: rgba(249, 115, 22, 0.3);
    color: #fff;
}

.ve-btn-fade.active {
    background: rgba(249, 115, 22, 0.5);
    border-color: #f97316;
    color: #fff;
}

/* Layer Buttons */
.ve-layer-buttons {
    display: flex;
    gap: 6px;
}

.ve-btn-layer {
    flex: 1;
    padding: 8px 10px;
    font-size: 11px;
    background: rgba(100, 100, 255, 0.2);
    border: 1px solid rgba(100, 100, 255, 0.4);
    color: #ccc;
}

.ve-btn-layer:hover {
    background: rgba(100, 100, 255, 0.4);
    color: #fff;
}

.ve-btn-layer.active {
    background: rgba(100, 100, 255, 0.5);
    border-color: #6366f1;
    color: #fff;
}

/* Marker Styles */
.ve-btn-marker {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px;
}

.ve-btn-marker:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.ve-marker-coords {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 6px;
    padding: 10px;
}

.ve-marker-coord-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

.ve-marker-coord-row span {
    color: #ccc;
}

.ve-marker-coord-row strong {
    color: #f97316;
}

/* Shapes Container */
#ve-shapes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ve-shape-wrapper {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    transition: box-shadow 0.2s ease;
}

.ve-shape-wrapper:hover {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

.ve-shape-selected {
    outline: 2px solid #f97316 !important;
    outline-offset: 2px;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.5) !important;
}

.ve-shape-wrapper.ve-dragging {
    opacity: 0.8;
    z-index: 99999 !important;
}

/* Shape Resize Handles */
.ve-shape-resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f97316;
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ve-shape-wrapper:hover .ve-shape-resize-handle,
.ve-shape-selected .ve-shape-resize-handle {
    opacity: 1;
}

/* Corner handles */
.ve-shape-resize-nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.ve-shape-resize-ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.ve-shape-resize-se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.ve-shape-resize-sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

/* Edge handles */
.ve-shape-resize-n {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.ve-shape-resize-e {
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    cursor: e-resize;
}

.ve-shape-resize-s {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.ve-shape-resize-w {
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    cursor: w-resize;
}

.ve-shape-resize-handle:hover {
    background: #fb923c;
    transform: scale(1.2);
}

.ve-shape-resize-n:hover,
.ve-shape-resize-s:hover {
    transform: translateX(-50%) scale(1.2);
}

.ve-shape-resize-e:hover,
.ve-shape-resize-w:hover {
    transform: translateY(-50%) scale(1.2);
}

/* ==================== TEXT ELEMENTS ==================== */

/* Text Wrapper */
.ve-text-wrapper {
    transition: box-shadow 0.2s ease, outline 0.2s ease;
}

.ve-text-wrapper:hover {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

.ve-text-selected {
    outline: 3px solid #f97316 !important;
    outline-offset: 4px;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.5) !important;
}

.ve-text-wrapper.ve-dragging {
    opacity: 0.8;
    z-index: 999999 !important;
}

/* Font Search Input */
.ve-font-search-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.ve-font-search-input:focus {
    outline: none;
    border-color: #f97316;
}

.ve-font-search-input::placeholder {
    color: #666;
}

/* Font Select with Preview */
.ve-font-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    max-height: 200px;
}

.ve-font-select:focus {
    outline: none;
    border-color: #f97316;
}

.ve-font-select option {
    background: #1a1a2e;
    color: #fff;
    padding: 8px;
}

/* Font Preview */
.ve-font-preview {
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(30, 30, 60, 0.6) 100%);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 24px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Text Input */
.ve-text-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f97316;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

.ve-text-input:focus {
    outline: none;
    border-color: #f97316;
}

/* Add Text Button Enhancement */
#ve-add-text {
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#ve-add-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

/* ==================== IMAGE ELEMENTS ==================== */

/* Image Dropzone */
.ve-image-dropzone {
    border: 2px dashed rgba(249, 115, 22, 0.5);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(249, 115, 22, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.ve-image-dropzone:hover,
.ve-image-dropzone.dragover {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    transform: scale(1.02);
}

.ve-image-dropzone-icon {
    font-size: 36px;
    margin-bottom: 8px;
    display: block;
}

.ve-image-dropzone-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 8px;
}

.ve-image-dropzone-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

/* Hidden file input */
.ve-image-file-input {
    display: none;
}

/* Image URL input */
.ve-image-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ve-image-url-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
}

.ve-image-url-input:focus {
    outline: none;
    border-color: #f97316;
}

/* Image Element Wrapper */
.ve-image-wrapper {
    position: absolute;
    cursor: move;
    z-index: 10000;
    user-select: none;
    transition: box-shadow 0.2s ease;
}

.ve-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.ve-image-wrapper.selected {
    outline: 3px solid #f97316;
    outline-offset: 3px;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.4);
}

/* Image Resize Handles */
.ve-image-wrapper .ve-img-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #f97316;
    border: 2px solid #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10001;
}

.ve-image-wrapper.selected .ve-img-resize-handle,
.ve-image-wrapper:hover .ve-img-resize-handle {
    opacity: 1;
}

.ve-image-wrapper .ve-img-resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.ve-image-wrapper .ve-img-resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.ve-image-wrapper .ve-img-resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.ve-image-wrapper .ve-img-resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

/* Shadow Presets */
.ve-shadow-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ve-shadow-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ve-shadow-btn:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

.ve-shadow-btn.active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-color: #f97316;
}

/* Image Controls Section */
.ve-image-controls {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 12px;
}

/* Image Size Display */
.ve-image-size-display {
    display: flex;
    gap: 16px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.ve-image-size-display span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ve-image-size-display strong {
    color: #f97316;
}

/* Add Image Button */
#ve-add-image-url {
    white-space: nowrap;
}

/* ==================== LAYERS PANEL ==================== */

/* Layers Container */
.ve-layers-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

/* Empty State */
.ve-layers-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* Layer Item */
.ve-layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ve-layer-item:last-child {
    border-bottom: none;
}

.ve-layer-item:hover {
    background: rgba(249, 115, 22, 0.1);
}

.ve-layer-item.selected {
    background: rgba(249, 115, 22, 0.2);
    border-left: 3px solid #f97316;
}

.ve-layer-item.hidden {
    opacity: 0.4;
}

.ve-layer-item.locked {
    background: rgba(255, 255, 255, 0.05);
}

/* Layer Icon */
.ve-layer-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

/* Layer Name */
.ve-layer-name {
    flex: 1;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* Layer Controls */
.ve-layer-controls {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.ve-layer-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
    padding: 0;
}

.ve-layer-btn:hover {
    background: rgba(249, 115, 22, 0.3);
    color: #fff;
}

.ve-layer-btn.active {
    background: #f97316;
    color: #fff;
}

.ve-layer-btn.locked-btn.active {
    background: #ef4444;
}

.ve-layer-btn.hidden-btn.active {
    background: #6b7280;
}

/* Z-Index Display */
.ve-layer-zindex {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    min-width: 20px;
    text-align: center;
}

/* Locked Element Indicator on Page */
.ve-text-wrapper.locked,
.ve-image-wrapper.locked {
    cursor: not-allowed !important;
}

.ve-text-wrapper.locked::after,
.ve-image-wrapper.locked::after {
    content: '🔒';
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 12px;
    background: rgba(239, 68, 68, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Hidden Element (visual feedback in editor) */
.ve-text-wrapper.editing-hidden,
.ve-image-wrapper.editing-hidden {
    opacity: 0.3 !important;
    outline: 2px dashed rgba(255, 255, 255, 0.3) !important;
}

/* Layers Tab Header */
.ve-layers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ve-layers-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== ACTION BUTTONS GRID ==================== */
.ve-action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ve-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
}

.ve-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.ve-action-btn:active {
    transform: translateY(0);
}

.ve-action-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.ve-action-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Save Button - Green */
.ve-action-save {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.ve-action-save:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}

/* Reset Button - Red */
.ve-action-reset {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.ve-action-reset:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Delete Button - Blue */
.ve-action-delete {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.ve-action-delete:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* All Button - Orange */
.ve-action-all {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.ve-action-all:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

/* Toggle Switch */
.ve-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.ve-switch input {
    display: none;
}

.ve-switch .ve-slider {
    width: 44px;
    height: 24px;
    background: #333;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
}

.ve-switch .ve-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.ve-switch input:checked+.ve-slider {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.ve-switch input:checked+.ve-slider::before {
    transform: translateX(20px);
}

.ve-switch-label {
    color: #aaa;
    font-size: 12px;
}

/* Fade Direction Buttons */
.ve-fade-direction-btns {
    display: flex;
    gap: 6px;
}

.ve-fade-dir-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ve-fade-dir-btn:hover {
    background: rgba(249, 115, 22, 0.3);
    color: #fff;
}

.ve-fade-dir-btn.active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-color: #f97316;
    color: #fff;
}

/* Action Grid */
.ve-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.ve-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ve-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.ve-action-icon {
    font-size: 16px;
}

.ve-action-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ve-action-save {
    border-color: rgba(34, 197, 94, 0.3);
}

.ve-action-save:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.ve-action-copy {
    border-color: rgba(59, 130, 246, 0.3);
}

.ve-action-copy:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.ve-action-paste {
    border-color: rgba(168, 85, 247, 0.3);
}

.ve-action-paste:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
}

.ve-action-reset {
    border-color: rgba(234, 179, 8, 0.3);
}

.ve-action-reset:hover {
    background: rgba(234, 179, 8, 0.2);
    border-color: #eab308;
}

.ve-action-delete {
    border-color: rgba(239, 68, 68, 0.3);
}

.ve-action-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.ve-action-all {
    border-color: rgba(249, 115, 22, 0.3);
}

.ve-action-all:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

/* Pasted Elements */
.ve-pasted-element {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s ease;
}

.ve-pasted-element:hover {
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.3);
}

.ve-pasted-element.ve-selected {
    outline: 3px solid #f97316 !important;
    outline-offset: 4px;
}

/* Text Wrapper Styles */
.ve-text-wrapper {
    box-sizing: border-box;
    position: fixed !important;
    transform: none !important;
}

.ve-text-wrapper * {
    white-space: inherit !important;
    word-wrap: break-word !important;
}

.ve-text-wrapper.ve-text-selected {
    outline: 3px solid #f97316;
    outline-offset: 2px;
}

/* ==================== ARROW CONTROLS ==================== */

.ve-arrow-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-top: 8px;
}

.ve-arrow-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.ve-arrow-btn {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(249, 115, 22, 0.4);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.2) 100%);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ve-arrow-btn:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.5) 0%, rgba(234, 88, 12, 0.5) 100%);
    border-color: #f97316;
    transform: scale(1.05);
}

.ve-arrow-btn:active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transform: scale(0.95);
}

.ve-arrow-reset {
    background: linear-gradient(135deg, rgba(100, 100, 255, 0.2) 0%, rgba(80, 80, 200, 0.2) 100%);
    border-color: rgba(100, 100, 255, 0.4);
    font-size: 16px;
}

.ve-arrow-reset:hover {
    background: linear-gradient(135deg, rgba(100, 100, 255, 0.5) 0%, rgba(80, 80, 200, 0.5) 100%);
    border-color: #6366f1;
}

.ve-step-info {
    margin-top: 8px;
    text-align: center;
}

.ve-step-info small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
}

/* ==================== POSITION INPUTS ==================== */

.ve-position-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.ve-pos-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ve-pos-input-row label {
    color: #f97316;
    font-weight: 600;
    font-size: 12px;
    margin: 0;
}

.ve-pos-input-row span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.ve-pos-input {
    width: 70px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    text-align: center;
}

.ve-pos-input:focus {
    outline: none;
    border-color: #f97316;
}

.ve-pos-input::-webkit-inner-spin-button,
.ve-pos-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* ==================== VOICE DICTATION ==================== */

.ve-voice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ve-voice-btn:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

.ve-voice-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #94a3b8;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.2s ease;
}

.ve-voice-btn:hover svg {
    stroke: #f97316;
}

/* Recording State */
.ve-voice-btn.recording {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    animation: ve-pulse 1.5s infinite;
}

.ve-voice-btn.recording svg {
    stroke: #ef4444;
}

@keyframes ve-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Disabled State */
.ve-voice-btn:disabled,
.ve-voice-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.2);
}

.ve-voice-btn:disabled:hover,
.ve-voice-btn.disabled:hover {
    background: rgba(100, 100, 100, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.ve-voice-btn:disabled svg,
.ve-voice-btn.disabled svg {
    stroke: #64748b;
}

/* Voice Status Indicator */
.ve-voice-status {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 8px;
    display: none;
}

.ve-voice-status.active {
    display: inline;
    color: #ef4444;
    animation: ve-blink 1s infinite;
}

@keyframes ve-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Voice Toolbar Row */
.ve-voice-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Interim text display */
.ve-interim-text {
    font-size: 11px;
    color: #f97316;
    font-style: italic;
    margin-top: 4px;
    min-height: 16px;
    opacity: 0.8;
}