/* ===== W95FA FONT ===== */
@font-face {
    font-family: 'W95FA';
    src: url('./W95FA.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
}

body {
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    overflow: hidden;
}

body, button, input, select, textarea, label, span, div, p, h1, h2, h3 {
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
}

.window, .title-bar, .menu-bar, .taskbar {
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
}

/* Ensure all buttons use W95FA font */
button, .btn, [type="button"], [type="submit"], [type="reset"] {
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif !important;
}

.start-menu, .start-menu-item, .submenu {
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
}

/* ===== DESKTOP ===== */
.desktop {
    width: 100vw;
    height: 100vh;
    background-image: url('./Cloud BG.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

/* ===== DESKTOP ICON ===== */
.desktop-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 70px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    padding: 4px;
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.3);
    outline: 1px dotted white;
}

.icon-image {
    font-size: 32px;
    margin-bottom: 4px;
}

.icon-label {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    word-wrap: break-word;
}

/* ===== WINDOW ===== */
.window {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    width: 95%;
    max-width: 1200px;
    height: 60vh;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.window.minimized {
    display: none;
}

.window.maximized {
    width: 100vw !important;
    height: calc(100vh - 40px) !important;
    max-width: none !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border-radius: 0 !important;
}

/* ===== WELCOME WINDOW ===== */
#welcomeWindow {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #c0c0c0;
    border: 2px solid;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 #0a0a0a,
        2px 2px 8px rgba(0, 0, 0, 0.4);
    overflow: visible;
    z-index: 9999;
    width: 420px;
    max-width: 90vw;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}

#welcomeWindow .window-body {
    background-color: #c0c0c0;
    padding: 12px 15px 15px 15px;
    overflow: visible;
    height: auto;
}

#welcomeWindow .window-body * {
    background-color: transparent;
}

#welcomeWindow .window-body h2 {
    font-size: 14px;
    margin: 0 0 4px 0 !important;
}

#welcomeWindow .window-body h3 {
    font-size: 11px;
    margin: 0 0 5px 0 !important;
}

#welcomeWindow .window-body p {
    font-size: 10px;
    margin: 0 0 3px 0 !important;
}

#welcomeWindow .window-body ol,
#welcomeWindow .window-body ul {
    font-size: 10px;
    line-height: 1.3;
    margin: 0;
    padding-left: 16px;
}

#welcomeWindow .window-body li {
    margin-bottom: 2px;
}

#welcomeWindow .window-body > div,
#welcomeWindow .welcome-page > div {
    margin-bottom: 8px !important;
}

#welcomeWindow .title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#welcomeWindow .title-bar-text {
    color: white;
    font-weight: bold;
    font-size: 11px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

#welcomeWindow .win95-button {
    padding: 5px 15px;
    font-size: 11px;
}

#welcomeWindow #welcomeGetStartedBtn {
    margin-top: 3px;
    padding: 6px 20px;
}

/* Compact effects grid in welcome */
#welcomeWindow .welcome-page div[style*="grid"] {
    gap: 2px 15px !important;
    font-size: 10px !important;
}

/* Hide windows initially until JS positions them */
#controlsWindow,
#previewMainWindow {
    visibility: hidden;
    opacity: 0;
}

/* Show windows after positioning */
#controlsWindow.positioned,
#previewMainWindow.positioned {
    visibility: visible;
    opacity: 1;
}

/* Controls Window - positioned by JS */
#controlsWindow {
    position: absolute !important;
    transform: none;
    z-index: 1;
}

/* Preview Main Window - positioned by JS */
#previewMainWindow {
    position: absolute !important;
    transform: none;
    z-index: 2;
}

#previewMainWindow .window-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#previewMainWindow .window-body > .section:first-child {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

#previewMainWindow .window-body > .section:last-child {
    flex-shrink: 0;
}

/* Timeline Window - Bottom */
#timelineWindow {
    width: 1280px !important;
    height: auto;
    max-width: none;
    top: auto;
    bottom: 50px;
    left: 20px;
    transform: none;
}

.preview-window {
    width: 600px !important;
    height: auto !important;
    max-width: 90vw;
    max-height: 90vh;
    top: 10%;
    left: 60%;
    z-index: 999;
}

.preview-window canvas {
    /* Canvas now displays at actual size based on scale */
    display: block;
    image-rendering: pixelated; /* Sharp pixels for retro effects */
}

/* ===== TITLE BAR ===== */
.title-bar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: white;
    padding: 3px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: move;
    user-select: none;
}

.title-bar-text {
    font-size: 11px;
    letter-spacing: 0.5px;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
    position: relative;
    z-index: 1002; /* Above resize handles */
}

.title-bar-button {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1002; /* Above resize handles */
}

.title-bar-button:active {
    border-color: #000000 #ffffff #ffffff #000000;
}

/* ===== MENU BAR ===== */
.menu-bar {
    background: #c0c0c0;
    display: flex;
    border-bottom: 1px solid #ffffff;
    padding: 2px 4px;
}

.menu-item {
    padding: 4px 8px;
    cursor: pointer;
    position: relative;
}

.menu-item:hover,
.menu-item.active {
    background: #000080;
    color: #ffffff;
}

/* ===== DROPDOWN MENUS ===== */
.dropdown-menu {
    position: absolute;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    min-width: 150px;
    z-index: 1000;
    display: none;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
    display: block;
}

.menu-option {
    padding: 4px 20px;
    cursor: pointer;
}

.menu-option:hover {
    background: #000080;
    color: #ffffff;
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #ffffff;
    margin: 2px 0;
}

/* ===== WINDOW BODY ===== */
.window-body {
    flex: 1;
    background: #c0c0c0;
    padding: 8px;
    overflow-y: auto;
}

