/* =============================================================================
   MAIN STYLESHEET - MODULAR CSS ARCHITECTURE
   =============================================================================
   
   This file imports all modular CSS components in the correct order
   */

/* Import modular CSS components */
@import 'base.css';
@import 'components.css';
@import 'layout.css';

/* Ensure menu is always visible by default */
#menuBar {
    transform: translateY(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

#kaleido {
    display: block;
    cursor: crosshair;
    position: absolute;
    top: 0;
    left: 0;
}

/* Professional crop marks for canvas display */
.canvas-with-crops {
    position: relative;
}

/* Create simple corner crop marks */
.canvas-with-crops::before,
.canvas-with-crops::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

/* Top-left and bottom-right crop marks */
.canvas-with-crops::before {
    top: -10px;
    left: -10px;
    width: 15px;
    height: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    border-left: 2px solid rgba(255, 255, 255, 0.8);
}

.canvas-with-crops::after {
    bottom: -10px;
    right: -10px;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
    border-right: 2px solid rgba(255, 255, 255, 0.8);
}

.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 50px;
    transform: translateY(0) !important;
    transition: transform 0.3s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

.menu-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-right: 20px;
    font-family: 'IBM Plex Mono', monospace;
}

.menu-section {
    position: relative;
    margin-right: 20px;
}

.menu-tab {
    background: transparent;
    color: white;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 10px;
    font-family: 'IBM Plex Mono', monospace;
    transition: all 0.2s ease;
    position: relative;
}

.menu-tab:hover {
    background: #333;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #333;
    backdrop-filter: blur(15px);
    padding: 8px 16px 8px 32px;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border: none;
}

.menu-section:hover .submenu {
    opacity: 1;
    visibility: visible;
}

.menu-section:hover .menu-tab {
    background: #333;
}

.submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    padding: 8px 32px 8px 32px;
    margin-left: -32px;
    margin-right: -32px;
    border-radius: 0;
    transition: all 0.15s ease;
    position: relative;
    cursor: pointer;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* Active state - clicked/selected items */
.submenu-item.active {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

/* Toggle pill switch (replaces checkmark) */
.submenu-item.toggle-item {
    padding-right: 72px;
}

/* Track */
.submenu-item.toggle-item::after {
    content: '';
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease, border-color 0.2s ease;
}

/* Knob */
.submenu-item.toggle-item::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 32px;
    transform: translate(calc(-100% + -2px), -50%);
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: transform 0.2s ease, background 0.2s ease;
}

/* Active state visuals */
.submenu-item.toggle-item.active::after {
    content: '';
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
}

.submenu-item.toggle-item.active::before {
    transform: translate(-4px, -50%);
    background: #fff;
}

@keyframes checkmark-appear {
    0% {
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

.submenu-item:last-child {
    margin-bottom: 0;
}

.submenu-subgroup {
    margin-left: 0;
    padding-left: 0;
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    margin-top: 2px;
    margin-bottom: 2px;
}

.submenu-subgroup .submenu-item {
    margin-bottom: 1px;
    font-size: 9px;
    padding: 6px 32px 6px 40px;
    margin-left: -32px;
    margin-right: -32px;
}

.submenu-subgroup .submenu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.submenu-subgroup .submenu-item.active {
    background: rgba(255, 255, 255, 0.03);
}

.submenu-subgroup .submenu-item.active::after {
    right: 32px;
    font-size: 14px;
    font-weight: 900;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.25);
}

.contextual-group {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.contextual-group.active {
    opacity: 1;
}

/* Professional Toggle Items - No Labels Needed */
.submenu-item.toggle-item {
    justify-content: flex-start;
}

.submenu-item.toggle-item .toggle-text {
    flex: 1;
}

/* Professional Range Inputs */
.submenu-item input[type="range"] {
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    transition: all 0.15s ease;
}

.submenu-item input[type="range"]:hover {
    background: rgba(255, 255, 255, 0.25);
}

.submenu-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.15s ease;
}

.submenu-item input[type="range"]::-webkit-slider-thumb:hover {
    background: #ffffff;
    transform: scale(1.1);
}

/* Professional Select Dropdowns */
.submenu-item select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    width: 120px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
}

