/* ============================================
   Studio Light Theme
   ============================================ */

/* --- Global Reset --- */
body,
html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    display: flex;
    background-color: #e8ecf1;
}

/* --- Canvas Area (left side) --- */
#main-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
}

#canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border-radius: 12px;
    overflow: hidden;
}

/* Checkerboard pattern — confined to 16:9 canvas area via #canvas-bg */
/* JS inline style.backgroundImage overrides this when a BG is set */
#canvas-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #d5dbe3;
    background-image:
        linear-gradient(45deg, #c8ced6 25%, transparent 25%),
        linear-gradient(-45deg, #c8ced6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #c8ced6 75%),
        linear-gradient(-45deg, transparent 75%, #c8ced6 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-repeat: repeat;
    pointer-events: none;
    max-width: 100%;
    max-height: 100%;
}

#studio-canvas {
    max-width: 100%;
    max-height: 100%;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    position: absolute;
    z-index: 10;
}

#grid-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    z-index: 1;
    pointer-events: none;
    display: none;
}

#effect-canvas {
    pointer-events: none;
}

#dom-object-renderer {
    pointer-events: none;
}

#dom-object-renderer iframe {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
}

#dom-object-renderer iframe,
#dom-object-renderer-back iframe {
    color-scheme: light;
    background-color: transparent !important;
}

/* --- Right Sidebar --- */
#controls-panel {
    flex-shrink: 0;
    width: 340px;
    background-color: #ffffff;
    border-left: 1px solid #e0e4e8;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow: hidden;
}

/* --- Panel Header (always visible) --- */
.panel-header {
    flex-shrink: 0;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #e0e4e8;
}

.panel-header .studio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
}

.toolbar-icon:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Canvas settings button — custom resolution indicator */
.toolbar-icon.has-custom-resolution {
    position: relative;
    background: #eef2ff;
    border-color: #818cf8;
    color: #4f46e5;
}

.toolbar-icon.has-custom-resolution:hover {
    background: #e0e7ff;
}

.resolution-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.4);
    letter-spacing: 0.02em;
}

.panel-header .studio-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
}

.panel-header .studio-logo img {
    height: 28px;
    width: 28px;
}

.panel-header .studio-logo span {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* --- Connection Status Dot --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
    transition: background-color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}

.status-connected {
    background-color: #22c55e;
    /* green-500 */
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.status-reconnecting {
    background-color: #f59e0b;
    /* amber-500 */
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    animation: status-pulse 1s infinite;
}

.status-disconnected {
    background-color: #ef4444;
    /* red-500 */
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

@keyframes status-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Add buttons grid */
.add-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

/* --- Scrollable Content Area --- */
.panel-content {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Default Panel View (layers + controls) */
#default-panel-view {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    padding: 12px 16px;
}

#default-panel-view.hidden {
    display: none !important;
}

/* Layer search */
.layer-search {
    flex-shrink: 0;
    margin-bottom: 8px;
}

/* Layers list — scrollable */
.layers-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background-color: #f7f8fa;
}

#layers-panel {
    padding: 4px;
    position: relative;
}

/* Controls below layers */
.panel-controls {
    flex-shrink: 0;
    padding-top: 8px;
    border-top: 1px solid #e0e4e8;
    margin-top: 8px;
}

/* --- Editor View (replaces default) --- */
#object-editor-view {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    overflow: hidden;
    background-color: #eef1f6;
    z-index: 20;
}

#object-editor-view.hidden {
    display: none !important;
}

.editor-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 10px;
    border-bottom: 1px solid #e0e4e8;
    margin-bottom: 10px;
}

.editor-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
}

.editor-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0 16px;
}

.editor-footer {
    flex-shrink: 0;
    padding: 10px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-actions {
    flex-shrink: 0;
    padding: 10px 16px 0;
    border-top: 1px solid #e0e4e8;
    margin-top: 10px;
}

/* --- OBS Panel View --- */
#obs-panel-view {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    overflow-y: auto;
}

#obs-panel-view.hidden {
    display: none !important;
}

.obs-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

/* --- Managed Studio Banner --- */
.managed-studio-banner {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    margin: 8px 0 4px;
}

