/* Root Variables & Styling Tokens */
:root {
    --bg-darker: #07080c;
    --bg-dark: #0c0e17;
    --bg-panel: rgba(16, 20, 35, 0.65);
    --bg-panel-solid: #111424;
    --bg-input: rgba(10, 12, 22, 0.8);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-active: rgba(124, 93, 250, 0.6);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --accent-color: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    --success-color: #10b981;
    --danger-color: #f43f5e;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);
}

/* Reset & Scrollbar CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* App Layout Grid */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.app-header {
    height: 64px;
    background-color: rgba(12, 14, 23, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-color), var(--info-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo h1 span {
    background: linear-gradient(90deg, var(--accent-hover), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    outline: none;
}

/* Manage DB Thumbnail Zoom */
.manage-db-thumbnail {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    position: relative;
    z-index: 1;
}
.manage-db-thumbnail:hover {
    transform: scale(3.5);
    z-index: 100;
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    border-radius: 4px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
    transform: translateY(-1.5px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.icon-btn.active {
    background-color: rgba(124, 93, 250, 0.15);
    color: var(--accent-hover);
    border-color: var(--accent-color);
}

.icon-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Main Workspace */
.app-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Panels */
.sidebar {
    width: 320px;
    background-color: rgba(15, 17, 26, 0.65);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 5;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-color);
    width: 340px;
    overflow: hidden; /* Prevent full sidebar scroll so tabs stay fixed */
}

.panel-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-section.flex-grow {
    flex: 1;
    border-bottom: none;
    min-height: min-content;
}

/* Left Sidebar overrides removed to allow natural flex scrolling */
.sidebar-left {
    /* Removed the display: block and overflow: visible !important rules that broke scrolling */
}

.panel-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--text-secondary);
}

.section-title-bar, .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.section-title-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.section-toggle-btn:hover {
    color: var(--accent-hover);
}

.collapsed {
    display: none !important;
}

.layers-list-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 8px;
}

/* Templates Grid */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.preset-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.5);
}

.preset-card.active {
    border-color: var(--accent-color);
    background-color: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 15px var(--accent-glow);
}

.preset-thumb {
    height: 52px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-thumb {
    background-image: linear-gradient(135deg, #1d2238 0%, #111422 100%);
    position: relative;
}
.rank-thumb::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-hover);
    top: 19px;
    left: 14px;
}

.welcome-thumb {
    background-image: linear-gradient(135deg, #162a2b 0%, #0c191a 100%);
    position: relative;
}
.welcome-thumb::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--success-color);
    top: 18px;
    left: 54px;
}

