* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: none !important;
    animation: none !important;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #2a2a2a;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Controls Panel Styles */
.controls-panel {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    background-color: #1e1e1e;
    padding: 12px;
    border-right: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 100vh;
}

.mode-toggle {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.mode-btn {
    padding: 8px;
    border: 2px solid #666;
    background-color: transparent;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    border-radius: 8px;
    flex: 1;
}

/* Mode button active states - see specific button styles below */

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.background-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.background-toggle {
    display: flex;
    flex-direction: column;
}

.background-btn {
    padding: 8px;
    border: 2px solid #666;
    background-color: transparent;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    border-radius: 8px;
}

.background-btn.active {
    background-color: #1a1a1a;
    border: 2px solid #4CAF50;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.background-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #cccccc;
}

.background-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.background-toggle {
    display: flex;
    flex-direction: column;
}

.background-btn {
    padding: 8px;
    border: 2px solid #666;
    background-color: transparent;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    border-radius: 8px;
}

.background-btn.active {
    background-color: #1a1a1a;
    border: 2px solid #4CAF50;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.background-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #cccccc;
}

/* Background Image Section */
.background-image-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Background Color Section */
.background-color-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.color-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hex-input {
    flex: 1;
    padding: 10px 8px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #666;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    font-family: monospace;
    text-transform: uppercase;
    outline: none;
}

.hex-input:focus {
    border-color: #888;
    background-color: #333;
}

.color-preview {
    width: 32px;
    height: 32px;
    border: 2px solid #666;
    border-radius: 8px;
    background-color: #ffffff;
    cursor: pointer;
}

.color-preview:hover {
    border-color: #888;
}

/* Reverse Mask Section */
.reverse-mask-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mode-btn:not(.active) {
    background-color: #000000;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.format-label {
    font-size: 12px;
    font-weight: bold;
}

.strata-tool-label {
    font-size: 0.75em;
    color: #888;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.upload-btn {
    padding: 10px;
    background-color: #1a1a1a;
    color: #ffffff;
    border: 2px solid #cccccc;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    border-radius: 8px;
    text-transform: uppercase;
    width: 100%;
    box-shadow: 0 0 8px rgba(204, 204, 204, 0.3);
}

.upload-btn:hover {
    background-color: #1a1a1a;
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.upload-btn::after {
    content: '';
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Reduced from 10px */
}

.slider-label {
    font-size: 12px;
    font-weight: bold;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
}

.slider {
    flex: 1;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: #444;
    outline: none;
    border-radius: 10px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ffffff;
    cursor: pointer;
    border-radius: 50%;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ffffff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.slider-value {
    font-weight: bold;
    min-width: 30px;
    text-align: right;
    font-size: 14px;
}

/* CSS Cache Buster - Version 2.0 - Force reload */
/* Compact Download Buttons in Sidebar - Updated */
.compact-download-section {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reduced from 6px to 4px */
    margin-top: auto;
    border: 1px solid #444; /* Debug border to see if styles are applied */
    padding: 8px; /* Reduced from 10px to 8px */
    border-radius: 8px;
}

.section-label {
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px; /* Reduced from 4px to 2px */
    margin-top: 6px; /* Reduced from 8px to 6px */
}

.section-label:first-child {
    margin-top: 0;
}

.compact-buttons-row {
    display: flex;
    gap: 5px;
    margin-top: 0px;
}

/* Force button styles with high specificity */
.compact-download-section .compact-btn,
button.compact-btn,
#svgDownloadBtn,
#pngDownloadBtn,
#videoDownloadBtn,
#startStopMotionBtn {
    flex: 1;
    padding: 10px 8px !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #666 !important;
    cursor: pointer !important;
    font-weight: bold !important;
    font-size: 11px !important;
    text-align: center !important;
    border-radius: 8px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    height: 38px !important;
    overflow: hidden !important;
}

.compact-download-section .compact-btn:hover,
button.compact-btn:hover,
#svgDownloadBtn:hover,
#pngDownloadBtn:hover,
#videoDownloadBtn:hover,
#startStopMotionBtn:hover {
    background-color: #333 !important;
    border-color: #888 !important;
}

#videoDownloadBtn {
    position: relative;
}

#videoDownloadBtn.recording::before {
    content: '●';
    color: red;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.compact-btn.animation-btn {
    font-size: 11px;
    background-color: #1a1a1a !important;
    border: 2px solid #666;
    padding: 10px;
    width: 100%;
    margin-bottom: 5px;
}

.compact-btn.animation-btn:hover {
    background-color: #1a1a1a !important;
    border: 2px solid #cccccc !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(204, 204, 204, 0.3);
}