/* --- Expired Banner --- */
#expired-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#expired-banner a {
    color: #fff;
    text-decoration: underline;
    margin-left: 8px;
}

/* --- Help Modal --- */
.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.help-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1.25rem;
    padding: 4px;
}

.help-description {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 4px;
}

.help-guides-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.guide-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.guide-card-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    margin-right: 16px;
}

.guide-card-icon--features {
    background: #eef2ff;
    color: #4f46e5;
}

.guide-card-icon--mobile {
    background: #eff6ff;
    color: #2563eb;
}

.guide-card-icon--webhooks {
    background: #fdf4ff;
    color: #c026d3;
}

.guide-card h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #111827;
    font-weight: 600;
}

.guide-card p {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.help-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.help-footer p {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
    text-align: center;
}

.help-footer a {
    color: #6366f1;
    text-decoration: none;
}
.panel-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid #e0e4e8;
    background-color: #ffffff;
}

/* --- Layer Items --- */
.layer-item {
    cursor: grab;
    border-bottom: 1px solid #e5e7eb;
    border-left: 2px solid transparent;
    position: relative;
    transition: background-color 0.1s, border-color 0.1s;
    padding: 5px 6px;
    margin-bottom: 0px;
    font-size: 0.82rem;
    line-height: 1.3;
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-item:active {
    cursor: grabbing;
}

.layer-item:hover {
    background-color: #f3f4f6;
}

.layer-item.selected {
    border-left-color: #3B82F6;
    background-color: #e0e7ff;
}

.layer-item.locked {
    background-color: rgba(239, 68, 68, 0.06);
}

.layer-item.locked.selected {
    border-color: #EF4444;
}

.layer-item.locked .truncate,
.layer-item.hidden-layer .truncate {
    color: #9ca3af;
}

.layer-item.locked .lock-btn {
    color: #EF4444;
}

.layer-item.hidden-layer {
    opacity: 0.5;
}

.layer-item.hidden-layer .visibility-btn {
    color: #9ca3af;
}

.layer-item.drop-target-folder {
    outline: 2px dashed #3B82F6;
    outline-offset: -2px;
    background-color: rgba(59, 130, 246, 0.1);
}

/* Layer item buttons */
.lock-btn,
.visibility-btn,
.animation-btn,
.loop-btn,
.play-btn,
.delete-layer-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-btn:hover,
.visibility-btn:hover,
.animation-btn:hover,
.loop-btn:hover,
.play-btn:hover,
.delete-layer-btn:hover {
    background-color: #e5e7eb;
    color: #ef4444;
    /* red tint for delete on hover */
}

/* Base hover color for non-delete buttons */
.lock-btn:hover,
.visibility-btn:hover,
.animation-btn:hover,
.loop-btn:hover,
.play-btn:hover {
    color: #374151;
}

@keyframes playPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.play-btn.playing {
    color: #3b82f6 !important;
    animation: playPulse 0.6s infinite;
}

.planet-btn-trigger {
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

.planet-btn-trigger:hover {
    color: #3b82f6 !important;
    transform: scale(1.2);
}

.visibility-btn.firing {
    color: #3b82f6 !important;
    animation: playPulse 0.6s infinite;
}

/* --- Sortable Drag Ghost --- */
.sortable-ghost {
    opacity: 0.8;
    background: none;
    outline: 2px dashed #3B82F6;
    outline-offset: -2px;
    border: none;
    min-height: 40px;
    background-color: rgba(59, 130, 246, 0.1);
    margin: 4px 0;
    border-radius: 6px;
}

.sortable-ghost>* {
    display: none;
}


/* --- Layer item variant: Webhook Trigger --- */
.layer-item.webhook-trigger {
    background: repeating-linear-gradient(-45deg,
            rgba(99, 102, 241, 0.25),
            rgba(99, 102, 241, 0.25) 10px,
            rgba(255, 255, 255, 0.5) 10px,
            rgba(255, 255, 255, 0.5) 20px);
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.layer-item.webhook-trigger.locked {
    border-color: #EF4444 !important;
    background: repeating-linear-gradient(-45deg,
            rgba(239, 68, 68, 0.15),
            rgba(239, 68, 68, 0.15) 10px,
            rgba(255, 255, 255, 0.5) 10px,
            rgba(255, 255, 255, 0.5) 20px);
}

.layer-item.webhook-trigger.selected {
    border-color: #3730a3 !important;
    background: repeating-linear-gradient(-45deg,
            #312e81,
            #312e81 10px,
            #3730a3 10px,
            #3730a3 20px);
    color: white !important;
}

.layer-item.webhook-trigger .truncate {
    color: #0f172a !important;
    /* Very dark slate for better visibility */
}

.layer-item.webhook-trigger.selected .truncate {
    color: white !important;
}

.layer-item.webhook-trigger.locked .truncate {
    color: #450a0a !important;
    /* Dark red for locked webhook layers */
}

/* --- Folders --- */
.folder-content {
    margin-left: 20px;
    min-height: 36px;
    margin-top: 4px;
    margin-bottom: 0;
    /* Creates an empty space to easily drop into */
    transition: background-color 0.1s, border 0.1s;
}

/* --- Asset Loading --- */
.asset-loading {
    padding: 8px;
    text-align: center;
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
}

/* Show drop zones clearly when dragging anywhere */
.dragging-active .folder-content {
    border: 2px dashed rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.05);
}

.nested-item {
    margin-top: 2px;
}

/* --- Publish Button --- */
#publish-btn {
    transition: background-color 0.2s, box-shadow 0.2s;
}

#publish-btn.dirty {
    background-color: #F59E0B !important;
    border-color: #F59E0B !important;
    color: #fff !important;
    animation: pulse-dirty 2s ease-in-out infinite;
}

#publish-btn.dirty:hover {
    background-color: #D97706 !important;
    border-color: #D97706 !important;
}

