/**
 * MOBILE EDITOR STYLES
 * These styles ONLY apply to screens below 768px width.
 * Desktop styles remain completely untouched.
 */

/* ============================================
   MOBILE DETECTION & BASE LAYOUT
   ============================================ */

/* Hide all mobile elements by default */
.mobile-top-toolbar,
.mobile-bottom-toolbar,
.mobile-drawer {
    display: none;
}

/* Show mobile elements only on mobile screens */
@media (max-width: 767.98px) {

    /* ============================================
       HIDE DESKTOP-ONLY ELEMENTS ON MOBILE
       ============================================ */
    
    /* ----- A) EDITOR HEADER ----- */
    /* Hide: Back button, Theme name, Fullscreen, Preview, Proceed to Checkout */
    .editor-header {
        display: none !important;
    }
    
    /* ----- B) SIDEBAR / PANEL CONTROLS ----- */
    /* Hide: Theme name panel, Quick Add, Assets sidebar, Draft list, Checkout sidebar */
    .editor-sidebar {
        display: none !important;
    }
    
    /* ----- C) CANVAS TOOLBAR (Floating controls above canvas) ----- */
    /* Hide: Add Text, Add Image, Add Shape, Undo/Redo, Duplicate, Layer controls, Delete */
    .canvas-toolbar {
        display: none !important;
    }
    
    /* ----- D) TEXT TOOLBAR (Desktop text formatting bar) ----- */
    .text-toolbar {
        display: none !important;
    }
    
    /* ----- E) FOOTER ----- */
    /* Hide footer only on mobile editor page */
    body.editor-page footer.footer,
    body.editor-page .footer {
        display: none !important;
    }
    
    /* ----- F) NAVBAR ----- */
    /* Hide navbar on mobile editor for full-screen experience */
    body.editor-page .navbar,
    body.editor-page #mainNavbar,
    body.editor-page nav.navbar {
        display: none !important;
    }
    
    /* ----- G) MAIN CONTENT WRAPPER ----- */
    /* Remove any padding/margin from main that might affect layout */
    body.editor-page main {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* ============================================
       FULL-SPACE CANVAS LAYOUT (MOBILE)
       ============================================ */
    
    /* Editor App takes full viewport */
    .editor-app {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important; /* Dynamic viewport height for mobile */
        overflow: hidden !important;
        z-index: 1000;
    }
    
    /* Main editor area fills available space */
    .editor-main {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        /* Account for top and bottom toolbars */
        padding-top: 52px !important; /* Height of mobile top toolbar */
        padding-bottom: 80px !important; /* Height of mobile bottom toolbar */
        height: 100% !important;
        overflow: hidden !important;
    }
    
    /* Canvas area fills remaining space */
    .editor-canvas-area {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        height: 100% !important;
    }
    
    /* Canvas wrapper takes full available space */
    .canvas-wrapper {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.5rem !important;
        overflow: auto !important;
        height: 100% !important;
        background: #f0f2f5 !important;
    }
    
    /* Canvas container responsive sizing */
    .canvas-container {
        max-width: 100% !important;
        max-height: 100% !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
    }
    
    /* Fabric canvas should scale to fit */
    .canvas-container canvas {
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }
    
    /* Loading overlay adjustments */
    .editor-loading {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 9999 !important;
    }
    
    /* Hide desktop elements on mobile */
    .editor-header .header-actions .btn span {
        display: none;
    }
    
    /* ============================================
       MOBILE TOP STICKY TOOLBAR
       ============================================ */
    .mobile-top-toolbar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        z-index: 1100;
        padding: 0.5rem;
        padding-top: calc(0.5rem + env(safe-area-inset-top));
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .mobile-toolbar-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mobile-toolbar-group {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .mobile-tool-btn {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 8px;
        background: rgba(255,255,255,0.15);
        color: white;
        font-size: 0.875rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-tool-btn:hover,
    .mobile-tool-btn:active {
        background: rgba(255,255,255,0.3);
    }
    
    .mobile-tool-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    
    .mobile-tool-btn.mobile-checkout-btn {
        background: #f6ad55;
        color: #744210;
    }
    
    .mobile-tool-btn.mobile-checkout-btn:hover,
    .mobile-tool-btn.mobile-checkout-btn:active {
        background: #ed8936;
    }
    
    .mobile-toolbar-divider {
        width: 1px;
        height: 20px;
        background: rgba(255,255,255,0.3);
        margin: 0 0.125rem;
    }
    
    .mobile-zoom-level {
        font-size: 0.6875rem;
        color: rgba(255,255,255,0.9);
        min-width: 36px;
        text-align: center;
    }
    
    /* ============================================
       MOBILE BOTTOM STICKY TOOLBAR
       ============================================ */
    .mobile-bottom-toolbar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 1100;
        border-top: 1px solid #e2e8f0;
        padding: 0.5rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .mobile-bottom-content {
        width: 100%;
    }
    
    .mobile-scroll-container {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 0.5rem;
        padding: 0.25rem 0;
    }
    
    .mobile-scroll-container::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 64px;
        padding: 0.5rem 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #f8fafc;
        color: #4a5568;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.2s;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    
    .mobile-action-btn span {
        font-size: 0.625rem;
        margin-top: 0.25rem;
        white-space: nowrap;
    }
    
    .mobile-action-btn i {
        font-size: 1.125rem;
    }
    
    .mobile-action-btn:hover,
    .mobile-action-btn:active {
        background: #edf2f7;
        border-color: #667eea;
        color: #667eea;
    }
    
    .mobile-action-btn.active {
        background: #667eea;
        border-color: #667eea;
        color: white;
    }
    
    .mobile-action-btn.danger {
        color: #e53e3e;
    }
    
    .mobile-action-btn.danger:hover,
    .mobile-action-btn.danger:active {
        background: #fee2e2;
        border-color: #e53e3e;
    }
    
    /* ============================================
       MOBILE DRAWER / SLIDE-UP PANELS
       ============================================ */
    .mobile-drawer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1200;
        visibility: hidden;
        pointer-events: none;
    }
    
    .mobile-drawer.open {
        visibility: visible;
        pointer-events: auto;
    }
    
    .drawer-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-drawer.open .drawer-backdrop {
        opacity: 1;
    }
    
    .drawer-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        max-height: 60vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .drawer-content-large {
        max-height: 80vh;
    }
    
    .mobile-drawer.open .drawer-content {
        transform: translateY(0);
    }
    
    .drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
        flex-shrink: 0;
    }
    
    .drawer-header h6 {
        margin: 0;
        font-weight: 600;
        color: #2d3748;
        display: flex;
        align-items: center;
    }
    
    .drawer-close {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: #edf2f7;
        color: #4a5568;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .drawer-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
    }
    
    /* ============================================
       DRAWER: FONT SELECTION
       ============================================ */
    .font-search-box {
        display: flex;
        align-items: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .font-search-box i {
        color: #a0aec0;
        margin-right: 0.5rem;
    }
    
    .font-search-box input {
        border: none;
        background: transparent;
        flex: 1;
        font-size: 0.9375rem;
        outline: none;
    }
    
    .font-list {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .font-category {
        font-size: 0.75rem;
        font-weight: 600;
        color: #718096;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .font-category:first-child {
        margin-top: 0;
    }
    
    .font-option {
        padding: 0.875rem;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s;
        font-size: 1.125rem;
    }
    
    .font-option:hover,
    .font-option:active {
        background: #f0f0ff;
    }
    
    .font-option.selected {
        background: #667eea;
        color: white;
    }
    
    /* ============================================
       DRAWER: FONT SIZE
       ============================================ */
    .size-slider-container {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .size-slider {
        flex: 1;
        height: 6px;
        -webkit-appearance: none;
        appearance: none;
        background: #e2e8f0;
        border-radius: 3px;
        outline: none;
    }
    
    .size-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #667eea;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    }
    
    .size-label {
        font-size: 0.75rem;
        color: #718096;
    }
    
    .size-value-display {
        text-align: center;
        font-size: 2rem;
        font-weight: 700;
        color: #2d3748;
        margin-bottom: 1.5rem;
    }
    
    .size-presets {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .size-preset {
        padding: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: white;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .size-preset:hover,
    .size-preset:active {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }
    
    /* ============================================
       DRAWER: COLOR PICKER
       ============================================ */
    .color-picker-container {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .color-picker-container input[type="color"] {
        width: 60px;
        height: 60px;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        padding: 0;
    }
    
    .color-hex-input {
        display: flex;
        align-items: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        font-family: monospace;
    }
    
    .color-hex-input span {
        color: #a0aec0;
        margin-right: 0.25rem;
    }
    
    .color-hex-input input {
        border: none;
        background: transparent;
        width: 70px;
        font-size: 1rem;
        font-family: monospace;
        text-transform: uppercase;
        outline: none;
    }
    
    .color-presets {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .color-preset {
        width: 100%;
        aspect-ratio: 1;
        border-radius: 8px;
        cursor: pointer;
        transition: transform 0.2s;
    }
    
    .color-preset:hover,
    .color-preset:active {
        transform: scale(1.1);
    }
    
    .color-preset.selected {
        box-shadow: 0 0 0 3px #667eea;
    }
    
    .background-color-section h6 {
        font-size: 0.875rem;
        font-weight: 600;
    }
    
    .background-color-section input[type="color"] {
        width: 50px;
        height: 40px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 2px;
        cursor: pointer;
    }
    
    /* ============================================
       DRAWER: ALIGNMENT
       ============================================ */
    .align-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .align-option {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1.25rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: white;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .align-option i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: #4a5568;
    }
    
    .align-option span {
        font-size: 0.8125rem;
        color: #4a5568;
    }
    
    .align-option:hover,
    .align-option:active,
    .align-option.active {
        background: #667eea;
        border-color: #667eea;
    }
    
    .align-option:hover i,
    .align-option:hover span,
    .align-option:active i,
    .align-option:active span,
    .align-option.active i,
    .align-option.active span {
        color: white;
    }
    
    /* ============================================
       DRAWER: SPACING
       ============================================ */
    .spacing-control {
        margin-bottom: 1.5rem;
    }
    
    .spacing-control label {
        display: block;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #4a5568;
    }
    
    .spacing-slider-row {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .spacing-slider-row input[type="range"] {
        flex: 1;
        height: 6px;
        -webkit-appearance: none;
        appearance: none;
        background: #e2e8f0;
        border-radius: 3px;
    }
    
    .spacing-slider-row input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #667eea;
        cursor: pointer;
    }
    
    .spacing-slider-row span {
        min-width: 40px;
        text-align: right;
        font-weight: 600;
        color: #2d3748;
    }
    
    /* ============================================
       DRAWER: ACTIONS LIST
       ============================================ */
    .action-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: white;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 1rem;
    }
    
    .action-item i {
        width: 24px;
        text-align: center;
        color: #667eea;
    }
    
    .action-item span {
        color: #2d3748;
    }
    
    .action-item:hover,
    .action-item:active {
        background: #f8fafc;
        border-color: #667eea;
    }
    
    .action-item.danger i {
        color: #e53e3e;
    }
    
    .action-item.danger:hover,
    .action-item.danger:active {
        background: #fee2e2;
        border-color: #e53e3e;
    }
    
    .action-list hr {
        border: none;
        border-top: 1px solid #e2e8f0;
        margin: 0.5rem 0;
    }
    
    /* ============================================
       DRAWER: ASSETS
       ============================================ */
    .asset-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .asset-tab {
        flex: 1;
        padding: 0.625rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: white;
        font-size: 0.8125rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .asset-tab.active {
        background: #667eea;
        color: white;
        border-color: #667eea;
    }
    
    .asset-search {
        display: flex;
        align-items: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.625rem;
        margin-bottom: 1rem;
    }
    
    .asset-search i {
        color: #a0aec0;
        margin-right: 0.5rem;
    }
    
    .asset-search input {
        border: none;
        background: transparent;
        flex: 1;
        font-size: 0.875rem;
        outline: none;
    }
    
    .asset-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .asset-item {
        aspect-ratio: 1;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .asset-item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .asset-item:hover,
    .asset-item:active {
        border-color: #667eea;
        transform: scale(1.05);
    }
    
    .asset-loading {
        grid-column: 1 / -1;
        text-align: center;
        padding: 2rem;
        color: #a0aec0;
    }
    
    .asset-loading i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* ============================================
       DRAWER: SHAPES
       ============================================ */
    .shape-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .shape-option {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: white;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .shape-option svg {
        width: 40px;
        height: 40px;
        color: #4a5568;
        margin-bottom: 0.5rem;
    }
    
    .shape-option span {
        font-size: 0.75rem;
        color: #4a5568;
    }
    
    .shape-option:hover,
    .shape-option:active {
        background: #667eea;
        border-color: #667eea;
    }
    
    .shape-option:hover svg,
    .shape-option:hover span,
    .shape-option:active svg,
    .shape-option:active span {
        color: white;
    }
    
    /* ============================================
       DRAWER: DRAFTS LIST
       ============================================ */
    .drafts-drawer-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .drawer-draft-tab {
        flex: 1;
        padding: 0.625rem;
        border: none;
        border-radius: 8px;
        background: #f8fafc;
        color: #64748b;
        font-size: 0.8125rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .drawer-draft-tab.active {
        background: #667eea;
        color: white;
    }
    
    .drafts-drawer-list {
        max-height: 350px;
        overflow-y: auto;
    }
    
    .drawer-draft-card {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 0.875rem;
        margin-bottom: 0.75rem;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .drawer-draft-card:hover,
    .drawer-draft-card:active {
        border-color: #667eea;
    }
    
    .drawer-draft-card.active {
        border-color: #667eea;
        background: #f0f0ff;
    }
    
    .drawer-draft-card.completed {
        border-color: #48bb78;
        background: #f0fff4;
    }
    
    .drawer-draft-name {
        font-weight: 600;
        font-size: 0.9375rem;
        color: #2d3748;
        margin-bottom: 0.25rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .drawer-draft-name .badge {
        font-size: 0.625rem;
    }
    
    .drawer-draft-meta {
        font-size: 0.75rem;
        color: #718096;
        margin-bottom: 0.5rem;
    }
    
    .drawer-draft-actions {
        display: flex;
        gap: 0.375rem;
        flex-wrap: wrap;
    }
    
    .drawer-draft-actions .btn {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
    }
    
    .drafts-drawer-footer {
        padding-top: 1rem;
        border-top: 1px solid #e2e8f0;
        margin-top: auto;
    }
    
    /* ============================================
       ADJUST EDITOR LAYOUT FOR MOBILE TOOLBARS
       ============================================ */
    
    /* Add space for top toolbar */
    .editor-container {
        padding-top: 52px !important;
    }
    
    /* Add space for bottom toolbar */
    .editor-container {
        padding-bottom: 76px !important;
    }
    
    /* When text editing toolbar is visible, add more space */
    .editor-container.text-editing {
        padding-bottom: 76px !important;
    }
    
    /* Hide the existing desktop header elements on mobile */
    .editor-header h1 {
        display: none;
    }
    
    .editor-header small {
        display: none;
    }
    
    /* Adjust editor header for mobile */
    .editor-header {
        padding: 0.375rem 0.75rem;
        min-height: 44px;
    }
    
    /* Hide desktop panel toggles on mobile (we have our own) */
    .panel-toggle {
        display: none !important;
    }
    
    /* Hide the desktop checkout button on mobile */
    .editor-header .header-actions .btn-warning {
        display: none !important;
    }
    
    /* Hide existing mobile bottom bar */
    .mobile-bottom-bar {
        display: none !important;
    }
    
    /* Canvas area adjustments */
    .canvas-area {
        padding: 0.5rem;
    }
    
    /* Text edit toolbar adjustments */
    .text-edit-toolbar {
        display: none !important; /* We use our own mobile text toolbar */
    }
    
    /* ============================================
       EMPTY STATE STYLING
       ============================================ */
    .drafts-empty {
        text-align: center;
        padding: 2rem 1rem;
        color: #a0aec0;
    }
    
    .drafts-empty i {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .drafts-empty p {
        margin: 0;
        font-size: 0.875rem;
    }
    
    /* ============================================
       SCROLLBAR STYLING
       ============================================ */
    .drawer-body::-webkit-scrollbar,
    .font-list::-webkit-scrollbar,
    .asset-grid::-webkit-scrollbar,
    .drafts-drawer-list::-webkit-scrollbar {
        width: 4px;
    }
    
    .drawer-body::-webkit-scrollbar-track,
    .font-list::-webkit-scrollbar-track,
    .asset-grid::-webkit-scrollbar-track,
    .drafts-drawer-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .drawer-body::-webkit-scrollbar-thumb,
    .font-list::-webkit-scrollbar-thumb,
    .asset-grid::-webkit-scrollbar-thumb,
    .drafts-drawer-list::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    /* ============================================
       TOUCH FEEDBACK
       ============================================ */
    .mobile-tool-btn:active,
    .mobile-action-btn:active,
    .drawer-close:active,
    .font-option:active,
    .size-preset:active,
    .color-preset:active,
    .align-option:active,
    .action-item:active,
    .asset-tab:active,
    .shape-option:active,
    .drawer-draft-tab:active {
        transform: scale(0.95);
    }
    
    /* ============================================
       LANDSCAPE MODE ADJUSTMENTS
       ============================================ */
    @media (max-height: 500px) and (orientation: landscape) {
        .mobile-top-toolbar {
            padding: 0.25rem 0.5rem;
        }
        
        .mobile-tool-btn {
            width: 32px;
            height: 32px;
            font-size: 0.75rem;
        }
        
        .mobile-bottom-toolbar {
            padding: 0.25rem 0.5rem;
        }
        
        .mobile-action-btn {
            min-width: 52px;
            padding: 0.375rem 0.5rem;
        }
        
        .mobile-action-btn i {
            font-size: 0.875rem;
        }
        
        .mobile-action-btn span {
            font-size: 0.5625rem;
        }
        
        .editor-container {
            padding-top: 40px !important;
            padding-bottom: 56px !important;
        }
        
        .drawer-content {
            max-height: 80vh;
        }
    }
    
    /* ============================================
       VERY SMALL SCREENS
       ============================================ */
    @media (max-width: 359px) {
        .mobile-tool-btn {
            width: 32px;
            height: 32px;
        }
        
        .mobile-zoom-level {
            display: none;
        }
        
        .mobile-action-btn {
            min-width: 56px;
            padding: 0.375rem 0.5rem;
        }
        
        .color-presets {
            grid-template-columns: repeat(4, 1fr);
        }
    }
}

/* ============================================
       TOAST NOTIFICATIONS
       ============================================ */
    .mobile-toast-container {
        position: fixed;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10000;
        display: flex;
        flex-direction: column;
        gap: 8px;
        pointer-events: none;
        max-width: 90vw;
    }
    
    .mobile-toast {
        padding: 10px 16px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        animation: toastSlideIn 0.3s ease-out;
        pointer-events: auto;
        min-width: 200px;
        justify-content: center;
    }
    
    .mobile-toast.mobile-toast-success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
    }
    
    .mobile-toast.mobile-toast-error {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: white;
    }
    
    .mobile-toast.mobile-toast-warning {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
    }
    
    .mobile-toast.mobile-toast-info {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
    }
    
    .mobile-toast i {
        font-size: 16px;
    }
    
    @keyframes toastSlideIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes toastSlideOut {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(-20px);
        }
    }
    
    .mobile-toast.hide {
        animation: toastSlideOut 0.3s ease-in forwards;
    }
    
    /* ============================================
       MOBILE ASSET TABS (Dynamic Asset Types)
       ============================================ */
    .mobile-asset-tabs {
        display: flex;
        gap: 6px;
        padding: 8px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.2);
    }
    
    .mobile-asset-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-asset-tab {
        flex-shrink: 0;
        padding: 8px 14px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 20px;
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-transform: capitalize;
        white-space: nowrap;
    }
    
    .mobile-asset-tab:hover,
    .mobile-asset-tab:active {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .mobile-asset-tab.active {
        background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
        border-color: transparent;
        color: white;
        box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
    }
    
    /* Asset Grid Wrapper */
    .mobile-asset-grid-wrapper {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-asset-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .mobile-asset-item {
        aspect-ratio: 1;
        border-radius: 8px;
        overflow: hidden;
        cursor: pointer;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease;
        position: relative;
    }
    
    .mobile-asset-item:hover,
    .mobile-asset-item:active {
        border-color: rgba(124, 58, 237, 0.5);
        transform: scale(0.98);
    }
    
    .mobile-asset-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .mobile-asset-item.loading {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-asset-item.loading::after {
        content: '';
        width: 24px;
        height: 24px;
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-top-color: #7c3aed;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    
    /* Asset Loading State */
    .mobile-assets-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3rem;
        color: rgba(255, 255, 255, 0.6);
        gap: 12px;
    }
    
    .mobile-assets-loading i {
        font-size: 2rem;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
    
    /* Empty State for Assets */
    .mobile-assets-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 3rem;
        color: rgba(255, 255, 255, 0.5);
        text-align: center;
        gap: 8px;
    }
    
    .mobile-assets-empty i {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    /* Home button styling */
    #mobileHomeBtn {
        text-decoration: none;
        color: white;
    }
    
    #mobileHomeBtn:hover,
    #mobileHomeBtn:active {
        color: white;
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Hide on desktop (screens >= 768px) */
@media (min-width: 768px) {
    .mobile-top-toolbar,
    .mobile-bottom-toolbar,
    .mobile-drawer,
    .mobile-toast-container {
        display: none !important;
    }
}