.submenu-item select:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.submenu-item select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(100, 200, 100, 0.5);
    outline: none;
}

.submenu-item select option {
    background: #1a1a1a;
    color: white;
    padding: 4px;
}

/* Professional Value Display */
.value-display {
    color: rgba(255, 255, 255, 0.7);
    font-size: 9px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Professional Color Picker */
.submenu-item input[type="color"] {
    width: 60px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

.submenu-item input[type="color"]:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.submenu-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
}

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

.toggle-menu {
    position: relative;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'IBM Plex Mono', monospace;
    z-index: 1;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toggle-menu:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.menu-bar.visible {
    transform: translateY(0);
}

/* Collapsed nav: hide sections/submenus but keep burger visible */
.menu-bar.collapsed .menu-section,
.menu-bar.collapsed .menu-title {
    display: none !important;
}

.menu-bar.collapsed #menuToggle {
    display: inline-block !important;
}

/* Preset Modal */
.preset-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.preset-modal.show {
    display: flex;
}

.preset-modal-content {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 30px;
    min-width: 400px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.preset-modal h3 {
    color: white;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.preset-modal input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    margin-bottom: 20px;
    outline: none;
    box-sizing: border-box;
}

.preset-modal input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.preset-modal input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.preset-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.preset-modal button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 80px;
}

.preset-modal button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.preset-modal button.primary {
    background: rgba(100, 200, 100, 0.3);
    border-color: rgba(100, 200, 100, 0.5);
}

.preset-modal button.primary:hover {
    background: rgba(100, 200, 100, 0.5);
    border-color: rgba(100, 200, 100, 0.7);
}

/* Professional Button Styles for Navigation */
.pro-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    text-align: center !important;
}

