:root {
    --bg-main: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.9);
    --bg-panel-solid: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-active: rgba(14, 165, 233, 0.5);
    
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-danger: #ef4444;
    
    --cut-color: #ef4444;
    --engrave-color: #000000;
    
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-secondary: #334155;
    
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --sidebar-width: 320px;
    --header-height: 60px;
    
    --blur-strength: 12px;
    --transition-speed: 0.25s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* APP CONTAINER */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* APP HEADER */
.app-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

.brand-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.brand-accent {
    color: var(--accent);
}

.project-title-container {
    flex-grow: 0;
    width: 320px;
    margin: 0 20px;
}

#projectName {
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 8px 14px;
    width: 100%;
    transition: all 0.2s ease;
}

#projectName:hover {
    background: #e2e8f0;
}

#projectName:focus {
    background: #ffffff;
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* UNIT SELECTOR */
.unit-selector-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.unit-toggle-group {
    display: flex;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
}

.unit-btn {
    border: none;
    background: none;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.unit-btn.active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.header-actions .btn {
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-actions .btn:not(:has(span)) {
    width: 36px;
    padding: 0;
}

.header-actions .btn:has(span) {
    padding: 0 16px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-accent {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.btn-accent:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

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

/* WORKSPACE LAYOUT */
.app-workspace {
    display: flex;
    flex-grow: 1;
    position: relative;
    height: calc(100vh - var(--header-height));
    width: 100vw;
    overflow: hidden;
}

/* SIDEBARS */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-strength));
    border-right: 1px solid var(--border-color);
    position: relative;
    transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    flex-shrink: 0;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.sidebar-content {
    width: var(--sidebar-width);
    height: 100%;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.2s ease;
}

/* COLLAPSIBLE STATE */
.sidebar.collapsed {
    width: 0;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

/* SIDEBAR TOGGLE BUTTONS */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 40px;
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 15;
    color: var(--text-muted);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sidebar-left .sidebar-toggle {
    right: -10px;
    border-left: none;
    border-radius: 0 6px 6px 0;
}

.sidebar-right .sidebar-toggle {
    left: -10px;
    border-right: none;
    border-radius: 6px 0 0 6px;
}

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

/* TABS */
.tab-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

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

/* SEARCH */
.search-bar {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 14px;
    height: 14px;
}

.search-bar input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px 8px 32px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    border-color: var(--accent);
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* GALLERY / PROJECTS */
.gallery-list, .local-projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-item, .local-project-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.01);
    position: relative; /* Setup absolute context for children buttons */
}

.gallery-item:hover, .local-project-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}

.project-btn-delete {
    position: absolute;
    right: 12px;
    bottom: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 4px;
}

.local-project-item:hover .project-btn-delete {
    opacity: 1;
}

.project-btn-delete:hover {
    color: #ef4444 !important;
    transform: scale(1.15);
}

.local-project-item.active, .gallery-item.active {
    border-color: var(--accent) !important;
    background: rgba(14, 165, 233, 0.05) !important;
    box-shadow: 0 2px 8px var(--accent-glow) !important;
    border-left: 4px solid var(--accent) !important;
}

.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.project-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.project-item-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.project-item-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.loading-state, .empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.drag-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #ffffff;
}

.drag-drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
}

.drag-drop-zone i {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

/* CANVAS CONTAINER */
.canvas-container {
    flex-grow: 1;
    position: relative;
    background-color: #f1f5f9;
    background-image: 
        radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px),
        radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 40px 40px, 10px 10px;
    background-position: 0 0, 0 0;
    overflow: hidden;
}

#editorCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* FLOATING TOOLBAR */
.floating-toolbar {
    position: absolute;
    left: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    z-index: 50;
}

.tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.tool-btn.danger:hover {
    background: var(--accent-danger);
    color: white;
}

.tool-divider {
    height: 1px;
    background: var(--border-color);
    margin: 2px 0;
}