/* Force select styles with high specificity */
.compact-download-section .compact-select,
select.compact-select,
#videoFormatSelect,
#motionTypeSelect,
#aspectRatioSelect {
    flex: 1 !important;
    padding: 8px 6px !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #666 !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    /* Remove browser default styling to make it look plain */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    /* Remove default dropdown arrow and background */
    background-image: none !important;
    /* Add custom simple dropdown arrow */
    background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%), linear-gradient(135deg, #ffffff 50%, transparent 50%) !important;
    background-position: right 8px top 50%, right 4px top 50% !important;
    background-size: 4px 4px, 4px 4px !important;
    background-repeat: no-repeat !important;
    padding-right: 20px !important;
}

.compact-download-section .compact-select:hover,
select.compact-select:hover,
#videoFormatSelect:hover,
#motionTypeSelect:hover,
#aspectRatioSelect:hover {
    background-color: #333 !important;
    border-color: #888 !important;
}

.compact-download-section .compact-select option,
select.compact-select option,
#videoFormatSelect option,
#motionTypeSelect option,
#aspectRatioSelect option {
    background-color: #000000 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
}

.download-btn {
    padding: 15px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #666;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    text-align: left;
    position: relative;
    border-radius: 8px;
}

.download-btn::after {
    content: '↓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.download-btn:hover {
    background-color: #333;
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Video Download Group */
.video-download-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.format-select {
    padding: 8px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #666;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}

.format-select:hover {
    background-color: #333;
}

.format-select option {
    background-color: #000000;
    color: #ffffff;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    min-width: 0;
    position: relative;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone {
    width: 95%;
    height: 95%;
    border: 2px dashed #666;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.drop-zone.dragover {
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

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

.drop-content h1 {
    font-size: 2.5em;
    font-weight: normal;
    color: #666;
    margin-bottom: 20px;
}

.drop-zone.has-image {
    border: none;
}

.drop-zone.has-image .drop-content h1 {
    display: none;
}

/* Original input image - ALWAYS hidden (using mini-viewer instead) */
.drop-zone.has-image #canvas,
#canvas {
    display: none !important;
    visibility: hidden !important;
}

/* Processed/pixelated image - fill frame while maintaining proportions */
.drop-zone.has-image #pixelCanvas {
    display: block !important;
    width: auto;
    height: auto;
    max-width: calc(100% - 40px); /* Full width minus padding */
    max-height: calc(100% - 40px); /* Full height minus padding */
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #888888 !important;
    border-radius: 0 !important;
    z-index: 5;
}

/* Controls Panel Styles */
.controls-panel {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    background-color: #1e1e1e;
    padding: 12px;
    border-right: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 100vh;
}

/* Hide mobile-specific elements on desktop */
.section-label {
    display: none;
}

.mobile-section {
    display: contents;
}

.mobile-card {
    background: none;
    border: none;
    padding: 0;
    min-width: auto;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
}

.mobile-card-label {
    display: none;
}

.mode-toggle {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.mode-btn {
    padding: 8px;
    border: 2px solid #666;
    background-color: transparent;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 11px;
    border-radius: 8px;
    flex: 1;
}

/* Background buttons - full width stretch */
.background-btn {
    width: 100% !important;
}

/* Animation section styling to match reference */
.compact-download-section {
    border: 2px solid #666;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Bottom settings section - consolidated container */
.bottom-settings-section {
    display: block !important; /* Override mobile-section display: contents */
    border: 1px solid #666 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    margin: 15px 0 !important;
    background-color: rgba(0, 0, 0, 0.2) !important;
}

/* Ensure bottom settings section works on both desktop and mobile */
@media (max-width: 768px) {
    .bottom-settings-section {
        display: block !important;
        flex-direction: column !important;
        overflow-x: visible !important;
    }
}

/* Settings subsections within the bottom container - no separators */
.settings-subsection {
    margin-bottom: 15px;
}

.settings-subsection:last-child {
    margin-bottom: 0;
}

/* More spacing within animation section */
.settings-subsection .mobile-card {
    margin-bottom: 10px;
}

.settings-subsection .mobile-card:last-child {
    margin-bottom: 0;
}

/* Download buttons grid */
.download-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.download-buttons-grid .compact-btn {
    width: 100%;
}

.download-buttons-grid .compact-select {
    width: 100%;
}

.compact-download-section .section-label {
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    margin-top: 0;
    text-transform: uppercase;
}

/* Animation buttons and selects full width */
.compact-btn, .compact-select {
    width: 100% !important;
    box-sizing: border-box;
}

/* Download buttons in 2x2 grid */
.compact-buttons-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.compact-buttons-row .compact-btn,
.compact-buttons-row .compact-select {
    flex: 1;
    width: auto !important;
}

/* Responsive adjustments - MOBILE ONLY */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Image area at top, settings below */
    }
    
    .controls-panel {
        width: 100%;
        height: auto;
        flex-direction: column;
        padding: 8px; /* Reduced from 12px */
        gap: 4px; /* Reduced from 8px */
        max-height: 70vh;
        overflow-y: auto;
        border-right: none;
        border-top: 1px solid #444;
        border-bottom: none;
        order: 2;
        padding-bottom: 8px; /* Reduced from 20px */
    }
    
    /* Touch-friendly button improvements for mobile */
    .mobile-card button,
    .mobile-card select {
        min-height: 44px; /* Apple's recommended touch target size */
        border-radius: 10px;
        font-size: 12px;
        font-weight: 500;
        }
    
    .mobile-card button:active,
    .mobile-card select:active {
        transform: scale(0.95); /* Visual feedback on touch */
        background-color: #404040;
    }
    
    /* Compact section labels */
    .section-label {
        display: block;
        font-size: 10px; /* Reduced from 11px */
        color: #999;
        text-transform: uppercase;
        font-weight: bold;
        margin: 6px 0 3px 0; /* Reduced spacing */
        text-align: left;
    }
    
    /* Mobile sections as compact vertical stacks */
    .mobile-section {
        display: flex;
        flex-direction: column;
        gap: 4px; /* Reduced from 8px */
        padding: 4px 0; /* Reduced from 8px */
        width: 100%;
    }
    
    .mobile-section::-webkit-scrollbar {
        height: 3px;
    }
    
    .mobile-section::-webkit-scrollbar-track {
        background: #2a2a2a;
        border-radius: 3px;
    }
    
    .mobile-section::-webkit-scrollbar-thumb {
        background: #666;
        border-radius: 3px;
    }
    
    /* Make controls panel scrollbar more visible on mobile */
    .controls-panel::-webkit-scrollbar {
        width: 6px;
    }
    
    .controls-panel::-webkit-scrollbar-track {
        background: #1a1a1a;
        border-radius: 3px;
    }
    
    .controls-panel::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    .controls-panel::-webkit-scrollbar-thumb:hover {
        background: #aaa;
    }
    
    /* Compact mobile cards - remove unnecessary borders */
    .mobile-card {
        width: 100%;
        background: none; /* Remove card background */
        border: none; /* Remove card border */
        border-radius: 0;
        padding: 4px; /* Minimal padding */
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 2px; /* Minimal margin */
    }
    
    .mobile-card-label {
        display: block;
        font-size: 9px; /* Reduced from 11px */
        color: #ccc;
        text-transform: uppercase;
        font-weight: bold;
        text-align: left;
        margin-bottom: 2px; /* Reduced from 4px */
    }
    
    /* Compact buttons and selects in mobile - better proportions */
    .mobile-card button,
    .mobile-card select {
        width: 100%;
        min-height: 38px; /* Slightly taller for better proportions */
        border-radius: 6px;
        font-size: 12px;
        font-weight: 500;
            padding: 8px 12px; /* Better internal spacing */
    }
    
    /* Upload button as mobile card */
    .upload-section {
        gap: 0;
    }
    
    .upload-btn {
        min-width: 100px;
        padding: 10px 8px;
        font-size: 9px;
        border-radius: 8px;
        margin: 0;
    }
    
    /* Compact mode toggle - side by side */
    .mode-toggle {
        display: flex;
        flex-direction: row; /* Changed back to horizontal */
        gap: 4px;
        width: 100%;
    }
    
    .mode-btn {
        flex: 1; /* Share available width equally */
        padding: 10px 8px; /* Better proportions */
        font-size: 12px; /* Consistent with other buttons */
        min-height: 38px; /* Match other buttons */
        border-radius: 6px; /* More rounded */
    }
    
    /* Mobile sections as compact grid layout */
    .mobile-section {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two columns for side-by-side layout */
        gap: 4px;
        padding: 4px 0;
        width: 100%;
    }
    
    /* Full width for sliders and special elements */
    .mobile-section .slider-group,
    .mobile-section .mobile-card:has(.slider-group),
    .mobile-section .mobile-card[style*="display: none"] {
        grid-column: 1 / -1; /* Span full width */
    }
    
    /* Compact background buttons with better proportions */
    .background-btn {
        width: 100%;
        padding: 10px 12px; /* Better internal spacing */
        font-size: 12px; /* Larger text */
        text-align: center;
        line-height: 1.2;
        border-radius: 6px; /* More rounded */
        min-height: 38px; /* Match other buttons */
    }
    
    /* Clean sliders in mobile - remove unnecessary borders */
    .slider-group {
        background: none; /* Remove background */
        border: none; /* Remove border */
        border-radius: 0;
        padding: 4px 0; /* Minimal padding */
        width: 100%;
        gap: 6px;
        display: flex;
        flex-direction: column;
    }
    
    .slider-label {
        font-size: 9px;
        color: #ccc;
        text-transform: uppercase;
        font-weight: bold;
        text-align: left; /* Left align for consistency */
        margin-bottom: 4px;
    }
    
    .slider-container {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    
    .slider {
        width: 100%; /* Full width instead of fixed 80px */
        height: 6px; /* Slightly thicker for better touch */
    }
    
    .slider-value {
        font-size: 11px;
        color: #fff;
        font-weight: bold;
        min-width: auto;
    }
    
    /* Compact download section - buttons in rows */
    .compact-download-section {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    
    .compact-buttons-row {
        display: flex;
        flex-direction: row; /* Changed to horizontal */
        gap: 4px;
        width: 100%;
    }
    
    .compact-btn {
        flex: 1; /* Share width equally */
        padding: 10px 8px !important; /* Better proportions */
        font-size: 12px !important; /* Consistent sizing */
        min-height: 38px; /* Match other buttons */
        border-radius: 6px !important; /* More rounded */
    }
    
    .compact-select {
        flex: 1; /* Share width equally */
        padding: 10px 8px !important; /* Better proportions */
        font-size: 12px !important; /* Consistent sizing */
        min-height: 38px; /* Match other buttons */
        border-radius: 6px !important; /* More rounded */
    }
    
    /* Reset button */
    .reset-btn {
        padding: 8px;
        font-size: 8px;
        width: 100%;
        margin: 4px 0;
    }
    
    /* Main content reduced to give more space to controls */
    .main-content {
        height: 30vh; /* Reduced from 55vh to give more space to controls */
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        order: 1;
    }
    
    /* Mobile text styling */
    .drop-content h1 {
        display: none;
    }
    
    .drop-content::before {
        content: "Upload Content";
        font-size: 2.5em;
        font-weight: normal;
        color: #666;
        margin-bottom: 20px;
        text-align: center;
        display: block;
    }
    
    /* Color wheel smaller on mobile */
    .color-wheel-container {
        width: 200px;
        padding: 10px;
    }
    
    #colorWheelCanvas {
        width: 150px !important;
        height: 150px !important;
    }
}

/* Color Wheel Popup Styles */
.color-wheel-popup {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none; /* Allow clicks through the positioning container */
}

.color-wheel-container {
    background-color: #333;
    border: 2px solid #666;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 250px;
    pointer-events: all; /* Re-enable clicks for the actual content */
}

.color-wheel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.color-wheel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#colorWheelCanvas {
    border: 2px solid #666;
    border-radius: 50%;
    cursor: pointer;
    background-color: #222;
}

.brightness-slider-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #ffffff;
    font-size: 12px;
}

.brightness-slider {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #000000, #ffffff);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.brightness-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 2px solid #333;
    border-radius: 50%;
    cursor: pointer;
}

.brightness-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 2px solid #333;
    border-radius: 50%;
    cursor: pointer;
}

