/* ==========================================================================
   1. CORE DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-gradient: radial-gradient(circle at 50% -20%, #1e1b4b, #0f172a 60%, #020617);
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.12);
  
  --accent-purple: #818cf8;
  --accent-pink: #c084fc;
  --accent-glow: rgba(129, 140, 248, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  --radius-xl: 24px;
  --radius-md: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body{
   background: var(--bg-gradient);   
}
.body {
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glow Orbs */
.ambient-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
.glow-1 { top: 10%; left: 15%; background: rgba(99, 102, 241, 0.15); }
.glow-2 { bottom: 10%; right: 15%; background: rgba(192, 132, 252, 0.12); }

.container {
  width: 100%;
  max-width: 800px;
  z-index: 1;
}

/* ==========================================================================
   2. MAIN CARD CONTAINER
   ========================================================================== */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
              0 0 40px var(--accent-glow);
  transition: var(--transition-smooth);
  max-width: 90vw;
}

.card:hover {
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6),
              0 0 50px rgba(129, 140, 248, 0.35);
}

/* Headline & Text */
.card-title {
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
}

.card-title .highlight {
  font-size: 1.55rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   3. STUDIO ACTION SELECTOR TABS
   ========================================================================== */
.studio-actions-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.action-tab {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-tab:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-tab.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: #6366f1;
}

/* ==========================================================================
   4. FORMAT CONVERSION BADGES (FROM -> TO)
   ========================================================================== */
.format-badge-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.8rem;
}

.format-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.highlight-badge {
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.1);
}

.badge-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-select {
  background: transparent;
  border: none;
  color: #c084fc;
  font-size: 0.95rem;
  font-weight: 800;
  outline: none;
  cursor: pointer;
}

.badge-select option {
  background: #0f172a;
  color: var(--text-primary);
}

.badge-arrow {
  color: var(--accent-purple);
  font-size: 1.2rem;
  font-weight: 800;
}

/* ==========================================================================
   5. MODE TOGGLE BAR (FILES vs FOLDER)
   ========================================================================== */
.mode-toggle-bar {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.5rem;
  gap: 6px;
}

.toggle-btnn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-btnn:hover {
  color: var(--text-primary);
}

.toggle-btnn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ==========================================================================
   6. UPLOAD ZONES
   ========================================================================== */
.upload-zone {
  display: block;
  border: 2px dashed rgba(129, 140, 248, 0.3);
  border-radius: 18px;
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.3);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-purple);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  transition: var(--transition-smooth);
  filter: drop-shadow(0 4px 12px rgba(129, 140, 248, 0.3));
}

.upload-zone:hover .upload-icon {
  transform: translateY(-6px) scale(1.1);
}

#upload-prompt-files, #upload-prompt-folder {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-zone input[type="file"] {
  display: none;
}

.supportParag{
    color: green;
    font-size: small;
}

/* ==========================================================================
   THEMED EDITOR VIEW CONTAINER
   ========================================================================== */
.editor-container {
    width: 100%;
    background-color: #121213;
    color: #f8f8fc;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
}

.editor-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
}

/* Transitions */
#card, #editorContainer {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.card-hidden {
    opacity: 0 !important;
    transform: translateY(12px);
    pointer-events: none;
}

.card-visible {
    opacity: 1 !important;
    transform: translateY(0);
}   

/* ==========================================================================
   LEFT PANEL: VISUAL WORKSPACE STAGE
   ========================================================================== */
.editor-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0b0b0e;
    min-width: 0;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background-color: #111114;
    border-bottom: 1px solid #34343a;
}

.file-counter {
    word-break: break-all;
    font-size: 0.85rem;
}

.stage-viewport {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
     padding: 40px;
    background: radial-gradient(circle, #252529 0%, #161619 100%);
    overflow: hidden;
}

.editor-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

#previewImage {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    max-height: 60vh;

}

/* ==========================================================================
   INTERACTIVE WATERMARK BOX & GRAB HANDLES
   ========================================================================== */
#watermarkBox {
    position: absolute;
    cursor: grab;
    user-select: none; 
    touch-action: none; 
}

.watermark-transform-box {
    position: absolute;
    top: 15%;
    left: 15%;
    min-width: 60px;
    min-height: 40px;
    border: 2px dashed #007bff; 
    background: rgba(0, 123, 255, 0.05); 
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.watermark-transform-box:active {
    cursor: grabbing;
}

.watermark-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
    user-select: none;
    pointer-events: none;
}

#watermarkLogoNode {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border: 2px solid #007bff;
    border-radius: 50%;
    box-sizing: border-box;
    z-index: 10;
}

.handle:hover {
    transform: scale(1.3);
}

