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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

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

.nav-active {
    color: #60a5fa !important;
}

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

.coming-soon {
    font-size: 0.7rem;
    background: #fbbf24;
    color: #78350f;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* ===== HOMEPAGE ===== */
.homepage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 4rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.5rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.description {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s;
}

.feature-card:not(.disabled):hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, 0.5);
}

.feature-card.disabled {
    opacity: 0.5;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.feature-card p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.3);
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== UPLOAD POPUP (SLIDE-IN) ===== */
.upload-popup {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: top 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.upload-popup.active {
    top: 0;
}

.popup-content {
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 16px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
    animation: popupBounce 0.6s ease-out 0.6s both;
}

@keyframes popupBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.popup-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #60a5fa;
}

.popup-description {
    color: #cbd5e1;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.upload-zone {
    border: 3px dashed rgba(96, 165, 250, 0.5);
    border-radius: 12px;
    padding: 3rem 2rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.05);
}

.upload-zone.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-hint {
    color: #94a3b8;
    margin: 1rem 0;
}

.btn-upload {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-upload:hover {
    transform: scale(1.05);
}

.file-types {
    color: #64748b;
    font-size: 0.9rem;
}

/* ===== IMAGEPREP INTERFACE ===== */
.imageprep-container {
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

/* Step Navigation */
.step-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.step {
    padding: 0.75rem 1.5rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.step:hover {
    border-color: rgba(96, 165, 250, 0.5);
}

.step.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
}

/* Work Area */
.work-area {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 0fr;
    gap: 0;
    padding: 1rem;
    overflow: hidden;
    max-height: calc(100vh - 160px);
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.work-area.sidebar-open {
    grid-template-columns: 1fr 320px;
    gap: 1rem;
}

/* Sidebars */
.sidebar {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    max-height: 100%;
}

.right-sidebar {
    height: 100%;
}

/* Accordion Styles */
.accordion-section {
    margin-bottom: 0.5rem;
}

.accordion-header {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.accordion-header.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    color: #60a5fa;
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 0.7rem;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0;
}

.accordion-content.active {
    max-height: 400px;
    padding: 0.75rem 0.5rem;
}

.accordion-content p {
    margin: 0.5rem 0;
}

.reset-all-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #f87171;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.sidebar h3 {
    font-size: 0.9rem;
    color: #60a5fa;
    margin: 1.5rem 0 1rem 0;
    letter-spacing: 1px;
}

.sidebar h3:first-child {
    margin-top: 0;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.sidebar-section select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.action-btn {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.action-btn.reset {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.action-btn.reset:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Sliders */
.slider-control {
    margin-bottom: 1rem;
}

.slider-control label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.slider-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #60a5fa;
    border-radius: 50%;
    cursor: pointer;
}

/* Image Area */
.image-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: 100%;
    width: 100%;
}

.image-panel {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.image-panel h4 {
    margin-bottom: 0.75rem;
    color: #60a5fa;
    text-align: center;
    font-size: 0.95rem;
}

.image-container {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    min-width: 0;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    min-width: 50%;
    min-height: 50%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

#originalImage img,
#editedImage img {
    max-width: 100%;
    max-height: 100%;
    min-width: 50%;
    min-height: 50%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.placeholder {
    color: #64748b;
    font-style: italic;
    font-size: 0.9rem;
}

/* Bottom Panel */
.bottom-panel {
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-section {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.dither-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dither-section strong {
    color: #60a5fa;
    margin-right: 0.5rem;
}

.dither-btn {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    color: #60a5fa;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.dither-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

.dither-btn.active {
    background: #3b82f6;
    color: white;
    border-color: transparent;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* ===== CROP POPUP ===== */
.crop-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.crop-popup.active {
    display: flex;
}

.crop-popup-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    width: 1200px;
    display: flex;
    flex-direction: column;
}

.crop-popup-content h2 {
    color: #60a5fa;
    margin-bottom: 1.5rem;
    text-align: center;
}

.crop-workspace {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    flex: 1;
    overflow: hidden;
    min-height: 500px;
}

.crop-canvas-scroll-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.crop-canvas-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
}

#cropCanvas {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #60a5fa;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    pointer-events: all;
    transition: border-radius 0.2s;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #60a5fa;
    border: 2px solid #1e293b;
    border-radius: 50%;
    pointer-events: all;
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.crop-handle.e { top: 50%; right: -6px; transform: translateY(-50%); cursor: ew-resize; }
.crop-handle.w { top: 50%; left: -6px; transform: translateY(-50%); cursor: ew-resize; }

.crop-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    padding: 1rem;
}

.crop-measurements h4,
.crop-options h4 {
    color: #60a5fa;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.crop-measurements {
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
}

.crop-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.unit-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.unit-btn {
    flex: 1;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #94a3b8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.unit-btn.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: #60a5fa;
    color: #60a5fa;
}

.dimension-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.dimension-input input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #e2e8f0;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.square-crop-toggle {
    margin-bottom: 0;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
}

.round-edges-control {
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

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

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

input[type="checkbox"]:checked + .toggle-slider {
    background: rgba(59, 130, 246, 0.3);
    border-color: #60a5fa;
}

input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: #60a5fa;
}

input[type="checkbox"] {
    display: none;
}

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

.round-edges-control input[type="range"] {
    width: 100%;
    margin: 1rem 0;
}

.round-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

#roundEdgesValue {
    color: #60a5fa;
    font-weight: 700;
    font-size: 1.1rem;
}

#roundEdgesLabel {
    font-style: italic;
}

.crop-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid #60a5fa;
    color: #60a5fa;
}

.btn-primary:hover {
    background: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.4);
}

/* ===== RESIZE POPUP ===== */
.resize-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.resize-popup.active {
    display: flex;
}

.resize-popup-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.resize-popup-content h2 {
    color: #60a5fa;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.25rem;
}

.resize-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tooltip-icon {
    cursor: help;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.resize-select {
    width: 100%;
    padding: 0.6rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}

.resize-select:focus {
    outline: none;
    border-color: #60a5fa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: start;
}

.input-with-unit {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-unit input[type="number"] {
    width: 90px;
    padding: 0.6rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
}

.input-with-unit input[type="number"]:focus {
    outline: none;
    border-color: #60a5fa;
}

.input-unit-label {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 30px;
}

.form-group input[type="number"]:not(.input-with-unit input) {
    width: 100%;
    padding: 0.6rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    box-sizing: border-box;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: #60a5fa;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 4px;
    transition: background 0.3s;
}

.checkbox-label:hover {
    background: rgba(30, 41, 59, 0.8);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #60a5fa;
}

.checkbox-label span {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Toggle Switch */
.toggle-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.toggle-switch-label:hover {
    background: rgba(30, 41, 59, 0.8);
}

.toggle-switch-label > span {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.3);
    transition: 0.3s;
    border-radius: 26px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(96, 165, 250, 0.3);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #60a5fa;
}

.recommended-dpi-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.recommended-dpi-row input {
    flex: 1;
}

.btn-use-recommended {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-use-recommended:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.3);
    border-color: #60a5fa;
}

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

.help-text {
    color: #94a3b8;
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.resize-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.resize-actions button {
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ===== DPI CALCULATOR SECTION ===== */
.dpi-calculator-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(96, 165, 250, 0.2);
}

.section-heading {
    color: #60a5fa;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-results {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.calc-results.hidden {
    display: none;
}

.calc-error {
    color: #f87171;
}

.calc-error.hidden,
.calc-success.hidden {
    display: none;
}

.error-message {
    color: #f87171;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.alternatives {
    margin-top: 0.75rem;
}

.alternatives strong {
    color: #f87171;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.5rem;
}

.alternative {
    background: rgba(96, 165, 250, 0.1);
    padding: 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.alternative strong {
    color: #60a5fa;
    font-size: 0.95rem;
}

.alternative span {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Top row: MAX DPI and Material Max */
.calc-metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.calc-metric {
    background: rgba(30, 41, 59, 0.8);
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    min-width: 0;
}

.metric-label {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.metric-value {
    color: #60a5fa;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Bottom row: Recommended DPI (full width) */
.calc-recommended-box {
    background: rgba(30, 41, 59, 0.8);
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 0.75rem;
}

.optimal-range {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

.btn-use-calc {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(96, 165, 250, 0.2) 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    color: #60a5fa;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.btn-use-calc:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(96, 165, 250, 0.3) 100%);
    border-color: #60a5fa;
    transform: translateY(-1px);
}

.calc-reason {
    background: rgba(15, 23, 42, 0.6);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.calc-reason strong {
    color: #60a5fa;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.5rem;
}

.calc-reason p {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .work-area {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .image-area {
        grid-template-columns: 1fr;
    }
    
    .step-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .step {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ===== ADJUSTMENTS SIDEBAR (ACCORDION STYLE - PUSHES CONTENT) ===== */
.adjustments-sidebar-accordion {
    width: 0;
    opacity: 0;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100%;
}

.adjustments-sidebar-accordion.active {
    width: 320px;
    opacity: 1;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-header h3 {
    margin: 0;
    color: #60a5fa;
    font-size: 1.1rem;
    white-space: nowrap;
}

.sidebar-close {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-close:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #fff;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Accordion Sections */
.accordion-section {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

/* Special Prominent Auto Enhance Section */
.auto-enhance-special {
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
}

.auto-enhance-header {
    background: rgba(30, 41, 59, 0.9) !important; /* Dark UI color */
    color: white !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 25px !important; /* Pill shape */
    margin: 0 !important;
    border: 2px solid #60a5fa !important; /* Bright blue border */
    box-shadow: 0 4px 20px rgba(96, 165, 250, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    justify-content: center !important;
}

.auto-enhance-header:hover {
    background: rgba(30, 41, 59, 1) !important; /* Slightly darker on hover */
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: #3b82f6 !important; /* Brighter blue border on hover */
    color: white !important;
}

.auto-enhance-header.active {
    background: rgba(30, 41, 59, 0.95) !important;
    color: white !important;
    border-radius: 25px 25px 12px 12px !important;
    box-shadow: 0 4px 16px rgba(96, 165, 250, 0.5);
    border-color: #60a5fa !important;
}

.enhance-icon {
    font-size: 1.4rem;
    margin-right: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(96, 165, 250, 0.6)); /* Blue glow on icon */
}

/* Regular Accordion Headers */.accordion-header {
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    text-align: left;
}

.accordion-header:hover {
    background: rgba(148, 163, 184, 0.05);
    color: #60a5fa;
}

.accordion-header.active {
    color: #60a5fa;
    background: rgba(99, 102, 241, 0.1);
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.3);
}

.accordion-content.active {
    max-height: 500px;
}

/* Slider Controls Inside Accordion */
.accordion-content .slider-control {
    padding: 1rem;
}

.accordion-content .slider-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.slider-value {
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 45px;
    text-align: center;
}

.accordion-content input[type="range"] {
    width: 100%;
    height: 6px;
    background: #2d3142;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.accordion-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #6366f1;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: all 0.2s;
}

.accordion-content input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
}

.accordion-content input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #6366f1;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: all 0.2s;
}

.accordion-content input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
}

/* Checkbox Options (for Auto Enhance) */
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.checkbox-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6366f1;
}

/* Action Button (for Auto Enhance Apply) */
.action-btn {
    width: calc(100% - 2rem);
    margin: 0.5rem 1rem 1rem 1rem;
    padding: 0.75rem;
    background: #6366f1;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

/* Auto Results Display */
.auto-results {
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    border-left: 3px solid #6366f1;
}

.auto-results small {
    color: #a5b4fc;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Reset All Button */
.reset-all-btn {
    margin: 1rem;
    padding: 0.75rem;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #cbd5e1;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: calc(100% - 2rem);
}

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