.profile-thumb {
    background-image: linear-gradient(135deg, #281e2b 0%, #150f17 100%);
}

.preset-card span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.tool-btn {
    background-color: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.tool-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tool-btn svg {
    color: var(--accent-color);
    transition: var(--transition);
}

.tool-btn:hover svg {
    color: var(--accent-hover);
    transform: scale(1.1);
}

/* Layers Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.layers-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.layer-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

.layer-item:hover {
    border-color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.04);
}

.layer-item.active {
    border-color: var(--accent-color);
    background-color: rgba(124, 93, 250, 0.07);
}

.layer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.layer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.layer-title {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-primary);
}

.layer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.layer-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
}

.layer-actions button svg {
    width: 12px;
    height: 12px;
}

.layer-actions button:hover {
    color: var(--text-primary);
}

.layer-actions button.delete-btn:hover {
    color: var(--danger-color);
}

/* Sidebar Resizers */
.sidebar-resizer {
    width: 6px;
    background-color: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-resizer:hover, .sidebar-resizer.dragging {
    background-color: var(--accent-glow);
}

.resizer-toggle {
    position: absolute;
    width: 16px;
    height: 32px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    border-radius: 4px;
    transition: var(--transition);
}

.resizer-toggle:hover {
    background-color: var(--accent-color);
    color: white;
}

.resizer-left .resizer-toggle {
    right: -8px;
}

.resizer-right .resizer-toggle {
    left: -8px;
}

/* Sidebar collapsed state */
.sidebar.collapsed {
    display: none !important;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.canvas-toolbar {
    height: 48px;
    background-color: rgba(15, 17, 26, 0.55);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 4;
}

.canvas-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.size-config {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-config label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.size-config input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    width: 65px;
    font-family: inherit;
    font-size: 0.75rem;
    outline: none;
    transition: var(--transition);
}

.size-config input:focus {
    border-color: var(--accent-color);
}

.canvas-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#zoom-percent {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
    color: var(--text-primary);
}

.divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    margin: 0 4px;
}

/* Canvas Scroll Viewport */
.canvas-scroll-container {
    flex: 1;
    overflow: auto;
    background: radial-gradient(circle, #151825 0%, #090a0f 100%);
    position: relative;
}

.canvas-inner-workspace {
    width: 4000px;
    height: 4000px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Subtle dot grid pattern */
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
}

.canvas-wrapper {
    position: relative;
    /* Beautiful prominent drop shadow with subtle border */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 
                0 30px 60px -10px rgba(0, 0, 0, 0.8),
                0 0 20px rgba(0,0,0,0.4);
    border-radius: 8px;
    background-color: #111218;
    transform-origin: center center;
    transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
    /* Make sure inner elements obey the rounded border */
    overflow: hidden;
}

.canvas-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #161824;
}

#canvas-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
}

.canvas-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.15;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    display: none;
}

.canvas-grid-overlay.active {
    display: block;
}

.canvas-interactive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* Interactive DOM Elements */
.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
    outline: 1px dashed transparent;
    transition: outline-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-element.active {
    outline: none !important;
    border: 1.5px dashed var(--accent-hover);
    box-shadow: 0 0 15px var(--accent-glow);
    animation: neon-pulse 1.5s infinite alternate ease-in-out;
}

@keyframes neon-pulse {
    from {
        box-shadow: 0 0 6px var(--accent-glow), inset 0 0 4px rgba(99, 102, 241, 0.2);
        border-color: rgba(99, 102, 241, 0.5);
    }
    to {
        box-shadow: 0 0 14px rgba(99, 102, 241, 0.75), inset 0 0 6px rgba(99, 102, 241, 0.4);
        border-color: rgba(99, 102, 241, 1);
    }
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffffff;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    z-index: 5;
    display: none;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.canvas-element.active .resize-handle {
    display: block;
}

.resize-handle:hover {
    background-color: var(--accent-color);
    transform: scale(1.25);
    box-shadow: 0 0 8px var(--accent-glow);
}

.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }

/* Dynamic Element Renders */
.avatar-element-inner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.avatar-shape-circle {
    border-radius: 50%;
}
.avatar-shape-rounded {
    border-radius: 20%;
}
.avatar-shape-square {
    border-radius: 0;
}

.avatar-status-dot {
    position: absolute;
    width: 24%;
    height: 24%;
    border-radius: 50%;
    bottom: 2%;
    right: 2%;
    border: 3px solid #161824;
    z-index: 3;
}
.status-online { background-color: var(--success-color); }
.status-idle { background-color: var(--warning-color); }
.status-dnd { background-color: var(--danger-color); }
.status-offline { background-color: #747f8d; }

.deco-element-inner {
    width: 120%;
    height: 120%;
    position: absolute;
    top: -10%;
    left: -10%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.text-element-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
}

.badge-element-inner {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Status Bar */
.status-bar {
    height: 36px;
    background-color: rgba(15, 17, 26, 0.8);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Right Sidebar Tabs */
.tabs-header {
    display: flex;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.tabs-header::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 16px 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.01);
}

.tab-btn.active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-color);
    background-color: rgba(124, 93, 250, 0.02);
}

.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
}

/* Properties Form */
.no-selection-msg {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
}

.no-selection-msg p {
    font-size: 0.85rem;
}