.window-body::-webkit-scrollbar {
    width: 16px;
}

.window-body::-webkit-scrollbar-track {
    background: #c0c0c0;
}

.window-body::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow-y: auto;
}

/* ===== CONTROLS LAYOUT ===== */
.controls-layout {
    display: flex;
    gap: 10px;
    height: 100%;
    flex: 1;
    min-height: 0;
    align-items: flex-start;
}

.effects-column {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
    height: auto;
}

.effects-header {
    font-size: 9px;
    color: #666;
    padding: 3px 5px;
    border-bottom: 1px solid #808080;
    background: #f0f0f0;
    margin-bottom: 2px;
}

.effects-list-container {
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
    overflow-y: visible !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    background: #fff;
    border: 2px inset #808080;
    padding: 3px 5px;
    /* Prevent container from being dragged or duplicated */
    user-select: none;
    -webkit-user-select: none;
    resize: none;
}

.right-column {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    min-width: 220px;
    height: auto !important;
    max-height: none !important;
}

.preprocessing-section {
    flex-shrink: 0;
    margin-bottom: 10px;
    min-width: 200px;
    overflow: visible !important;
    height: auto !important;
}

/* Compact preprocessing controls to fit default width */
.preprocessing-section .control-row {
    gap: 5px !important;
    margin-bottom: 5px !important;
}

.preprocessing-section .control-row label {
    min-width: 75px !important;
    font-size: 11px !important;
}

.preprocessing-section .control-row input[type="range"] {
    min-width: 60px !important;
    flex: 1 !important;
}

.preprocessing-section .control-row .value-display {
    min-width: 45px !important;
    width: 45px !important;
    font-size: 10px !important;
    padding: 1px 2px !important;
}

/* Ensure number inputs are visible */
.preprocessing-section input[type="number"],
.effect-settings input[type="number"] {
    width: 50px;
    min-width: 50px;
}

.effect-settings-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100px;
    max-height: calc(100vh - 400px);
}

.effect-settings-section::-webkit-scrollbar {
    width: 16px;
}

.effect-settings-section::-webkit-scrollbar-track {
    background: #c0c0c0;
}

.effect-settings-section::-webkit-scrollbar-thumb {
    background: #808080;
    border: 1px solid #404040;
}

/* Legacy support */
.top-row {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.preprocessing-panel {
    flex: 1;
    min-width: 0;
}

/* Full width sections below the top row */
.full-width-section {
    width: 100%;
}

/* ===== SIDEBAR PANEL (Legacy) ===== */
.sidebar-panel {
    width: 200px;
    flex-shrink: 0;
}

.panel-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.sunken-panel {
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #ffffff;
    padding: 8px;
}

.effects-list {
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
    overflow-y: visible !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
}

.effect-item {
    padding: 1px 5px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: grab;
    transition: background 0.2s;
    background: #fff;
    position: relative;
    line-height: 1.1;
}

.effect-item:hover {
    background: rgba(0, 0, 128, 0.1);
}

.effect-item:active {
    cursor: grabbing;
}

.effect-item.dragging {
    opacity: 0.4;
    background: #d0d0d0;
}

.effect-item.drag-over {
    border-top: 2px solid #000080;
}

/* Prevent effects-list from creating drag artifacts */
.sunken-panel.effects-list {
    position: relative;
}

.effects-list::before,
.effects-list::after,
.effects-list-container::before,
.effects-list-container::after {
    display: none !important;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    color: #808080;
    font-size: 8px;
    line-height: 1;
    margin-right: 2px;
    padding: 0 1px;
}

.drag-handle:active {
    cursor: grabbing;
}

.effect-item input[type="checkbox"] {
    margin: 0;
    margin-right: 3px;
    width: 12px;
    height: 12px;
    appearance: none;
    border: 1px solid #808080;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.effect-item input[type="checkbox"]:checked::after {
    content: 'X';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 1.3px));
    font-size: 10px;
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
    font-weight: bold;
    color: #000000;
    line-height: 1;
}

.effect-name {
    cursor: pointer;
    user-select: none;
    flex: 1;
    font-size: 11px;
}

.effect-name:hover {
    text-decoration: underline;
}

.effect-name.selected {
    background: #000080;
    color: #ffffff;
    padding: 2px 4px;
    margin: -2px -4px;
}

.note {
    font-size: 9px;
    color: #666;
    margin-top: 8px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-width: 0;
}

.section {
    margin-bottom: 4px;
}

/* ===== BUTTONS ===== */
.win95-button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 4px 12px;
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    cursor: pointer;
    min-width: 75px;
}

.win95-button:active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 5px 11px 3px 13px;
}

.win95-button:disabled {
    color: #808080;
    cursor: not-allowed;
}

/* ===== UPLOAD HINT ===== */
.upload-hint {
    font-size: 9px;
    color: #666;
    margin-top: 4px;
    text-align: center;
}

/* ===== CANVAS CONTAINER ===== */
.canvas-container {
    min-height: 300px;
    max-height: 60vh;
    position: relative;
    overflow: auto; /* Scroll when canvas is too large */
    display: flex;
    /* Use safe center to allow scrolling when content overflows */
    align-items: safe center;
    justify-content: safe center;
}

.canvas-container.drag-over {
    border: 3px dashed #0078d4 !important;
    background: rgba(0, 120, 212, 0.1);
}

.canvas-container.drag-over::after {
    content: 'Drop to load';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #0078d4;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
}

#canvas {
    /* Canvas displays at actual size based on scale */
    display: none;
    image-rendering: pixelated; /* Sharp pixels for retro effects */
    flex-shrink: 0; /* Don't shrink canvas */
}

#canvas.active {
    display: block;
}

#videoPlayer {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.placeholder {
    text-align: center;
    color: #808080;
    line-height: 1.6;
}

