/* ProScape AI Canvas App Styles */

.btn.outline {
    background: none;
    border: 1px solid #000;
    color: #374151;
}
.btn.default {
    background: linear-gradient(45deg, #28a745 0%, #20c997 100%);
    color: white;
    border: 1px solid #20c997;
}
.btn:hover {
    opacity: 0.9;
}
.w-200 { width: 200px; }
.w-full { width: 100%; }
input[type="text"] { padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 0.25rem; }
.image-list { height: calc(100vh - 100px); overflow-y: auto; }
.image-list-item { margin-bottom: 1rem; position: relative; }
.image-list-item img { max-width: 100%; height: auto; cursor: pointer; }

/* Mobile Toolbar Toggle */
.mobile-toolbar-toggle {
    display: none; /* Hidden on desktop */
    position: fixed;
    top: 112px;
    left: 0px;
    z-index: 1000;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.mobile-toolbar-toggle button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: none;
    color: #374151;
    border: none;
    font-size: 14px;
    font-weight: 500;
}

.current-tool-name {
    font-size: 14px;
    font-weight: normal;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
    backdrop-filter: blur(2px);
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Enhanced Toolbar */
.toolbar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Desktop-only: horizontal layout */
@media (min-width: 769px) {
    .toolbar-wrapper {
        flex-direction: row;
    }
    #mobileToolbar {
        display: none;
    }
}

/* Tool Groups - Desktop Layout (unchanged) */
.tool-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-group-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tool-group .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    min-height: 48px;
}

.tool-label {
    font-size: 14px;
    font-weight: 500;
}

/* Brush Controls */
.brush-controls {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.brush-control-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brush-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.brush-size-display {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.brush-preview-circle {
    width: 34px;
    height: 34px;
    border: 2px dashed #9ca3af;
    border-radius: 50%;
    margin: 0 auto;
    transition: all 0.2s ease;
    background: rgba(59, 130, 246, 0.1);
}

.responsive-slider {
    width: 150px; /* Default width */
    min-width: 100px; /* Minimum width before it might get too small */
    flex-grow: 1; /* Allow it to grow if space is available */
    max-width: 200px; /* Maximum width */
}

/* Mobile-first responsive design for touch devices */
@media (max-width: 768px) {
    /* Show mobile toggle, hide desktop toolbar initially */
    .mobile-toolbar-toggle {
        display: block;
    }

    .toolbar-wrapper {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        top: 80px;
        left: 20px;
        right: 20px;
        z-index: 999;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        background: #fff;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        transform: translateY(-20px);
        opacity: 0;
        transition: all 0.3s ease;
    }

    .toolbar-wrapper.show {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }

    /* Mobile overlay animation */
    .mobile-overlay {
        transition: opacity 0.2s ease;
    }

    /* Tool groups in mobile - 2 column layout */
    .tool-group {
        margin-bottom: 16px;
    }

    .tool-group:last-child {
        margin-bottom: 0;
    }

    /* Override desktop flex column for mobile 2-column grid */
    .tool-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Mobile-only: Container for tool buttons in 2-column grid */
    .tool-group .tool-button-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Special handling for brush controls to span full width */
    .brush-controls .brush-control-wrapper {
        grid-column: span 2;
    }

    /* Tool buttons in mobile */
    .tool-group .btn {
        min-height: 52px;
        font-size: 16px;
        border-radius: 12px;
    }

    .tool-label {
        font-size: 15px;
    }

    /* Brush controls in mobile */
    .responsive-slider {
        width: 100%;
    }

    .brush-preview-circle {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    /* Touch target minimum size (Apple & Android guidelines) */
    .btn {
        min-height: 44px;
        min-width: 44px;
        width: auto;
        height: auto;
        font-size: 18px;
        padding: 8px;
        border-radius: 8px;
    }

    /* Make slider touch-friendly */
    .responsive-slider {
        width: 100%;
        grid-column: span 2; /* Span 2 columns */
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
        background: #d3d3d3;
        outline: none;
    }

    .responsive-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #28a745;
        cursor: pointer;
    }

    .responsive-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #28a745;
        cursor: pointer;
        border: none;
    }

    /* Brush size text should span full width when needed */
    #brushSizeValue {
        grid-column: span 2;
        text-align: center;
        padding: 8px;
        font-size: 14px;
    }

    .col-8,
    .col-4 {
        width: 100%;
        padding: 0 10px;
    }

    .image-list {
        height: auto;
    }

    /* Make form inputs touch-friendly */
    input[type="text"], .form-control {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }

    /* Touch-friendly buttons in forms */
    .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Landscape phone adjustments */
@media (max-width: 640px) and (orientation: landscape) {
    .toolbar-wrapper {
        grid-template-columns: repeat(6, 1fr); /* More buttons per row in landscape */
        gap: 8px;
        padding: 8px;
    }

    .responsive-slider {
        grid-column: span 2;
    }

    #brushSizeValue {
        grid-column: span 2;
    }
}