/* Make color preview clickable with cursor pointer */
.color-preview {
    cursor: pointer;
}

.color-preview:hover {
    border-color: #888 !important;
}

/* Enhanced button styles */

/* RESET SETTINGS button base style */
.reset-btn {
    width: 100%;
    background-color: #1a1a1a;
    color: #ffffff;
    border: 2px solid #666;
    padding: 8px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
}

/* RESET SETTINGS button - red glow/stroke on hover */
.reset-btn:hover {
    background-color: #1a1a1a;
    border: 2px solid #dc3545;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}

/* COLORED button - blue outline when active (like green outline buttons) */
#coloredBtn.active {
    background-color: #1a1a1a;
    border: 2px solid #4285f4;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(66, 133, 244, 0.4);
}

#coloredBtn:not(.active) {
    background-color: transparent;
    color: #ffffff;
    border-color: #666;
}

/* BLACK & WHITE button - white outline when active (like green outline buttons) */
#bwBtn.active {
    background-color: #1a1a1a;
    border: 2px solid #ffffff;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

#bwBtn:not(.active) {
    background-color: transparent;
    color: #ffffff;
    border-color: #666;
}

/* Button hover effects for non-active states */
#coloredBtn:not(.active):hover {
    background-color: #1a1a1a;
    border: 2px solid #667eea;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