/* ===== CONTROLS ===== */
.controls-panel {
    background: #c0c0c0;
    padding: 8px;
}

/* Settings Header */
.settings-header {
    background: #000080;
    color: white;
    padding: 6px 10px;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 1px;
    border-bottom: 2px solid #808080;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.settings-header:hover {
    background: #0000a0;
}

.settings-header .drag-handle {
    cursor: grab;
    opacity: 0.6;
    padding: 0 4px;
    font-size: 12px;
}

.settings-header .drag-handle:hover {
    opacity: 1;
}

.settings-header .drag-handle:active {
    cursor: grabbing;
}

.settings-header .settings-header-text {
    flex: 1;
}

.settings-header .settings-header-arrow {
    margin-left: auto;
}

.settings-header-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-header-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.effect-settings.collapsed .settings-header-arrow {
    transform: rotate(-90deg);
}

.effect-settings.collapsed .controls-panel {
    display: none;
}

.effect-settings.dragging {
    opacity: 0.5;
}

.effect-settings.drag-over {
    border-top: 3px solid #0078d7;
}

/* Effect Settings Container */
#effectSettingsSection {
    width: 100%;
}

#effectSettingsSection .controls-panel {
    width: 100%;
}

/* Individual Effect Settings Panel */
.effect-settings {
    border-bottom: 2px solid #808080;
    margin-bottom: 0;
}

.effect-settings:last-child {
    border-bottom: none;
}

.effect-settings .controls-panel {
    padding: 6px 8px;
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
    width: 100%;
}

.control-row label {
    font-size: 11px;
    min-width: 110px;
    flex-shrink: 0;
}

.control-row input[type="range"] {
    flex: 1;
    min-width: 100px;
}

.control-row .value-display {
    min-width: 35px;
    text-align: right;
    flex-shrink: 0;
}

.control-row select {
    flex: 1;
    min-width: 100px;
}

/* Two-column blend controls row - spread out */
.blend-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    width: 100%;
    flex-wrap: nowrap;
}

.blend-controls-row .blend-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.blend-controls-row .blend-control:first-child {
    flex: 1;
    min-width: 0;
}

.blend-controls-row .blend-control:last-child {
    flex-shrink: 0;
    max-width: 160px;
}

.blend-controls-row label {
    font-size: 11px;
    flex-shrink: 0;
    min-width: 45px;
}

.blend-controls-row input[type="range"] {
    flex: 1;
    min-width: 60px;
    max-width: 120px;
}

.blend-controls-row .value-display {
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
}

.blend-controls-row select {
    flex-shrink: 0;
    width: 100px;
    max-width: 100px;
}

.control-row input[type="range"] {
    flex: 1;
    height: 18px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 16px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    cursor: pointer;
}

.control-row input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 16px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    cursor: pointer;
}

.value-display {
    min-width: 60px;
    width: 60px;
    text-align: center;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    padding: 2px 4px;
    border: 1px solid #7f7f7f;
    background: #fff;
    box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #dfdfdf;
}

.win95-select {
    flex: 1;
    background: #ffffff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 2px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    cursor: pointer;
}


.win95-input {
    background: #ffffff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 3px 4px;
    font-family: Arial, sans-serif;
    font-size: 11px;
}

input[type="color"] {
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #ffffff;
    cursor: pointer;
    height: 24px;
    width: 50px;
}

/* ===== STATUS BAR ===== */
.status-bar {
    background: #c0c0c0;
    border-top: 1px solid #ffffff;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.status-text {
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 2px 4px;
    flex: 1;
}

.status-clock {
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 2px 8px;
    margin-left: 4px;
}

/* ===== DIALOGS ===== */
.dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    min-width: 300px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.dialog .window-body {
    padding: 16px;
    overflow: visible;
}

.dialog-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.dialog-icon {
    font-size: 32px;
}

.dialog-message {
    flex: 1;
    line-height: 1.4;
}

.dialog-buttons {
    text-align: center;
}

.dialog p {
    margin: 4px 0;
}

/* ===== CURSOR STATES ===== */
.processing {
    cursor: wait !important;
}

