/* ===========================
   GLOBAL STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

/* ===========================
   TOP NAVIGATION
   =========================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #60a5fa;
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.3s;
}

.logo:hover {
    color: #93c5fd;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-right: 100px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: #60a5fa;
}

.nav-links a.active {
    color: #60a5fa;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s;
}

.nav-dropdown-btn:hover {
    color: #60a5fa;
}

.nav-dropdown-btn.has-active {
    color: #60a5fa;
}

.nav-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-dropdown-menu a:hover {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
}

.nav-dropdown-menu a.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.05);
}

.nav-links a.soon {
    color: #999;
}

.badge {
    background: #d4a244;
    color: #1a2332;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
}

/* ===========================
   TOOL BUTTONS
   =========================== */
.tool-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    margin-top: 0;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    width: 100%;
}

.tool-btn {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.6);
    color: #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-btn:hover:not(:disabled) {
    border-color: #60a5fa;
    color: #ffffff;
    background: rgba(96, 165, 250, 0.1);
}

.tool-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

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

/* ===========================
   WORKSPACE LAYOUT
   =========================== */
.workspace-container {
    display: grid;
    grid-template-columns: 1fr minmax(900px, 1200px) 1fr;
    gap: 0;
    width: 100%;
    height: calc(100vh - 180px);
    padding-bottom: 70px; /* Space for fixed bottom controls */
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Sidebar spaces - keep empty when closed */
.workspace-sidebar {
    /* No styling when empty */
}

.workspace-sidebar.left {
    /* No border when empty */
}

/* ===========================
   LOCAL TOOLS SIDEBAR (LEFT)
   =========================== */
#local-tools-sidebar {
    height: 100%;
}

/* Hide content by default, show when open */
#local-tools-sidebar .local-tools-content {
    display: none;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-right: 2px solid rgba(96, 165, 250, 0.3);
    height: 100%;
    overflow-y: auto;
    padding-top: 15px; /* Reduced from 50px */
}

/* Scrollbar for local tools content */
#local-tools-sidebar .local-tools-content::-webkit-scrollbar {
    width: 8px;
}

#local-tools-sidebar .local-tools-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

#local-tools-sidebar .local-tools-content::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
}

#local-tools-sidebar .local-tools-content::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

#local-tools-sidebar.open .local-tools-content {
    display: block;
}

/* Close button for left sidebar */
#local-tools-sidebar .close-sidebar-btn.left-close {
    display: none;
}

#local-tools-sidebar.open .close-sidebar-btn.left-close {
    display: flex;
}

/* Close button for left sidebar */
.close-sidebar-btn.left-close {
    position: absolute;
    top: 15px;
    left: 15px;
}

/* Local Tools Content */
.local-tools-content {
    padding: 20px;
    padding-bottom: 30px; /* Extra space at bottom for scrolling */
}

/* Tools Header */
.tools-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    padding-right: 50px; /* Make room for close button */
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 6px;
    margin-bottom: 20px;
    position: relative;
}

.tools-header .close-sidebar-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    margin: 0;
}

.tools-icon {
    font-size: 24px;
}

.tools-title {
    font-size: 16px;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 1px;
}

/* Tool Selection Buttons */
.tool-buttons-group {
    display: none; /* Hidden by default, shown when adjustments opens */
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Show tool buttons when adjustments is active */
#local-tools-sidebar.adjustments-active .tool-buttons-group {
    display: flex;
}

.tool-select-btn {
    width: 100%;
    padding: 12px 15px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-select-btn .icon {
    font-size: 18px;
}

.tool-select-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(96, 165, 250, 0.4);
    transform: translateX(3px);
}

.tool-select-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

/* Tool Settings Panel */
.tool-settings-panel {
    display: none; /* Hidden by default, shown when adjustments opens */
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    padding: 15px;
}

/* Show tool settings when adjustments is active */
#local-tools-sidebar.adjustments-active .tool-settings-panel {
    display: block;
}

.tool-settings {
    display: none;
}

.tool-settings.active {
    display: block;
}

.tool-description {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
    border-left: 3px solid #60a5fa;
}