/* HINT BOX */
.canvas-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    z-index: 50;
    pointer-events: none;
}

/* SECTIONS */
.properties-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.properties-section:last-of-type {
    border-bottom: none;
}

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

.properties-section h3 {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    margin: 0;
}

.properties-section h3 i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.icon-btn-action {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

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

.icon-btn-action#btnLockAspect {
    color: var(--text-muted);
}

.icon-btn-action#btnLockAspect.active {
    color: var(--accent);
}

.layers-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}

.layer-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    transition: all 0.15s ease;
}

.layer-list-item.active {
    border-color: var(--accent);
    background: rgba(14, 165, 233, 0.02);
}

.layer-list-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    min-width: 0;
}
.layer-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.15);
    background: none;
    padding: 0;
    flex-shrink: 0;
}
.layer-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}
.layer-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}
.layer-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

.layer-name-span {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.layer-name-input {
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
    flex-grow: 1;
    min-width: 0;
    width: 0;
    padding: 2px 4px;
    border-radius: 4px;
}

.layer-name-input:focus {
    border-color: var(--accent);
    outline: none;
}

.layer-list-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-btn-visibility,
.layer-btn-edit,
.layer-btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
    opacity: 0;
}

.layer-list-item:hover .layer-btn-visibility,
.layer-list-item:hover .layer-btn-edit,
.layer-list-item:hover .layer-btn-delete,
.layer-list-item.editing .layer-btn-visibility,
.layer-list-item.editing .layer-btn-edit,
.layer-list-item.editing .layer-btn-delete {
    opacity: 1;
}

.layer-list-item.layer-hidden .layer-btn-visibility {
    opacity: 1;
}

.layer-btn-visibility:hover,
.layer-btn-edit:hover {
    color: var(--accent);
}

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

.layer-list-item:not(.editing) .layer-color-picker {
    pointer-events: none;
    cursor: default;
}

/* ALIGN BUTTONS GRID */
.align-buttons-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

/* ARRANGE BUTTONS GRID */
.arrange-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.btn-align {
    padding: 8px 4px !important;
    min-width: 0;
    width: 100%;
}

.btn-align i {
    width: 16px;
    height: 16px;
}

/* ASPECT RATIO LOCK */
#btnLockAspect.active {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}

#btnLockAspect.active:hover {
    background: #bae6fd;
}

.w-full {
    width: 100%;
}

/* FORM STYLINGS */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 8px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 6px var(--accent-glow);
}

select {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:focus {
    border-color: var(--accent);
    outline: none;
}

/* INPUT UNITS */
.properties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group.half {
    grid-column: span 1;
}

.form-group:not(.half) {
    grid-column: span 2;
}

.input-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-unit input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 30px 6px 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.input-unit input:focus {
    border-color: var(--accent);
    outline: none;
}

.unit-label-span {
    position: absolute;
    right: 8px;
    pointer-events: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.property-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.prop-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 14px 0 10px 0;
}

.mt-8 {
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

/* KEYBOARD SHORTCUTS */
.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

kbd {
    background: #e2e8f0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    padding: 2px 5px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.7rem;
}

.header-select {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    width: auto;
    font-weight: 500;
}
#workspaceSelect {
    max-width: 130px;
}
.header-select:focus {
    border-color: var(--accent);
    outline: none;
}

.header-input {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}
.header-input:focus {
    border-color: var(--accent);
    background: #ffffff;
    outline: none;
}
.read-only-banner {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        top: -50px;
        opacity: 0;
    }
    to {
        top: 20px;
        opacity: 1;
    }
}

.read-only-banner.hidden {
    display: none !important;
}

.read-only-banner .banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f59e0b;
}