.processing * {
    cursor: wait !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .desktop {
        padding: 0;
        overflow: hidden;
    }

    .window {
        width: 100% !important;
        height: 100vh !important;
        max-width: none !important;
        left: 0 !important;
        top: 0 !important;
        position: fixed !important;
    }

    .content-container {
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .controls-layout {
        flex-direction: column;
        height: auto;
    }

    .effects-column {
        width: 100%;
    }

    .effects-list-container {
        height: 300px !important;
        max-height: 300px !important;
        min-height: 300px !important;
        overflow-y: auto;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
    }

    .right-column {
        width: 100%;
    }

    .effect-settings-section {
        max-height: none;
        overflow-y: visible;
    }

    .top-row {
        flex-direction: column;
    }

    .sidebar-panel {
        width: 100%;
        max-height: none;
    }

    .preprocessing-panel {
        width: 100%;
    }

    .effects-list {
        height: 300px !important;
        max-height: 300px !important;
        min-height: 300px !important;
        overflow-y: auto;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
    }

    .blend-controls-row {
        flex-direction: column;
        gap: 8px;
    }

    .blend-controls-row .blend-control {
        width: 100%;
    }

    .preview-section {
        width: 100%;
        padding: 8px;
    }

    .canvas-container {
        width: 100%;
        min-height: 300px;
    }

    /* Make touch targets larger */
    .win95-button {
        min-height: 44px;
        padding: 8px 16px;
    }

    .effect-item {
        padding: 12px 8px;
        min-height: 44px;
    }

    input[type="checkbox"] {
        min-width: 24px;
        min-height: 24px;
    }

    input[type="range"] {
        min-height: 44px;
    }

    /* Hide desktop icon on mobile */
    .desktop-icon {
        display: none;
    }

    /* Adjust taskbar for mobile */
    .taskbar {
        padding: 4px;
    }

    .taskbar-button {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* Adjust menu bar */
    .menu-bar {
        padding: 4px;
    }

    .menu-item {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* Control rows stack on mobile */
    .control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .control-row label {
        width: 100%;
    }

    .control-row input[type="range"] {
        width: 100%;
    }
}

/* ===== EFFECT SCHEDULE ===== */
.schedule-item {
    padding: 8px;
    margin-bottom: 8px;
    background: #dfdfdf;
    border: 1px solid #808080;
}

.schedule-item-header {
    font-weight: bold;
    margin-bottom: 6px;
    color: #000080;
}

.schedule-time-inputs {
    display: flex;
    gap: 12px;
    align-items: center;
}

.schedule-time-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.schedule-time-group label {
    font-size: 10px;
    min-width: auto;
}

.schedule-time-group input {
    width: 60px;
    padding: 2px 4px;
}

/* ===== HIDE SCROLLBARS FOR EFFECT CONTROLS ===== */
.main-content::-webkit-scrollbar {
    width: 16px;
}

.main-content::-webkit-scrollbar-track {
    background: #c0c0c0;
}

.main-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

/* ===== TASKBAR ===== */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 2px;
    gap: 2px;
    z-index: 10000;
}

.start-button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 4px 8px;
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.start-button:active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.start-logo {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

.taskbar-windows {
    flex: 1;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
}

.taskbar-window-button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 4px 8px;
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-window-button:active,
.taskbar-window-button.active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #808080;
    color: #ffffff;
}

.taskbar-clock {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 4px 8px;
    font-family: 'W95FA', 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    min-width: 70px;
    text-align: center;
}

/* ===== START MENU ===== */
.start-menu {
    position: fixed;
    bottom: 42px;
    left: 2px;
    width: 180px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.start-menu-items {
    padding: 4px 0;
}

.start-menu-item {
    padding: 6px 30px 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    position: relative;
}

.start-menu-item:hover {
    background: #000080;
    color: #ffffff;
}

.menu-icon {
    font-size: 14px;
}

.start-menu-separator {
    height: 1px;
    background: #808080;
    margin: 4px 8px;
}

.submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    min-width: 150px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.start-menu-item:hover > .submenu {
    display: block;
}

/* ===== SHUTDOWN SCREEN ===== */
.shutdown-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000080;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shutdown-message {
    text-align: center;
    color: white;
}

.shutdown-message h2 {
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 20px;
}

.shutdown-logo {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== TIMELINE ===== */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background: #dfdfdf;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
}

.timeline-timecode,
.timeline-duration {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    background: #000;
    color: #0f0;
    padding: 2px 6px;
    border: 1px solid #808080;
}

.timeline-container {
    position: relative;
    background: #404040;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 300px;
}

.timeline-ruler {
    background: #2a2a2a;
    border-bottom: 1px solid #606060;
    position: sticky;
    top: 0;
    z-index: 10;
}

.timeline-ruler canvas {
    display: block;
}

.timeline-tracks {
    position: relative;
    min-height: 100px;
}

.timeline-track {
    height: 50px;
    border-bottom: 1px solid #606060;
    position: relative;
    background: #353535;
}

.timeline-track:hover {
    background: #3a3a3a;
}

.timeline-track-label {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.timeline-playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #ff0000;
    z-index: 100;
    pointer-events: none;
}

.timeline-playhead::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 8px solid #ff0000;
}

.timeline-keyframe {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffd700;
    border: 2px solid #ff8800;
    transform: rotate(45deg) translateY(-50%);
    top: 50%;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.1s, background 0.1s;
}

.timeline-keyframe:hover {
    transform: rotate(45deg) translateY(-50%) scale(1.2);
    background: #ffed4e;
}

.timeline-keyframe.selected {
    background: #00ff00;
    border-color: #00aa00;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    min-width: 150px;
}

.context-menu-item {
    padding: 4px 20px;
    cursor: pointer;
    font-size: 11px;
}

.context-menu-item:hover {
    background: #000080;
    color: #ffffff;
}

.context-menu-separator {
    height: 1px;
    background: #808080;
    margin: 2px 0;
}

/* ===== KBD STYLE ===== */
kbd {
    background: #ffffff;
    border: 2px solid;
    border-color: #dfdfdf #000000 #000000 #dfdfdf;
    padding: 2px 6px;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 1px 1px 0 #808080;
}

/* ===== WINDOW RESIZE HANDLES ===== */
#previewMainWindow .resize-handle-top,
#controlsWindow .resize-handle-top {
    position: absolute;
    top: 0;
    left: 10px;
    right: 50px; /* Leave space for title bar buttons */
    height: 8px;
    cursor: ns-resize;
    z-index: 999; /* Below title bar buttons */
}

#previewMainWindow .resize-handle-bottom,
#controlsWindow .resize-handle-bottom {
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 8px;
    cursor: ns-resize;
    z-index: 1000;
}

/* Right edge resize */
.resize-handle-right {
    position: absolute !important;
    top: 25px !important; /* Start below title bar */
    right: 0 !important;
    width: 8px !important;
    height: calc(100% - 35px) !important;
    cursor: ew-resize !important;
    z-index: 999 !important; /* Below title bar buttons */
}

/* Left edge resize */
.resize-handle-left {
    position: absolute !important;
    top: 25px !important; /* Start below title bar */
    left: 0 !important;
    width: 8px !important;
    height: calc(100% - 35px) !important;
    cursor: ew-resize !important;
    z-index: 999 !important;
}