.top-left { top: -6px; left: -6px; cursor: nwse-resize; }
.top-right { top: -6px; right: -6px; cursor: nesw-resize; }
.bottom-left { bottom: -6px; left: -6px; cursor: nesw-resize; }
.bottom-right { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* ==========================================================================
   RIGHT PANEL: PROPERTY CONTROLLERS
   ========================================================================== */
.editor-sidebar {
    width: 360px;
        border-top: none;
        border-left: 1px solid #34343a;
        padding: 24px;
        max-height: 85vh;
        overflow-y: auto;
}

.control-card {
    background-color: #26262b;
    border: 1px solid #34343a;
    border-radius: 8px;
    padding: 16px;
}

.control-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 16px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #f3f4f6;
}

.form-control {
    width: 100%;
    background-color: #0b0b0e;
    border: 1px solid #34343a;
    border-radius: 4px;
    color: #f3f4f6;
    padding: 8px 12px;
    font-size: 0.88rem;
    outline: none;
}

.form-control:focus {
    border-color: #00c3ff;
}

.form-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
}

/* ==========================================================================
   CUSTOM RANGE SLIDERS & SWATCHES
   ========================================================================== */
.form-range {
    width: 100%;
    height: 5px;
    background: #0b0b0e;
    border-radius: 4px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #00c3ff;
    cursor: pointer;
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid #34343a;
    border-radius: 4px;
}

/* ==========================================================================
   TAB SWITCHING INTERACTIVE PILLS
   ========================================================================== */
.toggle-group {
    display: flex;
    background-color: #0b0b0e;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #34343a;
    margin-bottom: 16px;
}

.toggle-btn {
    flex: 1;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.toggle-btn.active {
    background-color: #26262b;
    color: #f3f4f6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mode-config-wrapper {
    display: none;
}

.mode-config-wrapper.active {
    display: block;
}

/* ==========================================================================
   SIDEBAR ACTION & EXECUTION BUTTONS
   ========================================================================== */
.execution-card {
    margin-top: auto;
}

.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; border-radius: 4px; }
.btn-lg { padding: 14px 20px; font-size: 0.9rem; }

.btn-danger { 
    background-color: rgba(239, 68, 68, 0.12); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.2); 
}
.btn-danger:hover { background-color: #ef4444; color: #ffffff; }

.btn-success { background-color: #10b981; color: #ffffff; }
.btn-success:hover { background-color: #059669; }

/* Container styling */
.form-group-log {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Main upload button styling */
.custom-file-upload-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px;
    padding: 12px 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    text-align: center;
}

.custom-file-upload-logo input[type="file"] {
    display: none;
}

.custom-file-upload-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.custom-file-upload-logo:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
}

.custom-file-upload-logo:focus-within {
    outline: 3px solid #a5b4fc;
    outline-offset: 2px;
}

/* Dimension Inputs & Select */
.form-select-custom {
    width: 100%;
    padding: 8px 12px;
    background-color: #222;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.form-select-custom optgroup {
    background-color: #111;
    color: #007bff;
    font-weight: bold;
}

.form-select-custom option {
    background-color: #222;
    color: #fff;
}

.dimension-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    display: flex;
    gap: 10px;
    
}

.dimension-inputs input {
    max-width: 90px;
    background-color: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 6px;
    border-radius: 4px;
    text-align: center;
}

/* Cropper Close Button */
.cropper-close-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background-color: #ff4d4d;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cropper-close-btn:hover {
    background-color: #cc0000;
    transform: scale(1.1);
}

/* =============================================================
   PROCESSING PROGRESS BAR STYLES
   ============================================================= */
#processingProgressWrapper {
    width: 100%;
    margin-top: 15px;
    padding: 12px 16px;
    background-color: #1b1b1b;
    border: 1px solid #1b1b1b;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

#progressPercentage {
    color: #2196F3; 
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

#progressBarFill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #00BCD4); 
    border-radius: 20px;
    transition: width 0.3s ease-in-out; 
}

.progress-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

#progressCount {
    font-weight: 500;
}

.completed-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 14px 18px;
    background-color: #e8f5e9; 
    border: 1px solid #c8e6c9;
    border-left: 5px solid #2e7d32; 
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.4s ease-in-out;
}

.completed-icon {
    width: 28px;
    height: 28px;
    background-color: #2e7d32;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.completed-content h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1b5e20;
}