/* MODAL DIALOGS OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s ease-out;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 500px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    animation: modalZoom 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalZoom {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.modal-close-btn:hover {
    color: var(--text-primary);
}

/* Rotation Pivot Grid Selector */
.pivot-grid {
    display: grid;
    grid-template-columns: repeat(3, 24px);
    grid-template-rows: repeat(3, 24px);
    gap: 8px;
    width: fit-content;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 8px;
    margin: 4px 0 8px 0;
}

.pivot-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.pivot-dot:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--accent);
}

.pivot-dot.active {
    background: var(--accent);
    border-color: #ffffff;
    box-shadow: 0 0 6px var(--accent-glow);
}

.pivot-spacer {
    pointer-events: none;
    visibility: hidden;
}

/* TEXT ALIGN BUTTONS */
.align-btn-group {
    display: flex;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px;
    height: 32px;
    box-sizing: border-box;
}

.align-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.align-btn:hover {
    color: var(--accent);
    background: rgba(14, 165, 233, 0.08);
}

.align-btn.active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* PLUGINS SYSTEM STYLES */

/* Dropdown trigger and container */
.plugins-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Floating toolbar popover */
.plugins-dropdown-list {
    position: absolute;
    left: 48px;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    z-index: 100;
    min-width: 190px;
}

.plugin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    border: none;
    background: none;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.plugin-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.plugin-dropdown-item i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

/* Toggle Switches for Settings Modal */
.settings-plugin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.settings-plugin-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-plugin-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-plugin-path {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .25s ease;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .toggle-slider {
    background-color: var(--accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Plugin Modal Overlay custom sizing style */
.plugin-modal-content {
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    z-index: 101;
    position: relative;
    border: 1px solid var(--border-color);
    max-width: 95vw;
    max-height: 95vh;
}

.plugin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel);
}

.plugin-modal-title {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.plugin-modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.plugin-modal-close-btn:hover {
    color: #ef4444;
}

.plugin-modal-body {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

.plugin-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* SHAPES LIBRARY PANEL */
.shapes-library-panel {
    position: absolute;
    left: 80px;
    top: 20px;
    width: 290px;
    max-height: calc(100vh - 120px);
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 90;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: shapesPanelFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes shapesPanelFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.shapes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.shapes-panel-header h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.shapes-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.shapes-panel-close:hover {
    background: #f1f5f9;
    color: var(--accent-danger);
}

.shapes-panel-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
}

/* Category select container */
.shapes-panel-content .select-container {
    position: relative;
    width: 100%;
}

.shapes-category-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel-solid);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 32px;
}

.shapes-category-select:hover {
    border-color: var(--border-color-active);
}

.shapes-category-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Grid layout */
.shapes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 4px;
}

.shape-item {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    background: rgba(2, 132, 199, 0.02);
}

.shape-item svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* Default shapes style for preview inside items (gray vector representation) */
.shape-item svg path,
.shape-item svg rect,
.shape-item svg circle,
.shape-item svg ellipse,
.shape-item svg polygon,
.shape-item svg polyline {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    transition: stroke 0.2s ease;
}

.shape-item:hover svg path,
.shape-item:hover svg rect,
.shape-item:hover svg circle,
.shape-item:hover svg ellipse,
.shape-item:hover svg polygon,
.shape-item:hover svg polyline {
    stroke: var(--accent);
}

/* BUG TRACKER STYLES */
.bug-tab-btn:hover {
    color: var(--accent) !important;
}
.bug-tab-btn.active {
    color: var(--accent) !important;
    border-bottom-color: var(--accent) !important;
}

#bugAttachmentPasteArea:hover {
    border-color: var(--accent) !important;
    background: rgba(14, 165, 233, 0.04) !important;
    color: var(--accent) !important;
}
#bugAttachmentPasteArea:hover i {
    color: var(--accent) !important;
}