/* Corner resize handles */
.resize-handle-corner {
    position: absolute !important;
    width: 20px !important;
    height: 20px !important;
    z-index: 999 !important; /* Below title bar buttons */
}

.resize-handle-corner-br {
    bottom: 0 !important;
    right: 0 !important;
    cursor: nwse-resize !important;
}

.resize-handle-corner-bl {
    bottom: 0 !important;
    left: 0 !important;
    cursor: nesw-resize !important;
}

.resize-handle-corner-tr {
    top: 22px !important; /* Below title bar to not block X button */
    right: 0 !important;
    cursor: nesw-resize !important;
}

.resize-handle-corner-tl {
    top: 22px !important; /* Below title bar */
    left: 0 !important;
    cursor: nwse-resize !important;
}

/* Corner resize visual (diagonal lines) */
.resize-handle-corner-br svg {
    position: absolute;
    bottom: 2px;
    right: 2px;
}

/* ===== PREVIEW TOOLBAR ===== */
.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    padding: 4px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

.preview-toolbar .toolbar-btn {
    padding: 3px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.preview-toolbar .toolbar-btn:disabled {
    color: #808080;
}

.preview-toolbar .toolbar-btn.active {
    background: #000080;
    color: white;
    border-color: #808080 #ffffff #ffffff #808080;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: linear-gradient(to right, #808080 50%, #ffffff 50%);
    margin: 0 4px;
}

.history-indicator {
    font-size: 10px;
    color: #666;
    margin-left: auto;
}

/* ===== BEFORE/AFTER COMPARISON SLIDER ===== */
#compareCanvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

#compareSliderContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
}

#compareSliderLine {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

#compareSliderHandle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    pointer-events: auto;
    font-size: 10px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    user-select: none;
}

#compareSliderHandle:hover {
    background: #f0f0f0;
}

#compareSliderHandle:active {
    background: #e0e0e0;
}

#compareLabels {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.compare-label {
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 2px;
}

.compare-label-before {
    margin-right: auto;
}

.compare-label-after {
    margin-left: auto;
}

/* ===== VIDEO CONTROLS ===== */
.video-controls-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    margin-bottom: 8px;
}

.video-controls-buttons button {
    flex: 1;
    min-width: 40px;
    padding: 6px 4px;
}

/* ===== PRESETS SECTION ===== */
.presets-section {
    margin-bottom: 8px;
    padding: 8px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

.presets-row {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.presets-row select {
    flex: 1;
    font-size: 11px;
}

.presets-buttons {
    display: flex;
    gap: 4px;
}

.preset-btn {
    flex: 1;
    min-width: 50px;
    padding: 3px 8px !important;
    font-size: 11px;
}

#deletePresetBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#presetSelector optgroup {
    font-weight: bold;
    font-style: normal;
}

#presetSelector option {
    font-weight: normal;
    padding-left: 8px;
}

/* ===== CUSTOM TOOLTIPS (1 second delay) ===== */
#customTooltip {
    position: fixed;
    padding: 6px 10px;
    background: #ffffcc;
    border: 1px solid #808080;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-size: 11px;
    font-family: 'W95FA', Arial, sans-serif;
    z-index: 99999;
    pointer-events: none;
    display: none;
    max-width: 250px;
    white-space: normal;
}

/* ===== MOBILE STYLES ===== */

/* Hide mobile elements on desktop */
.mobile-tabs,
.mobile-container,
.mobile-preview-section,
.mobile-action-bar {
    display: none;
}