.properties-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

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

.form-header h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}

.prop-header-actions {
    display: flex;
    gap: 8px;
}

.prop-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.prop-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.prop-group h5 {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-col.full-width {
    width: 100%;
}

.input-col label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: normal;
    text-transform: none;
    font-family: 'Inter', sans-serif;
}

.input-col input[type="text"],
.input-col input[type="number"],
.input-col select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    outline: none;
    transition: all 0.15s ease;
}

.input-col input[type="text"]:hover,
.input-col input[type="number"]:hover,
.input-col select:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.08);
}

.input-col input[type="text"]:focus,
.input-col input[type="number"]:focus,
.input-col select:focus {
    border-color: var(--accent-color);
    background-color: var(--bg-panel);
}

.input-col select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
    cursor: pointer;
}

.input-col input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px;
    transition: var(--transition);
}

.input-col input[type="color"]:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

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

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

.input-col input[type="file"] {
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 6px 0;
}

/* Export Code Tab */
.export-options {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-options label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.lang-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
}

.lang-btn {
    flex: 1;
    padding: 8px 6px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn.active {
    background-color: var(--accent-color);
    color: white;
}

.code-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-darker);
    margin: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 250px;
}

.code-header {
    height: 40px;
    background-color: rgba(15, 17, 26, 0.5);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

#code-filename {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.code-container pre {
    flex: 1;
    padding: 16px;
    overflow: auto;
    margin: 0;
}

.code-container code {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: #a9b2c3;
    line-height: 1.5;
}

.export-note {
    padding: 0 20px 20px 20px;
}

.export-note p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.export-note strong {
    color: var(--text-secondary);
}

/* Drag & Drop Upload Zone Styles */
.col-upload-drop-zone:hover {
    border-color: var(--accent-color) !important;
    background-color: rgba(124, 93, 250, 0.05) !important;
}

.col-upload-drop-zone.dragover {
    border-color: var(--success-color) !important;
    background-color: rgba(16, 185, 129, 0.08) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2) !important;
}

/* Mobile Navigation & Responsive Overrides */
.mobile-nav {
    display: none;
}
.mobile-overlay {
    display: none;
}

@media (max-width: 768px) {
    /* Main Layout Shifts */
    body {
        overflow: hidden;
    }
    .app-workspace {
        flex-direction: column;
    }

    /* Hide Sidebars by default, style them as bottom sheets */
    .sidebar {
        position: fixed;
        bottom: 70px;
        left: 0;
        width: 100% !important;
        height: calc(100vh - 140px); /* Fill most of screen but leave header */
        z-index: 100;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.7);
        transform: translateY(150%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.4s ease;
        background-color: rgba(15, 17, 26, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Resizers */
    .sidebar-resizer {
        display: none !important;
    }

    /* Header & Toolbars */
    .app-header {
        padding: 10px;
        flex-wrap: wrap;
        height: auto;
        min-height: 64px;
        gap: 10px;
    }
    .logo h1 {
        font-size: 1.1rem;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .canvas-toolbar {
        overflow-x: auto;
        padding: 0 10px;
        justify-content: flex-start;
        flex-shrink: 0;
        -webkit-overflow-scrolling: touch;
    }
    .canvas-info {
        margin-right: 15px;
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(12, 14, 23, 0.9);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        z-index: 110;
        justify-content: space-around;
        align-items: center;
        padding: 0 10px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-family: inherit;
        font-size: 0.7rem;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
        width: 25%;
        padding: 5px 0;
    }

    .mobile-nav-btn.active {
        color: var(--accent-color);
    }
    .mobile-nav-btn svg {
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .mobile-nav-btn.active svg {
        transform: translateY(-4px) scale(1.1);
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
    }

    /* Overlay for clicking outside */
    .mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(3px);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .mobile-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    margin: 0;
}
.modal-close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}
.modal-close-btn:hover {
    color: white;
}
.modal-body {
    padding: 20px;
}