/* Very small screens (portrait phones) */
@media (max-width: 480px) {
    .toolbar-wrapper {
        grid-template-columns: repeat(3, 1fr); /* 3 buttons per row on very small screens */
        gap: 8px;
        padding: 8px;
    }

    .responsive-slider {
        grid-column: span 3; /* Full width */
    }

    #brushSizeValue {
        grid-column: span 3;
        font-size: 12px;
    }

    .btn {
        min-height: 40px;
        min-width: 40px;
        font-size: 16px;
    }
}

#imageCanvas, #maskCanvas, #pencilCanvas { max-width: 100%; height: auto; }
#maskCanvas{ opacity: 60%; }

/* Canvas container for pinch-to-zoom */
#canvas-container {
    overflow: hidden;
    position: relative;
    touch-action: none; /* Prevent default touch behaviors */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#canvas-wrapper {
    transition: transform 0.1s ease-out;
    transform-origin: 0 0;
    position: relative;
}
.use-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    display: none;
}
.image-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}
.image-popup-content {
    margin: 5% auto;
    display: block;
    width: 80%;
    max-width: 700px;
    position: relative;
}
.image-popup-content img {
    width: 100%;
    height: auto;
}
.close-popup {
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 10px;
    cursor: pointer;
}
#brushPreview {
    border: 2px solid #000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.image-placeholder {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(248, 249, 250, 0.95);
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.placeholder-content {
    text-align: center;
}

.progress {
    width: 80%;
    margin: 0 auto;
}

#canvas-container {
    overflow: auto;
}

#canvas-wrapper {
    transform-origin: top left;
}

#selection-box {
    border: 2px dashed #28a745;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.3);
    position: fixed;
    z-index: 15;
    display: none;
    pointer-events: none;
}

#selection-box .handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #28a745;
    border: 2px solid #fff;
    border-radius: 3px;
    pointer-events: auto;
    cursor: nwse-resize;
}

/* Mobile-optimized selection handles */
@media (max-width: 768px) {
    #selection-box .handle {
        width: 20px;
        height: 20px;
        background-color: #28a745;
        border: 3px solid #fff;
        border-radius: 4px;
    }

    #selection-box .top-left { top: -10px; left: -10px; }
    #selection-box .top-right { top: -10px; right: -10px; }
    #selection-box .bottom-left { bottom: -10px; left: -10px; }
    #selection-box .bottom-right { bottom: -10px; right: -10px; }
}

#selection-box .top-left { top: -5px; left: -5px; cursor: nwse-resize; }
#selection-box .top-right { top: -5px; right: -5px; cursor: nesw-resize; }
#selection-box .bottom-left { bottom: -5px; left: -5px; cursor: nesw-resize; }
#selection-box .bottom-right { bottom: -5px; right: -5px; cursor: nwse-resize; }

#selection-box .selection-info {
    position: absolute;
    top: -25px;
    left: 0;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 5px;
    font-size: 12px;
    white-space: nowrap;
}

#selection-box .selection-actions {
    position: absolute;
    bottom: -45px;
    left: 0;
    display: flex;
    gap: 5px;
    align-items: center;
    pointer-events: auto;
    min-width: 250px;
}

/* jQuery UI Autocomplete styling */
.ui-autocomplete {
    max-width: 160px !important;
    max-height: 150px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 99999 !important;
    font-size: 13px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.ui-menu-item {
    padding: 0 !important;
}

.ui-menu-item-wrapper {
    padding: 4px 12px !important;
    cursor: pointer !important;
    border: none !important;
}

#generateSelectionButton {
    min-width: 100px;
}

/* ============ NEW FULL CANVAS LAYOUT ============ */

/* Full Canvas Container */
.app-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f8f9fa;
    overflow: hidden;
    z-index: 1;
}

/* Upload Area (centered when no image) */
.upload-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.upload-area.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

#uploadArea.hidden {
    display: none !important;
}

.upload-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px dashed #e2e8f0;
    min-width: 300px;
}

.upload-icon {
    font-size: 48px;
    color: #64748b;
    margin-bottom: 20px;
}