@media screen and (max-width: 768px) {

    /* ===== SINGLE WINDOW MOBILE LAYOUT ===== */

    /* Mobile Recommendation Banner */
    .mobile-recommendation {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: white;
        padding: 12px;
        flex-shrink: 0;
    }

    .recommendation-content {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .recommendation-icon {
        font-size: 24px;
        flex-shrink: 0;
    }

    .recommendation-text {
        flex: 1;
        font-size: 12px;
        line-height: 1.4;
    }

    .recommendation-text strong {
        display: block;
        font-size: 13px;
        margin-bottom: 4px;
    }

    .recommendation-text p {
        margin: 0;
        opacity: 0.8;
        font-size: 11px;
    }

    .recommendation-dismiss {
        background: transparent;
        border: none;
        color: white;
        font-size: 18px;
        cursor: pointer;
        padding: 0;
        opacity: 0.7;
        line-height: 1;
    }

    .recommendation-dismiss:hover {
        opacity: 1;
    }

    .mobile-recommendation.dismissed {
        display: none;
    }

    /* Hide all desktop elements */
    .desktop-icon,
    .taskbar,
    .start-menu,
    .window,
    #controlsWindow,
    #previewMainWindow,
    #welcomeWindow,
    #shortcutsWindow,
    #timelineWindow,
    #previewWindow {
        display: none !important;
    }

    /* Show mobile container */
    .mobile-container {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #c0c0c0;
        z-index: 10000;
    }

    /* ===== FIXED PREVIEW AT TOP ===== */
    .mobile-preview-section {
        display: block !important;
        flex-shrink: 0;
        background: #c0c0c0;
        border-bottom: 2px solid #808080;
        padding: 8px;
    }

    .mobile-preview-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
        padding: 0 4px;
    }

    .mobile-preview-title {
        font-family: 'W95FA', Arial, sans-serif;
        font-size: 14px;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-preview-title img {
        width: 20px;
        height: 20px;
    }

    .mobile-preview-area {
        background: #fff;
        border: 2px solid;
        border-color: #808080 #dfdfdf #dfdfdf #808080;
        height: 40vh;
        min-height: 180px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        position: relative;
        margin: 8px;
        box-sizing: border-box;
    }

    .mobile-preview-area canvas {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .mobile-upload-prompt {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 30px 40px;
        cursor: pointer;
        box-sizing: border-box;
    }

    .mobile-upload-prompt img {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }

    .mobile-upload-prompt .upload-title {
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 8px;
    }

    .mobile-upload-prompt .upload-hint {
        font-size: 12px;
        color: #666;
    }

    /* ===== SCROLLABLE EFFECTS PANEL ===== */
    .mobile-effects-panel {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px;
        padding-bottom: 70px; /* Space for action bar */
    }

    .mobile-section {
        background: #c0c0c0;
        border: 2px solid;
        border-color: #dfdfdf #808080 #808080 #dfdfdf;
        margin-bottom: 8px;
    }

    .mobile-section-header {
        background: linear-gradient(90deg, #000080, #1084d0);
        color: white;
        padding: 8px 10px;
        font-family: 'W95FA', Arial, sans-serif;
        font-size: 12px;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-section-header .toggle-icon {
        font-size: 10px;
    }

    .mobile-section-content {
        padding: 10px;
        display: none;
    }

    .mobile-section-content.expanded {
        display: block;
    }

    /* Effects list for mobile */
    .mobile-effects-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-effect-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 8px;
        background: #fff;
        border: 1px solid #808080;
        cursor: pointer;
        transition: background 0.1s;
    }

    .mobile-effect-item.dragging {
        opacity: 0.5;
        background: #e0e0e0;
    }

    .mobile-effect-item.selected {
        background: #d4e5f7;
        border-color: #4a90d9;
        border-left: 4px solid #000080;
    }

    .mobile-drag-handle {
        cursor: grab;
        color: #808080;
        font-size: 14px;
        padding: 4px;
        user-select: none;
        touch-action: none;
    }

    .mobile-drag-handle:active {
        cursor: grabbing;
    }

    .mobile-effect-item input[type="checkbox"] {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .mobile-effect-item .effect-name {
        font-size: 13px;
        flex: 1;
    }

    /* Effect Settings Section */
    .mobile-no-effects {
        padding: 20px;
        text-align: center;
        color: #666;
        font-size: 12px;
    }

    .mobile-effect-settings-group {
        border: 1px solid #808080;
        margin-bottom: 4px;
        background: #fff;
    }

    .mobile-effect-settings-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        background: #c0c0c0;
        cursor: pointer;
        border-bottom: 1px solid #808080;
        font-weight: bold;
        font-size: 12px;
    }

    .mobile-effect-settings-header:active {
        background: #a0a0a0;
    }

    .effect-settings-title {
        flex: 1;
    }

    .effect-settings-arrow {
        font-size: 10px;
        color: #404040;
        transition: transform 0.2s;
    }

    .mobile-effect-settings-group.expanded .effect-settings-arrow {
        transform: rotate(180deg);
    }

    .mobile-effect-settings-content {
        display: none;
        padding: 12px;
        background: #e8e8e8;
    }

    .mobile-effect-settings-group.expanded .mobile-effect-settings-content {
        display: block;
    }

    .mobile-effect-settings-content .control-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 0 !important;
        min-height: 44px !important;
    }

    .mobile-effect-settings-content .control-row label {
        font-size: 13px !important;
        width: 110px !important;
        min-width: 110px !important;
        flex-shrink: 0 !important;
        text-align: left !important;
    }

    .mobile-effect-settings-content .control-row input[type="range"] {
        flex: 1 !important;
        min-width: 80px !important;
        height: 44px !important;
        width: auto !important;
    }

    .mobile-effect-settings-content .control-row .value-display {
        width: 50px !important;
        min-width: 50px !important;
        text-align: right !important;
        font-size: 13px !important;
        flex-shrink: 0 !important;
    }

    .mobile-effect-settings-content .control-row select {
        flex: 1 !important;
        min-width: 100px !important;
        height: 40px !important;
        font-size: 13px !important;
        padding: 4px 8px !important;
        width: auto !important;
    }

    .mobile-effect-settings-content .control-row input[type="checkbox"] {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0 !important;
    }

    .mobile-effect-settings-content .control-row input[type="color"] {
        width: 50px !important;
        height: 36px !important;
        padding: 2px !important;
        border: 2px solid !important;
        border-color: #808080 #dfdfdf #dfdfdf #808080 !important;
        flex-shrink: 0 !important;
    }

    .mobile-effect-settings-content .control-row input[type="text"] {
        flex: 1 !important;
        height: 36px !important;
        font-size: 13px !important;
        padding: 4px 8px !important;
        border: 2px solid !important;
        border-color: #808080 #dfdfdf #dfdfdf #808080 !important;
        width: auto !important;
    }

    .mobile-effect-settings-content .win95-button {
        padding: 8px 16px;
        font-size: 12px;
        min-height: 36px;
    }

    /* Control rows for mobile */
    .mobile-control-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        min-height: 44px;
    }

    .mobile-control-row label {
        font-size: 13px;
        width: 110px;
        min-width: 110px;
        flex-shrink: 0;
    }

    .mobile-control-row input[type="range"] {
        flex: 1;
        min-width: 80px;
        height: 44px;
    }

    .mobile-control-row .value-display {
        width: 50px;
        min-width: 50px;
        text-align: right;
        font-size: 13px;
        flex-shrink: 0;
    }

    .mobile-control-row .mobile-value-input,
    .mobile-effect-settings-content .mobile-value-input {
        width: 55px !important;
        min-width: 55px !important;
        max-width: 55px !important;
        height: 32px !important;
        text-align: right !important;
        font-size: 12px !important;
        padding: 4px 6px !important;
        border: 2px solid !important;
        border-color: #808080 #dfdfdf #dfdfdf #808080 !important;
        background: #fff !important;
        font-family: 'W95FA', Arial, sans-serif !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    /* Hide ALL value-display elements (both span and converted inputs) in mobile effect settings */
    #mobileEffectSettingsContent .value-display,
    #mobileEffectSettingsContent input.value-display,
    .mobile-effect-settings-content .value-display,
    .mobile-effect-settings-content input.value-display {
        display: none !important;
    }

    .mobile-control-row input[type="checkbox"] {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }

    /* ===== FIXED ACTION BAR AT BOTTOM ===== */
    .mobile-action-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #c0c0c0;
        border-top: 2px solid #dfdfdf;
        padding: 8px;
        gap: 8px;
        z-index: 10001;
    }

    .mobile-action-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: #c0c0c0;
        border: 2px solid;
        border-color: #dfdfdf #808080 #808080 #dfdfdf;
        font-family: 'W95FA', Arial, sans-serif;
        font-size: 12px;
        cursor: pointer;
        padding: 8px;
    }

    .mobile-action-btn:active {
        border-color: #808080 #dfdfdf #dfdfdf #808080;
    }

    .mobile-action-btn.primary {
        background: #000080;
        color: white;
    }

    .mobile-action-btn .btn-icon {
        font-size: 16px;
    }

    /* Hide old mobile tabs */
    .mobile-tabs {
        display: none !important;
    }

    /* Larger touch targets - Mobile slider styling - override all desktop styles */
    input[type="range"],
    .control-row input[type="range"],
    .mobile-control-row input[type="range"],
    .mobile-effect-settings-content input[type="range"],
    .mobile-effect-settings-content .control-row input[type="range"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        width: 100% !important;
        height: 44px !important;
        background: transparent !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        border: none !important;
    }

    input[type="range"]::-webkit-slider-runnable-track,
    .control-row input[type="range"]::-webkit-slider-runnable-track,
    .mobile-effect-settings-content input[type="range"]::-webkit-slider-runnable-track {
        width: 100% !important;
        height: 16px !important;
        background: #fff !important;
        border: 2px solid !important;
        border-color: #808080 #dfdfdf #dfdfdf #808080 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    input[type="range"]::-webkit-slider-thumb,
    .control-row input[type="range"]::-webkit-slider-thumb,
    .mobile-effect-settings-content input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none !important;
        appearance: none !important;
        width: 32px !important;
        height: 32px !important;
        background: #c0c0c0 !important;
        border: 3px solid !important;
        border-color: #dfdfdf #808080 #808080 #dfdfdf !important;
        border-radius: 0 !important;
        margin-top: -10px !important;
        cursor: pointer !important;
    }

    /* Firefox slider styling */
    input[type="range"]::-moz-range-track,
    .control-row input[type="range"]::-moz-range-track,
    .mobile-effect-settings-content input[type="range"]::-moz-range-track {
        width: 100% !important;
        height: 16px !important;
        background: #fff !important;
        border: 2px solid !important;
        border-color: #808080 #dfdfdf #dfdfdf #808080 !important;
        border-radius: 0 !important;
    }

    input[type="range"]::-moz-range-thumb,
    .control-row input[type="range"]::-moz-range-thumb,
    .mobile-effect-settings-content input[type="range"]::-moz-range-thumb {
        width: 32px !important;
        height: 32px !important;
        background: #c0c0c0 !important;
        border: 3px solid !important;
        border-color: #dfdfdf #808080 #808080 #dfdfdf !important;
        border-radius: 0 !important;
        cursor: pointer !important;
    }

    input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    select {
        height: 36px;
        font-size: 13px;
    }

    .win95-button {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Extra small phones */
@media screen and (max-width: 380px) {
    .mobile-preview-area {
        height: 35vh;
        min-height: 150px;
    }

    .mobile-section-header {
        font-size: 11px;
        padding: 6px 8px;
    }

    .mobile-effect-item {
        padding: 10px 6px;
    }

    .mobile-effect-item .effect-name {
        font-size: 12px;
    }

    .mobile-action-btn {
        font-size: 11px;
    }

    .mobile-control-row label {
        font-size: 11px;
        min-width: 80px;
    }
}

/* ===== WINDOWS 95 CURSORS ===== */

/* Default cursor - normal arrow */
* {
    cursor: url('cursor/arrow.cur'), auto;
}

/* Hover/pointer cursor for clickable elements */
a,
button,
input[type="button"],
input[type="submit"],
input[type="checkbox"],
input[type="radio"],
select,
.desktop-icon,
.start-menu-item,
.menu-item,
.clickable,
.effect-item,
.mobile-tab,
[onclick],
[role="button"] {
    cursor: url('cursor/Cursor_15.cur'), pointer !important;
}

a:hover,
button:hover,
.desktop-icon:hover,
.start-menu-item:hover,
.effect-item:hover,
.mobile-tab:hover {
    cursor: url('cursor/Cursor_15.cur'), pointer !important;
}

/* Loading/wait cursor - hourglass */
.loading,
.exporting,
body.loading *,
body.exporting * {
    cursor: url('cursor/Cursor_3.cur'), wait !important;
}

/* Rendering/processing - disc cursor */
.rendering,
body.rendering *,
#exportProgress,
#exportProgress * {
    cursor: url('cursor/Cursor_17.cur'), progress !important;
}