/* Brush Controls */
.brush-control-item {
    margin-bottom: 15px;
}

.control-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.control-label {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

.value-input.small {
    width: 50px;
    font-size: 12px;
    padding: 4px 6px;
}

.brush-slider {
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.brush-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
    transition: all 0.2s;
}

.brush-slider::-webkit-slider-thumb:hover {
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
    transform: scale(1.1);
}

.brush-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

/* Tool Mode Toggle */
.tool-mode-toggle {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mode-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(96, 165, 250, 0.4);
}

.mode-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: #60a5fa;
    color: #ffffff;
}

.mode-btn .icon {
    font-size: 14px;
}

/* Sample Status */
.sample-status {
    padding: 10px;
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 4px;
    font-size: 11px;
    color: #fb923c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
}

.sample-status.sampled {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

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

.status-text {
    flex: 1;
}

/* Tool Actions */
.tool-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.tool-action-btn {
    flex: 1;
    padding: 10px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.tool-action-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(96, 165, 250, 0.4);
    transform: translateY(-2px);
}

.tool-action-btn.clear-btn {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.tool-action-btn.clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.tool-action-btn.undo-btn {
    border-color: rgba(251, 146, 60, 0.3);
    color: #fb923c;
}

.tool-action-btn.undo-btn:hover {
    background: rgba(251, 146, 60, 0.1);
    border-color: #fb923c;
}

/* Scrollbar for left sidebar */
#local-tools-sidebar::-webkit-scrollbar {
    width: 8px;
}

#local-tools-sidebar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

#local-tools-sidebar::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
}

#local-tools-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

.workspace-sidebar.right {
    /* No border when empty */
}

/* ===========================
   ADJUSTMENTS SIDEBAR (NOW IN GRID)
   =========================== */
#adjustments-sidebar {
    height: 100%;
}

/* Hide content by default, show when open */
#adjustments-sidebar .adjustments-content {
    display: none;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-left: 2px solid rgba(96, 165, 250, 0.3);
    height: 100%;
    overflow-y: auto;
    padding-top: 15px; /* Match left sidebar padding */
}

#adjustments-sidebar.open .adjustments-content {
    display: block;
}

/* Close button for right sidebar */
#adjustments-sidebar .close-sidebar-btn {
    display: none;
}

#adjustments-sidebar.open .close-sidebar-btn {
    display: flex;
}

/* Close Button */
.close-sidebar-btn {
    width: 32px;
    height: 32px;
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.close-sidebar-btn.right-close {
    margin: 0 auto 15px auto;
}

#adjustments-sidebar .close-sidebar-btn {
    display: none;
}

#adjustments-sidebar.open .close-sidebar-btn {
    display: flex;
}

.close-sidebar-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #ffffff;
}
.image-viewport {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid rgba(96, 165, 250, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Canvas styling */
#main-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Checkerboard background for transparent images */
.canvas-container.has-transparency {
    background-image: 
        linear-gradient(45deg, #3a3a3a 25%, transparent 25%),
        linear-gradient(-45deg, #3a3a3a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #3a3a3a 75%),
        linear-gradient(-45deg, transparent 75%, #3a3a3a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: #2a2a2a;
}

/* ===========================
   LANDING LOGO (Before Upload)
   =========================== */
.landing-logo {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease-in;
}

.logo-image {
    max-width: 600px;
    max-height: 400px;
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 40px rgba(96, 165, 250, 0.6));
    animation: logoGlow 3s ease-in-out infinite;
}
}

@keyframes logoGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 40px rgba(96, 165, 250, 0.6));
    }
    50% { 
        filter: drop-shadow(0 0 60px rgba(96, 165, 250, 0.9));
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===========================
   FABRIC.JS CANVAS
   =========================== */
#main-canvas {
    /* Canvas should be invisible - only image content shows */
}

/* ===========================
   BOTTOM CONTROLS BAR
   =========================== */
.bottom-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 15px 40px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 2px solid rgba(96, 165, 250, 0.3);
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
}

/* Zoom Control */
.zoom-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
    color: #ffffff;
}

#zoom-slider {
    width: 200px;
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