#bwBtn:not(.active):hover {
    background-color: #1a1a1a;
    border: 2px solid #bbbbbb;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(187, 187, 187, 0.3);
}

/* ===========================================
   MULTI-IMAGE MINI-VIEWER STYLES
   =========================================== */

/* Mini-viewer container (top-right corner) */
.mini-viewer {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: none; /* Hidden until images loaded */
}

.mini-viewer.visible {
    display: block;
}

/* ===========================================
   STATE 1 & 2: STACKED VIEW (default, collapsed)
   =========================================== */
.mini-viewer-stack {
    position: relative;
    width: 80px;
    height: 110px;
    cursor: pointer;
}

/* Individual thumbnail card */
.stacked-thumb {
    position: absolute;
    width: 80px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #fff;
    background-color: #3a3a3a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.stacked-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stacking positions - front card on top */
.stacked-thumb.stack-0 {
    z-index: 3;
    top: 0;
    left: 0;
}

.stacked-thumb.stack-1 {
    z-index: 2;
    top: 6px;
    left: 6px;
    transform: rotate(3deg);
}

.stacked-thumb.stack-2 {
    z-index: 1;
    top: 12px;
    left: 12px;
    transform: rotate(6deg);
}

.mini-viewer-stack:hover .stacked-thumb.stack-0 {
    transform: scale(1.02);
}

/* Delete button - INSIDE the card */
.thumb-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(60, 60, 60, 0.9);
    color: white;
    border: 2px solid #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    padding-bottom: 2px; /* Compensate for font baseline */
    z-index: 10;
}