.completed-content p {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: #388e3c;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================
   🖼️ COMPARISON DASHBOARD STYLES
   ============================================================= */
.comparison-card {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
    background: #0f172a; 
    border-radius: 16px;
    border: 1px solid #1e293b;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #f8fafc;
}

.top-bar-section {
    min-height: 80px;
    background-color: #1e293b;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.topsectiondata {
    display: flex;
    justify-content: center;
    min-height: 80px;
    background-color: #1e293b;
    padding: 10px 20px;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.bar-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #f4f6f8;
    text-align: center;
}

.step-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    
}

.step-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #475569;
    background-color: #0f172a;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-btn:hover {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.step-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.bottom-content-section {
    display: flex;
    flex-direction: row;
    width: 100%;
    
}

.column-panel {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.left-panel {
    border-bottom: none;
    border-right: 1px solid #1e293b;
}

.right-panel {
    background-color: #111827;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.original-badge {
    background-color: #334155;
    color: #cbd5e1;
}

.processed-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.savings-pill {
    font-size: 12px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.image-preview-wrapper {
    width: 100%;
    height: 200px;
    background-color: #020617;
    border: 1px solid #1e293b;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-details-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.detail-label {
    color: #94a3b8;
    font-weight: 500;
}

.detail-value {
    color: #f1f5f9;
    font-weight: 600;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.highlight-green {
    color: #34d399;
    font-weight: 700;
}

.download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    width: auto;
    max-width: 380px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}


/* Container styling */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 32px; /* Space for the custom box */
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    user-select: none;
    transition: color 0.2s ease;
}

/* Hover state for label text */
.checkbox-container:hover {
    color: #ffffff;
}

/* Hide native HTML checkbox completely */
.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* The custom checkbox base frame */
.custom-checkbox {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #1a1a1e;
    border: 1.5px solid #3f3f46;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Hover glow effect when unchecked */
.checkbox-container:hover .custom-checkbox {
    border-color: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

/* Checked state */
.checkbox-container input:checked ~ .custom-checkbox {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #6366f1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* The checkmark indicator (hidden by default) */
.custom-checkbox::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.15s ease;
}

/* Show and animate checkmark when checked */
.checkbox-container input:checked ~ .custom-checkbox::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

/* Subtle pulse animation on click */
.checkbox-container:active .custom-checkbox {
    transform: translateY(-50%) scale(0.92);
}

/* ==========================================================================
   DESKTOP RESPONSIVE BREAKPOINTS (850px and above)
   ========================================================================== */
@media (max-width: 800px) {
    body {
        padding: 20px 12px;
    }

    .card {
        padding: 20px;
    }

    .card-title .highlight {
        font-size: 1.8rem;
    }

    .editor-layout {
        flex-direction: column;
    }

    /* UPDATED: Sidebar now places cards side-by-side */
    .editor-sidebar {
        display: flex;
        flex-direction: row; /* Horizontal layout for the 2 cards */
        width: 100%;
        background-color: #111114;
        border-top: 1px solid #34343a;
        padding: 18px;
        gap: 16px;
        align-items: flex-start; /* Keeps cards top-aligned */
    }

    /* ADDED: Forces the two control cards to split the row evenly */
    .editor-sidebar .control-card {
        flex: 1; 
        min-width: 0; /* Prevents layout overflowing on smaller screens */
    }

    .stage-viewport {
        padding: 20px;
    }

    #previewImage {
        max-height: 50vh;
    }

    .bottom-content-section {
        flex-direction: column;
    }

    .left-panel {
        border-bottom: 1px solid #1e293b;
        background-color: #0f172a;
    }

    .top-bar-section {
        flex-direction: column;
    }

    .step-buttons {
        margin-top: 10px;
        margin-left: 0px;
    }

    .dimension-inputs {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Arranges dimensions 2x2 on mobile */
        gap: 10px;
    }

    .dimension-inputs input {
        width: 100%;
    }

    .download-btn {
        width: 100%;
    }
}
@media (max-width: 800px) {

    /* Keep the bottom comparison section side-by-side */
    .bottom-content-section {
        display: flex;
        flex-direction: row; /* Forces side-by-side layout */
        gap: 12px;           /* Space between left and right panel */
        width: 100%;
        align-items: stretch;
    }

    /* Force both panels to share the space evenly (50% each) */
    .bottom-content-section .column-panel {
        flex: 1;
        min-width: 0;        /* Prevents long filenames from breaking the 50/50 layout */
    }

    /* Prevent text overflow in file details */
    .detail-value {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Make images responsive inside smaller side-by-side boxes */
    .image-preview-wrapper img.preview-img {
        width: 100%;
        height: auto;
        max-height: 200px;  /* Limits image height so cards stay compact */
        object-fit: cover;
        border-radius: 6px;
    }

    /* Stack metadata fields neatly if space gets tight inside each card */
    .image-details-card {
        padding: 10px;
        font-size: 0.85rem;
    }
}