/* Help cursor - for welcome/help elements */
.help-icon,
[title*="Help"],
[title*="help"] {
    cursor: url('cursor/help_win95.cur'), help !important;
}

/* Grab cursor for dragging tabs/windows title bar */
.title-bar,
.window-header,
.window-title {
    cursor: url('cursor/Cursor_10.cur'), grab !important;
}

.title-bar:active,
.window-header:active,
.window-title:active {
    cursor: url('cursor/Cursor_10.cur'), grabbing !important;
}

/* Resize cursor - bottom right corner (nwse) */
.resize-handle,
.resize-handle-corner-br,
.resize-handle-corner-tl {
    cursor: url('cursor/Cursor_6.cur'), nwse-resize !important;
}

/* Resize cursor - bottom left corner (nesw) */
.resize-handle-corner-bl,
.resize-handle-corner-tr {
    cursor: url('cursor/Cursor_7.cur'), nesw-resize !important;
}

/* Resize cursor - horizontal (left/right edges) */
.resize-handle-left,
.resize-handle-right {
    cursor: url('cursor/Cursor_8.cur'), ew-resize !important;
}

/* Resize cursor - vertical (top/bottom edges) */
.resize-handle-top,
.resize-handle-bottom {
    cursor: url('cursor/Cursor_9.cur'), ns-resize !important;
}