.pro-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.pro-btn:active {
    transform: translateY(0) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.pro-btn.primary {
    background: rgba(100, 200, 100, 0.2) !important;
    border-color: rgba(100, 200, 100, 0.4) !important;
    color: #64c864 !important;
}

.pro-btn.primary:hover {
    background: rgba(100, 200, 100, 0.3) !important;
    border-color: rgba(100, 200, 100, 0.6) !important;
}

.pro-btn.secondary {
    background: rgba(255, 100, 100, 0.2) !important;
    border-color: rgba(255, 100, 100, 0.4) !important;
    color: #ff6464 !important;
}

.pro-btn.secondary:hover {
    background: rgba(255, 100, 100, 0.3) !important;
    border-color: rgba(255, 100, 100, 0.6) !important;
}

/* Professional Submenu Background */
.submenu {
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

/* Mobile responsive design */
/* Desktop styles - ensure menu is always visible */
@media (min-width: 769px) {
    .menu-bar {
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }
}

@media (max-width: 768px) {
    /* Hide navigation completely on mobile */
    #menuBar {
        display: none !important;
    }
    
    /* Completely disable hover effects on mobile */
    .menu-section:hover .submenu,
    .menu-section:focus .submenu,
    .menu-section:active .submenu {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
        display: none !important;
    }
    
    .menu-section:hover .menu-tab,
    .menu-section:focus .menu-tab,
    .menu-section:active .menu-tab {
        background: transparent !important;
    }
    
    /* Force mobile behavior */
    .menu-section {
        margin-right: 0;
        margin-bottom: 4px;
        width: 100%;
    }
    
    .menu-section .submenu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        margin-top: 3px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        display: none !important;
        box-shadow: none;
        min-width: auto;
        padding: 8px 12px 8px 24px;
        border: none !important;
    }
    
    /* Improve mobile submenu item touch targets */
    .menu-section .submenu .submenu-item {
        padding: 12px 8px;
        margin: 2px 0;
        border-radius: 4px;
        min-height: 44px; /* iOS recommended touch target size */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .menu-section .submenu .submenu-item:active {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .menu-section.mobile-open .submenu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .menu-bar {
        flex-direction: column;
        height: auto;
        padding: 60px 15px 10px 15px;
        align-items: flex-start;
        transform: translateY(0);
        background: rgba(0, 0, 0, 0.95);
        border-bottom: none;
    }
    
    .menu-bar.visible {
        transform: translateY(0);
    }
    
    .menu-tab {
        width: 100%;
        text-align: left;
        padding: 4px 12px;
        cursor: pointer;
        transition: background-color 0.2s ease;
        border-radius: 4px;
        margin-bottom: 2px;
    }
    
    /* Mobile tap feedback */
    .menu-tab:active {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Visual indicator for open mobile menus */
    .menu-section.mobile-open .menu-tab {
        background-color: rgba(255, 255, 255, 0.08);
    }
    
    .menu-section.mobile-open .menu-tab::after {
        content: '▼';
        float: right;
        font-size: 10px;
        opacity: 0.7;
    }
    
    .toggle-menu {
        top: 15px;
        left: 15px;
        padding: 12px;
        font-size: 14px;
    }
}

/* File Manager Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #000;
    border: 1px solid #fff;
    border-radius: 0;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Demo modal specific styling - flexible to fit content */
#demoModal .modal-content {
    width: auto;
    min-width: 500px;
    max-width: 90vw;
    height: auto;
    min-height: 400px;
    max-height: 90vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-family: 'IBM Plex Mono', monospace;
}

.close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    border: 1px solid #fff;
    padding: 5px 10px;
    background: #000;
}

.close:hover {
    background: #fff;
    color: #000;
}

.modal-body {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

.file-manager-container {
    display: flex;
    height: 100%;
    gap: 20px;
}

.folder-panel {
    width: 250px;
    border-right: 1px solid #fff;
    display: flex;
    flex-direction: column;
}

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

.folder-header h3 {
    margin: 0;
    color: #fff;
    font-size: 14px;
}

.btn-primary, .btn-danger {
    padding: 6px 12px;
    border: 1px solid #fff;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
}

.btn-primary:disabled {
    background: #000;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
}

.btn-danger:hover {
    background: #fff;
    color: #000;
}

.btn-danger:disabled {
    background: #000;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
}

.folder-list {
    flex: 1;
    overflow-y: auto;
}

.folder-item {
    padding: 10px;
    cursor: pointer;
    border-radius: 0;
    margin-bottom: 2px;
    color: #fff;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.folder-item:hover {
    background: #000;
    border: 1px solid #fff;
}

.folder-item.active {
    background: #000;
    color: #fff;
    border: 1px solid #fff;
}

.folder-item .folder-name {
    flex: 1;
}

.folder-item .folder-count {
    color: #666;
    font-size: 10px;
}

.demo-pill {
    background: #000;
    border: 1px solid #fff;
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
    margin-left: 10px;
}

.demo-pill:hover {
    background: #333;
}

.demo-pill.active {
    background: #fff;
    color: #000;
}

.image-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.image-header h3 {
    margin: 0;
    color: #fff;
    font-size: 14px;
}

.image-actions {
    display: flex;
    gap: 10px;
}

.image-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 10px 0;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-item:hover {
    border-color: #fff;
}

.image-item.selected {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-item .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: none;
}

.image-item:hover .delete-btn {
    display: block;
}

.image-item .delete-btn:hover {
    background: #dc3545;
}

.empty-folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 14px;
}

.empty-folder i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Demo Modal Styles */
.demo-settings {
    max-width: none;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
    font-family: 'IBM Plex Mono', monospace;
}

.setting-item input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    background: #000;
    border: 1px solid #fff;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
}

.setting-item .value-display {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    font-family: 'IBM Plex Mono', monospace;
}

.demo-info {
    background: #000;
    border: 1px solid #fff;
    padding: 15px;
    border-radius: 0;
    margin: 20px 0;
}

.demo-info p {
    margin: 5px 0;
    color: #fff;
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
}

.demo-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.demo-actions button {
    padding: 10px 20px;
    font-size: 14px;
    border: 1px solid #fff;
    border-radius: 0;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    background: #000;
    color: #fff;
}

.demo-actions button:hover {
    background: #fff;
    color: #000;
}

.demo-actions button:disabled {
    background: #000;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
}

/* Composition Modal Styling */
#compositionModal .setting-item select {
    background: #000;
    border: 1px solid #fff;
    color: #fff;
    padding: 8px 30px 8px 12px;
    border-radius: 0;
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
    cursor: pointer;
    width: auto;
    min-width: 140px;
    margin-bottom: 15px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    background-clip: padding-box;
}