.upload-button {
    background: linear-gradient(45deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.upload-button:hover {
    background: linear-gradient(45deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.upload-text {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* Canvas Area */
.canvas-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.canvas-area.no-image {
    pointer-events: none;
}

#canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.canvas-wrapper:active {
    cursor: grabbing;
}

#imageCanvas, #maskCanvas, #pencilCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    max-width: none;
    max-height: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

#maskCanvas {
    pointer-events: auto;
    z-index: 2;
}

#pencilCanvas {
    pointer-events: auto;
    z-index: 3;
}

/* Floating Sidebar */
.floating-sidebar {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}

.sidebar-group {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid transparent;
}

.sidebar-group:hover {
    background: rgba(40, 167, 69, 0.1);
}

.sidebar-group[data-active="true"] {
    background: linear-gradient(45deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #20c997;
}

.sidebar-icon i {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.sidebar-icon span {
    font-size: 11px;
    font-weight: 500;
    display: block;
    line-height: 1.2;
}

/* Disabled sidebar button styling */
.sidebar-group.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(156, 163, 175, 0.1) !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
}

.sidebar-group.disabled:hover {
    background: rgba(156, 163, 175, 0.1) !important;
    transform: none !important;
}

/* Combined Floating Bottom Toolbar */
.floating-bottom-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 90vw;
    min-width: 600px;
}

.toolbar-prompt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    transition: all 0.3s ease;
}

.toolbar-prompt-row.hidden {
    display: none;
}

.toolbar-tools-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.toolbar-prompt-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
    min-width: 200px;
}

.toolbar-prompt-input:focus {
    border-color: #3b82f6;
}

.toolbar-guidance-control {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.toolbar-guidance-control label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.toolbar-generate-btn {
    background: #10b981;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.toolbar-generate-btn:hover {
    background: #059669;
}

.guidance-slider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    accent-color: #10b981;
}

.guidance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.bottom-toolbar-group {
    display: none;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.bottom-toolbar-group.active {
    display: flex;
}

.toolbar-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-size: 16px;
    color: #374151;
}

.toolbar-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.toolbar-btn.active {
    background: linear-gradient(45deg, #28a745 0%, #20c997 100%);
    border-color: #20c997;
    color: white;
}

.toolbar-btn.generate-btn {
    background: #10b981;
    border-color: #10b981;
    color: white;
    padding: 10px 16px;
    gap: 6px;
    font-weight: 500;
}

.toolbar-btn.generate-btn:hover {
    background: #059669;
}

.toolbar-separator {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    margin: 0 4px;
}

/* Brush Size Control */
.brush-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

/* Pencil Prompt Control */
.pencil-prompt-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.pencil-prompt-input {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
    background: white;
}

.pencil-prompt-input:focus {
    border-color: #3b82f6;
}

.pencil-generate-btn {
    background: #10b981;
    border: none;
    border-radius: 6px;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pencil-generate-btn:hover {
    background: #059669;
}

.brush-slider {
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.brush-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
}

.size-display {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    min-width: 20px;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.zoom-btn {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
    color: #374151;
}

.zoom-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.zoom-level {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    padding: 4px 0;
}

.selection-prompt {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    min-width: 200px;
}

.selection-generate {
    background: linear-gradient(45deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.selection-generate:hover {
    background: linear-gradient(45deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.brush-preview {
    position: fixed;
    border: 2px solid #28a745;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    display: none;
    background: rgba(59, 130, 246, 0.1);
}


/* Disabled button styling */
.toolbar-btn:disabled,
.toolbar-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(156, 163, 175, 0.1) !important;
    color: #9ca3af !important;
}

.toolbar-btn:disabled:hover,
.toolbar-btn[disabled]:hover {
    transform: none !important;
    background: rgba(156, 163, 175, 0.1) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .floating-sidebar {
        left: 10px;
        min-width: 60px;
        padding: 6px;
    }

    .sidebar-group {
        padding: 8px;
    }

    .sidebar-icon i {
        font-size: 16px;
    }

    .sidebar-icon span {
        display: none;
    }

    .floating-bottom-toolbar {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 12px 16px;
        max-width: 95vw;
        min-width: auto;
        flex-direction: column;
        gap: 8px;
    }

    .toolbar-prompt-row {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .toolbar-guidance-control {
        justify-content: space-between;
        width: 100%;
    }

    .toolbar-prompt-input {
        min-width: auto;
        width: 100%;
    }

    /* Hide rectangle tool selection actions on mobile */
    #selection-box .selection-actions {
        display: none !important;
    }

    /* Mobile Rectangle Modal */
    .mobile-rectangle-modal {
        max-width: 90vw;
        width: 400px;
    }

    .mobile-rectangle-modal .modal-header {
        padding: 15px 20px 10px;
        border-bottom: 1px solid #dee2e6;
    }

    .mobile-rectangle-modal .modal-body {
        padding: 20px;
    }

    .mobile-rectangle-modal .modal-footer {
        padding: 10px 20px 15px;
        border-top: 1px solid #dee2e6;
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }

    .mobile-rectangle-modal .form-control {
        width: 100%;
        margin-bottom: 0;
    }

    .toolbar-btn {
        min-width: 36px;
        height: 36px;
        padding: 8px;
        font-size: 14px;
    }

    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .upload-content {
        padding: 30px 20px;
        min-width: 280px;
    }

    .upload-icon {
        font-size: 40px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hide old mobile toolbar completely */
.mobile-toolbar-toggle,
.mobile-overlay,
.toolbar-wrapper {
    display: none !important;
}

/*Put navbar in front*/
.navbar {
    z-index: 2;
}