/* Drag handle for effect items */
.drag-handle {
    cursor: url('cursor/Cursor_10.cur'), grab !important;
}

.drag-handle:active,
.effect-item.dragging {
    cursor: url('cursor/Cursor_10.cur'), grabbing !important;
}

/* Text input cursor */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea {
    cursor: url('cursor/Beam.cur'), text !important;
}

/* Disabled/hollowed out/low opacity buttons */
button:disabled,
button[disabled],
button.disabled,
.disabled,
.btn-disabled,
.btn-hollow,
.hollowed,
input:disabled,
select:disabled,
.grayed-out,
button.inactive {
    cursor: url('cursor/Cursor_11.cur'), not-allowed !important;
}

/* Specifically for Delete button when no preset selected */
#deletePresetBtn:disabled,
#deleteBtn:disabled,
.preset-delete:disabled {
    cursor: url('cursor/Cursor_11.cur'), not-allowed !important;
}

/* Any element with low opacity that's not interactive */
[style*="opacity: 0.5"],
[style*="opacity:0.5"],
[style*="opacity: 0.4"],
[style*="opacity:0.4"],
[style*="opacity: 0.3"],
[style*="opacity:0.3"] {
    cursor: url('cursor/Cursor_11.cur'), not-allowed !important;
}

/* Keep loading cursor only for actual loading states */
.loading,
.exporting,
body.loading *:not(:disabled),
body.exporting *:not(:disabled) {
    cursor: url('cursor/Cursor_3.cur'), wait !important;
}

/* Date and time hover - Cursor 17 (disc) */
.taskbar-time,
.taskbar-date,
.taskbar-clock,
.clock,
.time,
.date,
#taskbarTime,
#taskbarDate,
.taskbar .time,
.taskbar .date,
[class*="time"],
[class*="clock"] {
    cursor: url('cursor/Cursor_17.cur'), pointer !important;
}

/* All desktop/home app icons - Cursor 15 (hover pointer) */
.desktop-icon {
    cursor: url('cursor/Cursor_15.cur'), pointer !important;
}

.desktop-icon:hover {
    cursor: url('cursor/Cursor_15.cur'), pointer !important;
}

/* Welcome/Help desktop icons - help cursor */
.desktop-icon.welcome-icon,
.desktop-icon.help-icon,
.desktop-icon[data-app="welcome"],
.desktop-icon[data-app="help"] {
    cursor: url('cursor/help_win95.cur'), help !important;
}

/* Start menu items - Cursor 15 (hover pointer) */
.start-menu-item {
    cursor: url('cursor/Cursor_15.cur'), pointer !important;
}

.start-menu-item:hover {
    cursor: url('cursor/Cursor_15.cur'), pointer !important;
}

/* Start menu Welcome/Help items - help cursor */
.start-menu-item.welcome-item,
.start-menu-item.help-item,
.start-menu-item[data-app="welcome"],
.start-menu-item[data-app="help"] {
    cursor: url('cursor/help_win95.cur'), help !important;
}

.start-menu-item.welcome-item:hover,
.start-menu-item.help-item:hover {
    cursor: url('cursor/help_win95.cur'), help !important;
}

/* ===== ANALYTICS DASHBOARD STYLES ===== */

#dashboardPasswordPrompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #008080;
}

.dashboard-password-window {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    min-width: 320px;
}

.dashboard-input {
    font-family: 'W95FA', Arial, sans-serif;
    font-size: 12px;
    padding: 4px 8px;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #fff;
    outline: none;
}

#analyticsDashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #008080;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
}

.dashboard-window {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-body {
    padding: 15px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.dashboard-section {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    margin-bottom: 15px;
    padding: 10px;
}

.dashboard-section-title {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    font-weight: bold;
    font-size: 11px;
    padding: 3px 8px;
    margin: -10px -10px 10px -10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-card {
    background: #fff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 11px;
    color: #444;
}

.charts-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.chart-section {
    flex: 1;
}

.chart-section.small {
    flex: 0 0 calc(33.33% - 10px);
}

.chart-container {
    background: #fff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 5px;
}

.chart-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

.chart-controls {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.chart-btn {
    padding: 3px 10px;
    font-size: 10px;
}

.chart-btn.active {
    background: #000080;
    color: white;
}

.export-stats {
    background: #fff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 10px;
}

.export-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
}

.export-stat-row:last-child {
    border-bottom: none;
}

.activity-table-container {
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.activity-table th {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 5px 8px;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.activity-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.activity-table tr:hover {
    background: #e8e8e8;
}

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

.dashboard-actions .win95-button {
    padding: 6px 15px;
    font-size: 11px;
}

.dashboard-actions .win95-button.danger {
    background: #c0c0c0;
}

.dashboard-actions .win95-button.danger:hover {
    background: #ffcccc;
}

/* Responsive dashboard */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        flex-direction: column;
    }

    .chart-section.small {
        flex: 1;
    }

    #analyticsDashboard {
        padding: 10px;
    }

    .dashboard-body {
        padding: 10px;
    }
}