/* Ensure no default dropdown arrows show */
#compositionModal .setting-item select::-ms-expand {
    display: none;
}

#compositionModal .setting-item select::-webkit-outer-spin-button,
#compositionModal .setting-item select::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#compositionModal .setting-item select:hover {
    background: #fff;
    color: #000;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

#compositionModal .setting-item select:focus {
    background: #fff;
    color: #000;
    outline: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

#compositionModal .setting-item select option {
    background: #000;
    color: #fff;
    padding: 4px;
    font-family: 'IBM Plex Mono', monospace;
}

#compositionModal .setting-item input[type="number"] {
    background: #000;
    border: 1px solid #fff;
    color: #fff;
    padding: 6px 8px;
    border-radius: 0;
    font-size: 11px;
    font-family: 'IBM Plex Mono', monospace;
    width: 50px;
    text-align: center;
}

#compositionModal .setting-item input[type="number"]:hover {
    background: #fff;
    color: #000;
}

#compositionModal .setting-item input[type="number"]:focus {
    background: #fff;
    color: #000;
    outline: none;
}

#compositionModal .setting-item input[type="range"] {
    background: #000;
    border: 1px solid #fff;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 0;
    width: 100%;
    margin-bottom: 5px;
}

#compositionModal .setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
    border-radius: 0;
}

#compositionModal .setting-item input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border: 1px solid #000;
    cursor: pointer;
    border-radius: 0;
}

/* Composition Parameters Layout */
#compositionModal .submenu-subgroup {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 10px 20px;
}

#compositionModal .submenu-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    min-height: 26px;
}

#compositionModal .submenu-item .toggle-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    flex: 1;
}

#compositionModal .submenu-item .toggle-text span {
    min-width: 120px;
    text-align: left;
    flex-shrink: 0;
}

/* Use global .toggle-switch-line sizing for consistency */

#compositionModal .submenu-item input[type="number"] {
    flex-shrink: 0;
    margin-left: 0;
}

#compositionModal .submenu-item .toggle-switch-line input[type="checkbox"] {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

#compositionModal .submenu-item .toggle-slider-line {
    width: 100%;
    height: 100%;
}

.setting-description {
    color: #ccc;
    font-size: 10px;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

/* Line-style toggle switch */
/* Demo modal: pillbox switches */
.toggle-switch-line {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-left: 10px;
}

.toggle-switch-line input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.toggle-slider-line {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    transition: background 0.2s ease, border-color 0.2s ease;
    border-radius: 999px;
    pointer-events: none;
}

.toggle-slider-line:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.95);
    transition: transform 0.2s ease, background 0.2s ease;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.toggle-switch-line input:checked + .toggle-slider-line {
    background: rgba(255, 255, 255, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
}

.toggle-switch-line input:checked + .toggle-slider-line:before {
    transform: translate(20px, -50%) !important;
    background: #fff !important;
}

.toggle-switch-line:hover .toggle-slider-line {
    background: rgba(255,255,255,0.16);
}

.toggle-switch-line input:checked:hover + .toggle-slider-line {
    background: rgba(255, 255, 255, 0.45) !important;
}

/* Ensure toggle states are clearly visible */
.toggle-switch-line input:not(:checked) + .toggle-slider-line {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
}

.toggle-switch-line input:not(:checked) + .toggle-slider-line:before {
    background: rgba(255,255,255,0.95) !important;
    transform: translate(0, -50%) !important;
}

/* Fullscreen mode */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #000 !important;
    overflow: hidden !important;
}

.fullscreen-mode #kaleido {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 10000 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fullscreen-mode .menu-bar {
    display: none !important;
    border: none !important;
    border-bottom: none !important;
}


/* Additional fullscreen hiding for any remaining elements */
.fullscreen-mode * {
    border-bottom: none !important;
}

.fullscreen-mode .menu-bar,
.fullscreen-mode .menu-section,
.fullscreen-mode .submenu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure menu bar is visible when NOT in fullscreen mode */
body:not(.fullscreen-mode) .menu-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.ui-hidden {
    display: none !important;
}