.bug-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}
.bug-card:hover {
    box-shadow: var(--shadow-md);
}
.bug-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 4px;
}
.bug-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.bug-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}
.bug-status-badge.open {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.bug-status-badge.resolved {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}
.bug-status-badge.bug {
    background: rgba(185, 28, 28, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.15);
}
.bug-status-badge.feature {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.15);
}
.bug-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.bug-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.bug-section {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.bug-section-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 4px;
}
.bug-steps-list {
    margin: 4px 0 0 0;
    padding-left: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.bug-attachment-link {
    font-size: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.bug-attachment-link:hover {
    text-decoration: underline;
}

/* 2-COLUMN GRID FOR VERTICAL TOOLBAR ON SMALL HEIGHT SCREENS */
@media (max-height: 750px) {
    .floating-toolbar {
        display: grid;
        grid-template-columns: repeat(2, 38px);
        gap: 6px;
    }
    .floating-toolbar .tool-divider {
        grid-column: span 2;
        height: 1px;
        width: 100%;
        margin: 2px 0;
    }
    .shapes-library-panel {
        left: 130px;
    }
    .plugins-dropdown-list {
        left: 86px;
    }
}

/* Custom Font Upload Button styles */
.icon-btn-secondary {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.icon-btn-secondary:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.icon-btn-secondary i {
    width: 14px;
    height: 14px;
}
.animate-spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Font Add Link */
.font-add-link {
    font-size: 0.75rem;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.15s ease;
}
.font-add-link:hover {
    color: var(--accent-hover);
}

/* Font drag drop zone hover */
#fontUploadDropZone:hover, #fontUploadDropZone.dragover {
    border-color: var(--accent) !important;
    background: var(--bg-hover) !important;
}

/* Collapsible Sections / Pull Open Tabs */
.properties-section.collapsible {
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}
.properties-section.collapsible .toggle-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding: 8px 12px;
    background: var(--bg-sidebar-header, rgba(0, 0, 0, 0.02));
    transition: background 0.2s ease;
}
.properties-section.collapsible .toggle-header:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
}
.properties-section.collapsible .section-chevron {
    transition: transform 0.2s ease;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}
.properties-section.collapsible.collapsed .section-chevron {
    transform: rotate(-90deg);
}
.properties-section.collapsible .section-content {
    max-height: 1200px;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding: 6px 12px 10px 12px;
}
.properties-section.collapsible.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}
.properties-section.collapsible.disabled-tab {
    opacity: 0.35;
    pointer-events: none;
}

/* Sidebar Right Layout Compactness */
.sidebar-right .sidebar-content {
    padding: 0 !important;
    gap: 0 !important;
}
.sidebar-right .properties-section {
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    margin: 0;
}
.sidebar-right .properties-section.collapsible {
    padding: 0;
}
.sidebar-right .properties-section.collapsible .toggle-header {
    padding: 6px 12px;
}
.sidebar-right .properties-section.collapsible .section-content {
    padding: 4px 12px 8px 12px;
}
.sidebar-right .form-group {
    margin-bottom: 4px !important;
}
.sidebar-right .form-group label {
    margin-bottom: 1px !important;
    font-size: 0.7rem !important;
}
.sidebar-right .properties-grid {
    gap: 4px 8px !important;
}
.sidebar-right input.form-input,
.sidebar-right select,
.sidebar-right .input-unit input {
    font-size: 0.75rem !important;
    padding: 2px 6px !important;
    height: 24px !important;
}
.sidebar-right .input-unit .unit-label-span {
    font-size: 0.65rem !important;
    line-height: 24px !important;
}
.sidebar-right button.btn {
    font-size: 0.68rem !important;
    padding: 2px 6px !important;
    height: 24px !important;
}
.sidebar-right .empty-state {
    padding: 8px !important;
    font-size: 0.72rem !important;
}
.sidebar-right .align-buttons-grid,
.sidebar-right .arrange-buttons-grid {
    gap: 4px !important;
}
.sidebar-right .prop-divider {
    margin: 8px 0 6px 0 !important;
}

#sectionShortcuts {
    border-bottom: none !important;
}