.thumb-delete-btn:hover {
    background-color: #dc3545;
    transform: scale(1.1);
}

/* Image count badge */
.image-count-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background-color: #4285f4;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ===========================================
   STATE 3: EXPANDED VIEW (horizontal gallery)
   =========================================== */
.mini-viewer.expanded .mini-viewer-stack {
    display: none;
}

.mini-viewer-expanded {
    display: none;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    background-color: rgba(30, 30, 30, 0.95);
    border-radius: 14px;
    padding: 12px;
    max-width: 450px;
    max-height: 85vh;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid #444;
    touch-action: none;
}

#expandedImages {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
}

.mini-viewer.expanded .mini-viewer-expanded {
    display: flex;
}

.mini-viewer-expanded::-webkit-scrollbar {
    height: 6px;
}

.mini-viewer-expanded::-webkit-scrollbar-track {
    background: #222;
    border-radius: 3px;
}

.mini-viewer-expanded::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

/* Individual card in expanded view */
.expanded-thumb {
    position: relative;
    width: 70px;
    height: 95px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #555;
    background-color: #3a3a3a;
    cursor: pointer;
    flex-shrink: 0;
}

.expanded-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.expanded-thumb:hover {
    border-color: #888;
    transform: scale(1.05);
}

.expanded-thumb.active {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.4);
}

/* Smooth sliding DURING drag only — applied via JS class on the container */
#expandedImages.drag-in-progress .expanded-thumb {
    transition: transform 0.12s ease !important;
    will-change: transform;
}

/* Source card is removed from flex flow via display:none (set inline in JS).
   This class is kept only as a marker for filtering in querySelectorAll. */
.expanded-thumb.gallery-drag-source {
    display: none !important;
}

/* Floating clone that follows the cursor — no transition, must track instantly */
.gallery-drag-clone {
    transition: none !important;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #fff;
    background-color: #3a3a3a;
}

/* Delete button in expanded view - INSIDE the card */
.expanded-thumb .thumb-delete-btn {
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    font-size: 11px;
    padding: 0;
    padding-bottom: 1px;
    line-height: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .mini-viewer {
        top: 10px;
        right: 10px;
    }

    .mini-viewer-stack {
        width: 60px;
        height: 85px;
    }

    .stacked-thumb {
        width: 60px;
        height: 85px;
        border-radius: 10px;
    }

    .stacked-thumb.stack-1 {
        top: 5px;
        left: 5px;
    }

    .stacked-thumb.stack-2 {
        top: 10px;
        left: 10px;
    }

    .mini-viewer-expanded {
        max-width: 280px;
        padding: 8px;
        gap: 8px;
    }

    .expanded-thumb {
        width: 55px;
        height: 75px;
        border-radius: 8px;
    }

    .thumb-delete-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .image-count-badge {
        min-width: 18px;
        height: 18px;
        font-size: 9px;
    }
}