@keyframes pulse-dirty {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
}

/* --- Confirm Modal --- */
#confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

#editor-webhook-command {
    font-size: 10px !important;
    line-height: 18px !important;
    height: 120px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

#confirm-modal.hidden {
    display: none !important;
}

#confirm-modal .modal-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 2rem 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

#confirm-modal .modal-box h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

#confirm-modal .modal-box p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

#confirm-modal .modal-action {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- Toast Notifications --- */
/* --- Notification Glow on studio canvas --- */
#studio-canvas.glow-success {
    animation: glowSuccess 1.5s ease-out forwards;
}

#studio-canvas.glow-error {
    animation: glowError 1.5s ease-out forwards;
}

@keyframes glowSuccess {
    0% {
        box-shadow: inset 0 0 120px rgba(34, 197, 94, 0.9), 0 0 80px rgba(34, 197, 94, 0.7);
    }

    100% {
        box-shadow: none;
    }
}

@keyframes glowError {
    0% {
        box-shadow: inset 0 0 120px rgba(239, 68, 68, 0.9), 0 0 80px rgba(239, 68, 68, 0.7);
    }

    100% {
        box-shadow: none;
    }
}

/* --- Editor Button Styling --- */
#object-editor-view .join .btn:not(.btn-error) {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

#object-editor-view .join .btn:not(.btn-error):hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

/* Ensure all elements in join groups match height and have consistent grey borders */
.join .btn,
.join .btn-sm,
.join .input,
.join .input-sm {
    height: 2rem !important;
    min-height: 2rem !important;
    border: 1px solid #d1d5db !important;
    outline: none !important;
    box-shadow: none !important;
}

/* --- Utility Overrides --- */
.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.p-0 {
    padding-left: 0;
    padding-right: 0;
}

.h-0 {
    height: 0;
}

.hidden {
    display: none;
}

.w-24 {
    width: 6rem;
}

.w-12 {
    width: 3rem;
}

.loading {
    margin-left: 20px !important;
}

.stat-value {
    font-size: 20px;
}

/* --- Scrollbar Styling --- */
.layers-container::-webkit-scrollbar,
.editor-scroll::-webkit-scrollbar,
#obs-panel-view::-webkit-scrollbar {
    width: 5px;
}