#zoom-slider::-webkit-slider-thumb:hover {
    background: #3b82f6;
    transform: scale(1.2);
}

#zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

#zoom-slider::-moz-range-thumb:hover {
    background: #3b82f6;
    transform: scale(1.2);
}

.zoom-value {
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* Image Statistics (right column) */
.image-stats {
    display: flex;
    gap: 25px;
    align-items: center;
    grid-column: 3;
    justify-self: end;
}

.stat-item {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.stat-label {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

.stat-value {
    color: #60a5fa;
    font-size: 16px;
    font-weight: 600;
}

.unit-selector {
    display: flex;
    gap: 5px;
    background: rgba(30, 41, 59, 0.6);
    padding: 5px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.unit-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-btn:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.unit-btn.active {
    background: #60a5fa;
    color: #ffffff;
}

/* ===========================
   HOMEPAGE STYLES
   =========================== */
.homepage-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.homepage-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.homepage-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.homepage-content p {
    font-size: 20px;
    margin-bottom: 40px;
    color: #94a3b8;
}

.btn-primary {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px rgba(59, 130, 246, 0.6);
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    .tool-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tool-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .logo-image {
        max-width: 500px;
        width: 95%;
    }
    
    .nav-links {
        gap: 15px;
        font-size: 14px;
    }
    
    .image-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
        min-width: auto;
        width: 100%;
    }
    
    .crop-layout {
        flex-direction: column;
    }
    
    .crop-controls {
        width: 100%;
        max-width: 100%;
    }
}

/* ===========================
   CROP MODAL
   =========================== */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.crop-modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 16px;
    padding: 30px;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.crop-title {
    color: #60a5fa;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 30px 0;
}

.crop-layout {
    display: flex;
    gap: 30px;
    flex: 1;
    overflow: hidden;
}

.crop-canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

#crop-canvas {
    max-width: 100%;
    max-height: 100%;
}

.crop-controls {
    width: 320px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-heading {
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

.unit-selector-crop {
    display: flex;
    gap: 8px;
    background: rgba(30, 41, 59, 0.6);
    padding: 5px;
    border-radius: 6px;
}

.unit-btn-crop {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-btn-crop:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.unit-btn-crop.active {
    background: #60a5fa;
    color: #ffffff;
}

.dimension-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dimension-input {
    width: 80px;
    padding: 10px 8px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.dimension-separator {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
}

.dimension-input:focus {
    outline: none;
    border-color: #60a5fa;
}

/* Crop Mode Selector */
.crop-mode-selector {
    display: flex;
    gap: 10px;
}

.crop-mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.crop-mode-option:hover {
    border-color: rgba(96, 165, 250, 0.4);
}

.crop-mode-option input[type="radio"] {
    display: none;
}

.crop-mode-option input[type="radio"]:checked + .crop-mode-label {
    color: #60a5fa;
}

.crop-mode-option:has(input[type="radio"]:checked) {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
}

.crop-mode-label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
}

/* Zoom Control for Fixed Size Mode */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    padding: 12px;
    border-radius: 6px;
}

.zoom-label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    min-width: 40px;
}

.crop-zoom-slider {
    flex: 1;
    height: 6px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.crop-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
}

.crop-zoom-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.zoom-value {
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

.helper-text {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
    margin: 8px 0 0 0;
    text-align: center;
}

.position-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-position {
    flex: 1;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-position:hover {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
    color: #60a5fa;
}

.toggle-control {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    padding: 15px;
}

.toggle-label {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 14px;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 13px;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #94a3b8;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

.toggle-checkbox:checked + .toggle-slider {
    background: #60a5fa;
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: #ffffff;
}

.round-slider {
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.round-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #60a5fa;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.round-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #60a5fa;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.slider-labels {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.slider-labels span {
    color: #94a3b8;
    font-size: 14px;
}

#round-value {
    color: #60a5fa;
    font-weight: 600;
    font-size: 16px;
}

#round-type {
    color: #60a5fa;
    font-style: italic;
}

.crop-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-crop-action {
    padding: 12px 40px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close {
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

.btn-close:hover {
    background: rgba(148, 163, 184, 0.3);
    transform: translateY(-2px);
}

.btn-apply {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px rgba(59, 130, 246, 0.6);
}

/* ===========================
   RESIZE MODAL
   =========================== */
.resize-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.resize-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.resize-title {
    color: #60a5fa;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

.resize-section {
    margin-bottom: 8px;
}

.resize-label {
    display: block;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.label-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(96, 165, 250, 0.3);
    border: 2px solid #60a5fa;
    border-radius: 50%;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 700;
    cursor: help;
    margin-left: 6px;
    transition: all 0.3s;
}

.label-hint:hover {
    background: rgba(96, 165, 250, 0.5);
    border-color: #93c5fd;
    color: #93c5fd;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* Custom Tooltip */
.label-hint[data-tooltip] {
    position: relative;
}

.label-hint[data-tooltip]::after {
    content: attr(data-tooltip);
    position: fixed;
    bottom: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #60a5fa;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    white-space: pre-line;
    width: 320px;
    max-width: 90vw;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

/* Tooltip arrow - hide when centered */
.label-hint[data-tooltip]::before {
    content: '';
    opacity: 0;
    visibility: hidden;
}

/* Show tooltip on hover OR when active (clicked) */
.label-hint[data-tooltip]:hover::after,
.label-hint[data-tooltip]:hover::before,
.label-hint[data-tooltip].active::after,
.label-hint[data-tooltip].active::before {
    opacity: 1;
    visibility: visible;
}

/* When active (clicked), make tooltip clickable */
.label-hint[data-tooltip].active::after {
    pointer-events: auto;
}

/* Backdrop overlay when tooltip is active */
.tooltip-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.tooltip-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.resize-select,
.resize-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s;
}

.resize-select:focus,
.resize-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Top Row - Measurement, Width, Height side-by-side */
.top-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.dimension-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.dimension-input-group .resize-input {
    padding-right: 45px;
}

.dimension-unit {
    position: absolute;
    right: 15px;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

/* Compact sections */
.compact-toggle,
.compact-input {
    margin-bottom: 8px;
}

/* Experimental Section */
.experimental-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(148, 163, 184, 0.2);
}

.experimental-toggle {
    width: 100%;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    padding: 10px 12px;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.experimental-toggle:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: #60a5fa;
}

.toggle-arrow {
    font-size: 11px;
    transition: transform 0.3s;
}

.toggle-arrow.expanded {
    transform: rotate(90deg);
}

.experimental-content {
    margin-top: 12px;
}

/* Calculator Inputs */
.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
}

.calc-label {
    display: flex;
    align-items: center;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
    line-height: 1.4;
}

.calc-input,
.calc-select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    transition: all 0.3s;
}

.calc-input:focus,
.calc-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Calculator Results */
.calculator-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.result-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.result-card-full {
    grid-column: 1 / -1;
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
}

.result-label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.result-value {
    color: #60a5fa;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-range {
    color: #cbd5e1;
    font-size: 11px;
    margin-bottom: 8px;
}

.result-use-btn {
    width: 100%;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #60a5fa;
    border-radius: 4px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
}

.result-use-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Explanation Box */
.result-explanation {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.explanation-text {
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.5;
}

/* Error/Warning Messages */
.result-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    padding: 15px;
    color: #fca5a5;
    font-size: 13px;
    line-height: 1.6;
}

.result-alternatives {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.alternatives-title {
    color: #fcd34d;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.alternative-item {
    color: #cbd5e1;
    font-size: 12px;
    margin-left: 15px;
    margin-top: 3px;
}

/* Modal Action Buttons */
.resize-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 2px solid rgba(148, 163, 184, 0.2);
}

.btn-resize-action {
    padding: 10px 35px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

.btn-cancel:hover {
    background: rgba(148, 163, 184, 0.3);
    transform: translateY(-2px);
}

.btn-ok {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.btn-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px rgba(59, 130, 246, 0.6);
}

/* Sidebar Content */
.adjustments-content {
    padding: 20px;
}

/* Adjustment Sections */
.adjustment-section {
    margin-bottom: 15px;
}

/* Auto Enhance Section */
.auto-enhance-section {
    margin-bottom: 20px;
}

/* Toggle Switch Section */
.toggle-control-section {
    padding: 15px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
}

.toggle-label-full {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.5px;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.toggle-slider-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #cbd5e1;
    top: 2px;
    left: 3px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-checkbox:checked + .toggle-slider-switch {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: #60a5fa;
}

.toggle-checkbox:checked + .toggle-slider-switch::before {
    transform: translateX(26px);
    background: #ffffff;
}

.toggle-slider-switch:hover {
    border-color: #60a5fa;
}

.auto-enhance-btn,
.undo-auto-btn,
.action-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auto-enhance-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.auto-enhance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px rgba(59, 130, 246, 0.6);
}

.undo-auto-btn {
    background: rgba(251, 146, 60, 0.2);
    border-color: #fb923c;
    color: #fb923c;
}

.undo-auto-btn:hover {
    background: rgba(251, 146, 60, 0.3);
    transform: translateY(-2px);
}

.action-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
}

.action-btn .icon,
.auto-enhance-btn .icon,
.undo-auto-btn .icon {
    font-size: 18px;
}

/* Collapsible Sections */
.collapsible .adjustment-header {
    padding: 12px 15px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.collapsible .adjustment-header:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(96, 165, 250, 0.4);
}

.collapsible .adjustment-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.5px;
}

.collapsible .adjustment-header .value-display {
    font-size: 13px;
    color: #60a5fa;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.collapsible .adjustment-header .arrow {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.collapsible .adjustment-header.open .arrow {
    transform: rotate(180deg);
}

/* Adjustment Content (Sliders) */
.adjustment-content {
    padding: 15px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-top: none;
    border-radius: 0 0 6px 6px;
    display: none;
}

.adjustment-content.open {
    display: block;
}

/* Standard Slider */
.adjustment-slider {
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    margin-bottom: 10px;
}

.adjustment-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.adjustment-slider::-webkit-slider-thumb:hover {
    background: #3b82f6;
    transform: scale(1.2);
}

.adjustment-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #60a5fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.adjustment-slider::-moz-range-thumb:hover {
    background: #3b82f6;
    transform: scale(1.2);
}

/* Slider Value Display */
.slider-value {
    display: block;
    text-align: center;
    margin-top: 10px;
}

.value-input {
    width: 60px;
    padding: 6px 8px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.value-input:hover {
    border-color: #60a5fa;
    background: rgba(30, 41, 59, 1);
}

.value-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Remove number input arrows (optional, cleaner look) */
.value-input::-webkit-inner-spin-button,
.value-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.value-input[type=number] {
    -moz-appearance: textfield;
}

/* Dual Slider (Levels) */
.dual-slider {
    margin: 15px 0;
}

.slider-values {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
}

.slider-values span {
    font-weight: 600;
}

.slider-values span span {
    color: #60a5fa;
}

/* noUiSlider Custom Styling */
.noUi-target {
    background: rgba(148, 163, 184, 0.2);
    border: none;
    box-shadow: none;
    border-radius: 3px;
}

.noUi-connect {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.noUi-handle {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
    cursor: pointer;
    top: -6px;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.noUi-handle:hover {
    background: #3b82f6;
}

/* Reset All Button */
.reset-all-btn {
    width: 100%;
    padding: 12px 20px;
    margin-top: 20px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-all-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: translateY(-2px);
}

/* Scrollbar Styling for Sidebar */
#adjustments-sidebar::-webkit-scrollbar {
    width: 8px;
}

#adjustments-sidebar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

#adjustments-sidebar::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
}

#adjustments-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* Fixed Image Viewport */


/* ================================
   IMAGE INFO BOX (Top of Sidebar)
   ================================ */
.image-info-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
}

.unit-selector-inline {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.unit-btn-small {
    flex: 1;
    padding: 4px 8px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-btn-small:hover {
    border-color: rgba(96, 165, 250, 0.4);
    background: rgba(30, 41, 59, 1);
}

.unit-btn-small.active {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
    color: #60a5fa;
}

.info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.info-label {
    color: #94a3b8;
    font-weight: 500;
}

.info-value {
    color: #e2e8f0;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ================================
   BOTTOM BAR SECTIONS (for grid layout)
   ================================ */
/* Note: .bottom-controls defined earlier uses CSS Grid with 3 columns */

.bottom-left-section {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    grid-column: 1;
}

.bottom-center-section {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    grid-column: 2;
}

.bottom-right-section {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    grid-column: 3;
}

.view-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.view-control-btn:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(96, 165, 250, 0.4);
    color: #60a5fa;
}

.view-control-btn.active {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
    color: #60a5fa;
}

.view-control-btn .icon {
    font-size: 16px;
}

.view-control-btn .label {
    font-size: 11px;
}

/* Zoom controls stay on right */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hide old tools header */
.tools-header {
    display: none;
}

/* Adjust tool buttons to remove extra spacing */
.tool-buttons-group {
    margin-top: 0;
}

/* Cursor styles for pan mode */
.image-viewport.pan-active {
    cursor: grab !important;
}

.image-viewport.pan-active.panning {
    cursor: grabbing !important;
}

/* Hide brush cursor when panning */
.panning .brush-cursor {
    display: none;
}

/* ================================
   USER GUIDE MODAL
   ================================ */

/* User Guide Modal */
.user-guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-guide-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.user-guide-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: rgba(15, 23, 42, 0.98);
    border: 2px solid rgba(96, 165, 250, 0.4);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

.user-guide-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #e2e8f0;
    font-size: 20px;
    font-weight: 600;
}

.user-guide-title .icon {
    font-size: 24px;
}

.user-guide-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 6px;
    color: #f87171;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-guide-close-btn:hover {
    background: rgba(248, 113, 113, 0.25);
    border-color: #f87171;
    transform: scale(1.1);
}

.user-guide-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    color: #e2e8f0;
    line-height: 1.6;
}

/* Scrollbar styling for guide content */
.user-guide-body::-webkit-scrollbar {
    width: 10px;
}

.user-guide-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

.user-guide-body::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 5px;
}

.user-guide-body::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* Guide Content Styling */
.guide-section {
    margin-bottom: 35px;
}

.guide-section:last-child {
    margin-bottom: 0;
}

.guide-section h3 {
    color: #60a5fa;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

.guide-section h4 {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 8px 0;
}

.tool-guide-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.tool-guide-item h4 {
    color: #60a5fa;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.tool-guide-item p {
    margin: 8px 0;
    color: #cbd5e1;
}

.tool-guide-item p strong {
    color: #e2e8f0;
    font-weight: 600;
}

.tool-guide-item ul {
    margin: 8px 0 8px 20px;
    padding: 0;
    color: #cbd5e1;
}

.tool-guide-item li {
    margin: 6px 0;
}

.guide-section ol {
    margin: 15px 0 15px 25px;
    padding: 0;
    color: #cbd5e1;
}

.guide-section ol li {
    margin: 10px 0;
}

.guide-section ol li ul {
    margin: 8px 0 8px 20px;
}

.guide-section > ul {
    margin: 15px 0 15px 20px;
    padding: 0;
    color: #cbd5e1;
}

.guide-section > ul li {
    margin: 8px 0;
}

.warning {
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1);
    border-left: 3px solid #fbbf24;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 12px 0;
}

/* Animation */
.user-guide-modal {
    animation: fadeIn 0.2s ease-out;
}

.user-guide-modal-content {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* ===========================
   DITHERING MODAL
   Add this to the end of style.css
   =========================== */

/* Modal Overlay */
.dither-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dither-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

/* Modal Content */
.dither-modal-content {
    position: relative;
    width: 850px;
    max-width: 90vw;
    max-height: 85vh;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header */
.dither-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.dither-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ffffff;
    margin: 0;
}

.dither-modal-close {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.dither-modal-close:hover {
    color: #ffffff;
}

/* Status Bar */
.dither-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.status-icon {
    font-size: 18px;
}

.status-text {
    font-size: 14px;
    color: #cbd5e1;
}

.dither-status-bar.ready .status-text {
    color: #10b981;
}

.dither-status-bar.uploading .status-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Modal Body: Two Columns */
.dither-modal-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.column-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #94a3b8;
    margin: 0 0 15px 0;
}

/* Left Column: Algorithms */
.dither-algorithms-column {
    display: flex;
    flex-direction: column;
}

/* Algorithm Cards */
.dither-card {
    position: relative;
    padding: 18px 15px;
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dither-card:hover {
    border-color: #60a5fa;
    transform: translateX(3px);
}

.dither-card.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.card-content {
    flex: 1;
}

.card-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.card-speed {
    font-size: 12px;
    color: #94a3b8;
}

.card-badge {
    font-size: 16px;
    margin-right: 8px;
}

.card-radio {
    font-size: 20px;
    color: #cbd5e1;
    min-width: 20px;
    text-align: center;
}

.dither-card.selected .card-radio {
    color: #3b82f6;
}

.dither-card.selected .card-radio::before {
    content: '●';
}

.dither-card:not(.selected) .card-radio::before {
    content: '○';
}

/* Right Column: Description */
.dither-description-column {
    display: flex;
    flex-direction: column;
}

.description-box {
    flex: 1;
    padding: 20px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
}

.description-placeholder {
    color: #64748b;
    font-style: italic;
    margin: 0;
}

.description-box p {
    margin: 0 0 12px 0;
}

.description-box p:last-child {
    margin-bottom: 0;
}

/* Footer Buttons */
.dither-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.dither-btn-cancel,
.dither-btn-apply {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.dither-btn-cancel {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.dither-btn-cancel:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(148, 163, 184, 0.5);
}

.dither-btn-apply {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.dither-btn-apply:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

.dither-btn-apply:disabled {
    background: rgba(30, 41, 59, 0.8);
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* Processing Overlay */
.dither-processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(148, 163, 184, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-text {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.processing-time {
    font-size: 14px;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .dither-modal-body {
        grid-template-columns: 1fr;
    }
    
    .dither-modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .dither-card {
        padding: 15px 12px;
    }
    
    .card-name {
        font-size: 15px;
    }
}

/* ===========================
   DOWNLOAD MODAL
   =========================== */

.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.download-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.download-modal-content {
    position: relative;
    width: 500px;
    max-width: 90vw;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.2s ease-out;
}

.download-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.download-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ffffff;
    margin: 0;
}

.download-modal-close {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.download-modal-close:hover {
    color: #ffffff;
}

.download-modal-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.download-format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px;
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: #ffffff;
}

.download-format-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(96, 165, 250, 0.3);
}

.format-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.format-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.format-desc {
    font-size: 13px;
    color: #94a3b8;
}

.download-info {
    padding: 20px 30px;
    background: rgba(30, 41, 59, 0.3);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    gap: 30px;
    justify-content: center;
}

.download-info .info-item {
    display: flex;
    gap: 8px;
}

.download-info .info-label {
    color: #94a3b8;
    font-size: 14px;
}

.download-info .info-value {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

/* ===========================
   QUEUE STATUS STYLES
   =========================== */

.processing-queue {
    margin-top: 10px;
    font-size: 13px;
    color: #94a3b8;
}

.processing-queue .queue-label {
    margin-right: 5px;
}

.processing-queue .queue-value {
    color: #60a5fa;
    font-weight: 600;
}

/* ===========================
   ADJUSTMENT SUB-CONTROLS (Unsharp Mask, etc.)
   =========================== */

.adjustment-sub-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.adjustment-sub-control .sub-label {
    min-width: 70px;
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adjustment-sub-control .adjustment-slider {
    flex: 1;
}

.adjustment-sub-control .slider-value {
    min-width: 60px;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #cbd5e1;
}

.adjustment-sub-control .value-input {
    width: 45px;
}

/* ===========================
   THRESHOLD TOOL STYLES
   =========================== */

.threshold-toggle-row {
    margin-bottom: 15px;
}

.toggle-label-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-slider-switch.small {
    width: 40px;
    height: 20px;
}

.toggle-slider-switch.small:before {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
}

.toggle-checkbox:checked + .toggle-slider-switch.small:before {
    transform: translateX(20px);
}

.toggle-text-inline {
    font-size: 13px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.threshold-info {
    margin-top: 12px;
    padding: 10px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
}

.threshold-info .info-text {
    display: block;
    font-size: 11px;
    color: #64748b;
    line-height: 1.6;
}

/* ===========================
   SCROLLABLE SIDEBAR IMPROVEMENTS
   =========================== */

#adjustments-sidebar .adjustments-content {
    padding-bottom: 40px; /* Extra space for scrolling */
}

/* Smooth scroll behavior */
#adjustments-sidebar .adjustments-content,
#local-tools-sidebar .local-tools-content {
    scroll-behavior: smooth;
}

/* Fade effect at bottom when more content available */
#adjustments-sidebar.open::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0));
    pointer-events: none;
    opacity: 0.8;
}

/* ===========================
   2-COLUMN ADJUSTMENT GRID
   =========================== */
.adjustment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
}

.adj-grid-btn {
    padding: 12px 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.adj-grid-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(100, 116, 139, 0.8);
    color: #f1f5f9;
}

.adj-grid-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    border-color: rgba(59, 130, 246, 0.6);
    color: #fff;
}

.adj-grid-btn.has-value {
    position: relative;
}

.adj-grid-btn.has-value::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
}

/* ===========================
   EXPANDED TOOL PANEL
   =========================== */
.adj-expanded-panel {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
}

.adj-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(51, 65, 85, 0.5);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.adj-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adj-panel-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.adj-panel-close:hover {
    color: #fff;
}

.adj-panel-controls {
    padding: 12px;
}

.tool-controls {
    display: none;
}

.tool-controls.active {
    display: block;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-row .adjustment-slider {
    flex: 1;
}

.toggle-row {
    padding: 5px 0;
}

/* ===========================
   APPLY TO SECTION
   =========================== */
.apply-to-section {
    padding: 12px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    background: rgba(15, 23, 42, 0.3);
}

.apply-to-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.apply-to-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.apply-to-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: #cbd5e1;
}

.apply-to-option:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(100, 116, 139, 0.5);
}

.apply-to-option:has(input:checked) {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
}

.apply-to-option input[type="radio"] {
    accent-color: #3b82f6;
}

.apply-to-option span {
    flex: 1;
}

.apply-to-icon {
    font-size: 14px;
    opacity: 0.8;
}

.clear-selection-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-selection-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.apply-selection-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.4));
    border: 1px solid rgba(16, 185, 129, 0.6);
    border-radius: 6px;
    color: #6ee7b7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.apply-selection-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.6), rgba(5, 150, 105, 0.6));
    border-color: rgba(16, 185, 129, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.nav-disabled {
    color: #475569 !important;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ===========================
   CURVE PRESETS
   =========================== */

.curve-presets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.curve-preset-btn {
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.curve-preset-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(96, 165, 250, 0.4);
    color: #f1f5f9;
}

.curve-preset-btn.active {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(59, 130, 246, 0.3));
    border-color: rgba(96, 165, 250, 0.6);
    color: #60a5fa;
}

.curve-description {
    margin-top: 12px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 6px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

/* ===========================
   MATERIAL SELECTION MODAL
   =========================== */

.material-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.material-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1;
    pointer-events: auto;
}

.material-modal-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.material-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.material-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 1px;
}

.material-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    color: #ef4444;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.material-modal-close:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.1);
}

.material-modal-body {
    padding: 24px;
    overflow: visible;
    pointer-events: auto;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow: visible;
    pointer-events: auto;
}

.material-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
}

.material-btn:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(59, 130, 246, 0.2));
    border-color: rgba(96, 165, 250, 0.5);
    color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.material-btn:active {
    transform: translateY(0);
}

.material-btn * {
    pointer-events: none;
}

.material-icon {
    font-size: 32px;
    margin-bottom: 8px;
    pointer-events: none;
}

.material-name {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
}

.material-description {
    margin-top: 16px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
}

.material-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.material-btn-cancel {
    padding: 10px 24px;
    background: rgba(71, 85, 105, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.material-btn-cancel:hover {
    background: rgba(71, 85, 105, 0.6);
    color: #f1f5f9;
}