.layers-container::-webkit-scrollbar-track,
.editor-scroll::-webkit-scrollbar-track,
#obs-panel-view::-webkit-scrollbar-track {
    background: transparent;
}

.layers-container::-webkit-scrollbar-thumb,
.editor-scroll::-webkit-scrollbar-thumb,
#obs-panel-view::-webkit-scrollbar-thumb {
    background-color: #c1c7ce;
    border-radius: 10px;
}

/* --- Fix: search icon + input join alignment --- */
.layer-search .join {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.layer-search .join .btn {
    border-radius: 8px 0 0 8px;
    border-right: none;
    min-height: 0;
    height: auto;
}

.layer-search .join .input {
    border-radius: 0 8px 8px 0;
}

/* --- Editor Sectioning --- */
.editor-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 12px;
}

.editor-section-header h4 {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 0;
    white-space: nowrap;
}

.editor-section-header .line {
    height: 1px;
    background: #e2e8f0;
    flex-grow: 1;
}

.editor-section-header .icon {
    font-size: 1rem;
}

/* --- Global Focus Reset: Remove focus rings from inputs/selects/textareas for cleaner UI --- */
/* --- Global Focus Reset --- */
input:not(.toggle):focus,
textarea:focus,
select:focus,
button:focus,
.input:focus,
.select:focus,
.btn:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #d1d5db !important;
}

/* Toggle focus: preserve box-shadow (it renders the handle), just remove outline */
.toggle:focus {
    outline: none !important;
}

/* --- Fix: input/textarea focus ring on all 4 sides --- */
#controls-panel input:not([type="checkbox"]):not(.toggle):focus,
#controls-panel textarea:focus,
#controls-panel select:focus {
    outline: none;
    border-color: oklch(0.7 0.15 250);
    box-shadow: 0 0 0 1px oklch(0.7 0.15 250);
}

/* --- SELECTION OVERLAY --- */
.selection-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    /* Above objects */
    border: 2px solid #58a6ff;
    box-sizing: border-box;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.selection-overlay.locked {
    border-color: #ef4444;
}

.selection-overlay.dashed {
    border-style: dashed;
}

.studio-tooltip {
    position: fixed;
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
    transform: translate(-50%, -100%);
    opacity: 0;
    transition: opacity 0.1s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    max-width: 220px;
    text-align: center;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.studio-tooltip.visible {
    opacity: 1;
}

.resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #58a6ff;
    border: 2px solid #ffffff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    z-index: 1001;
    cursor: pointer;
}

.selection-overlay.locked .resize-handle {
    display: none;
}

.handle-tl {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
}

.handle-tr {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.handle-bl {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.handle-br {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
}

.modifier-badge {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(43, 45, 49, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.modifier-badge.visible {
    opacity: 1;
}

.iframe-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(88, 166, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.iframe-interaction-overlay.visible {
    opacity: 1;
}
/* ============================================
   Canvas Settings Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease-out; }
.modal-overlay .modal-box {
    background: #ffffff;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    width: 520px;
    max-width: 95vw;
}

/* Quick Presets UI Structure */
.preset-btn {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
}
.preset-btn:hover {
    border-color: #818cf8;
    background-color: #f5f8ff;
}
.preset-btn.preset-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.preset-btn.preset-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}
.preset-icon-container {
    background-color: #f3f4f6;
    border-radius: 0.75rem;
    padding: 0.5rem;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Preset Selection States */
.preset-btn.btn-primary {
    border-color: #6366f1 !important;
    background-color: #eef2ff !important;
    box-shadow: 0 0 0 1px #6366f1;
}
.preset-btn.btn-primary .preset-icon-container {
    background-color: #6366f1 !important;
    color: #ffffff !important;
}
.preset-btn.btn-primary div[style*="font-weight: 600"] {
    color: #4f46e5 !important;
}

/* Custom input number spinner arrows hide */
#canvas-width-input::-webkit-inner-spin-button, 
#canvas-width-input::-webkit-outer-spin-button,
#canvas-height-input::-webkit-inner-spin-button, 
#canvas-height-input::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
#canvas-width-input, #canvas-height-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.guide-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.04);
    border-color: #e5e7eb !important;
}
