/* Isolated styles for the Image Tools Suite */

.image-tools-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Before / After Image Comparison Slider */
.image-compare-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    user-select: none;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: #f1f5f9;
    box-shadow: var(--shadow-md);
}

.image-compare-before {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.image-compare-after-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 2px solid #ffffff;
}

.image-compare-after {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.image-compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    top: calc(50% - 20px);
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 3px solid #ffffff;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.image-compare-handle:hover, .image-compare-handle:active {
    background-color: var(--primary-hover);
    transform: scale(1.1);
}

/* Custom Interactive Photo Canvas Workspace */
.editor-workspace-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 1;
    background-color: var(--border-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.editor-canvas-el {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.editor-canvas-el:active {
    cursor: grabbing;
}

/* Circular safe area overlay for WhatsApp DP Maker */
.whatsapp-dp-safe-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 150px solid rgba(15, 23, 42, 0.4);
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
}

/* Passport Editor Overlays */
.passport-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 10px solid rgba(15, 23, 42, 0.3);
    pointer-events: none;
    box-sizing: border-box;
}

.passport-face-oval {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 55%;
    border: 2px dashed #f43f5e;
    border-radius: 50%;
    pointer-events: none;
}

.passport-eye-line {
    position: absolute;
    top: 42%;
    left: 10%;
    width: 80%;
    height: 1px;
    border-top: 1px dashed var(--primary);
    pointer-events: none;
}

/* Grid lines for Instagram Grid Slicer */
.instagram-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: grid;
}

.instagram-grid-overlay.grid-3x3 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.instagram-grid-overlay.grid-3x2 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.instagram-grid-overlay.grid-2x3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.instagram-grid-cell {
    border: 1px dashed #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Background Color Selection Chips */
.color-picker-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1.5px var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-chip:hover {
    transform: scale(1.1);
}

.color-chip.active {
    box-shadow: 0 0 0 2px var(--primary);
    transform: scale(1.05);
}

/* Image Tool Dashboard Layout Adjustments */
.before-after-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

/* Queue List Container for PDF utilities */
.pdf-queue-list {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.pdf-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.pdf-queue-item:last-child {
    border-bottom: none;
}

.pdf-queue-thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-right: 12px;
}

/* Custom Progress Bar for Async Slicing or Compiling operations */
.progress-bar-custom {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar-fill-custom {
    width: 0%;
    height: 100%;
    background-color: var(--primary);
    transition: width 0.15s ease;
}

/* Double column workspace styling overrides */
.img-tool-workspace {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

/* Live size metrics widget display */
.live-size-badge-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}

/* Keyboard Accessible Controls Panel */
.accessibility-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.accessibility-controls button {
    font-size: 12px;
    padding: 5px 2px;
}

/* Accessibility Focus States for dropzones and controls */
.upload-zone:focus-visible,
.image-compare-handle:focus-visible,
.btn-check:focus-visible + label,
.form-check-input:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid var(--primary) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important;
}

/* Custom Range Slider Styling to match branding and eliminate browser-default blue track/thumb */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type="range"]:focus {
    outline: none;
}

/* Webkit (Chrome, Safari, Opera, Edge) */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]::-webkit-slider-thumb:active {
    background: var(--primary-hover);
    transform: scale(1.15);
}

/* Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

input[type="range"]::-moz-range-thumb:hover,
input[type="range"]::-moz-range-thumb:active {
    background: var(--primary-hover);
    transform: scale(1.15);
}

/* Touch hit optimization for sliders and mobile touch usability */
@media (max-width: 768px) {
    .image-compare-handle {
        width: 48px !important;
        height: 48px !important;
        margin-left: -24px !important;
        top: calc(50% - 24px) !important;
        font-size: 22px !important;
    }
    
    .color-chip {
        width: 44px !important;
        height: 44px !important;
    }
    
    .accessibility-controls button {
        min-height: 44px !important;
        font-size: 14px !important;
    }
    
    .btn-group .btn {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .upload-zone {
        padding: 40px 15px !important;
    }
    
    .btn {
        min-height: 44px;
    }
}

/* ==========================================================================
   HOMEPAGE BRANDING & COMPACT VISUAL NORMALIZATION (TOOLFORYOU.IN PARITY)
   ========================================================================== */

/* Restore light page background and typography scale globally */
body {
    background-color: var(--bg-main) !important;
    color: var(--text-dark) !important;
}

/* Typography Scale & Hierarchy Normalization */
.image-tools-container header {
    margin-bottom: 24px !important;
    text-align: center !important;
}

.image-tools-container header h1 {
    font-size: 28px !important; /* Standard fs-3 equivalent matching other tools */
    font-weight: 700 !important;
    color: var(--text-dark) !important;
    margin-bottom: 8px !important;
}

.image-tools-container header p {
    font-size: 15px !important;
    color: var(--text-muted) !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    line-height: 1.5 !important;
}

/* Compact White Cards with soft shadows matching homepage category-card */
.img-tool-workspace {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 20px !important; /* Compact padding */
    margin-bottom: 20px !important;
    overflow: hidden !important;
}

/* Transform Settings Headings dynamically into Navy Category Headers */
.img-tool-workspace h2 {
    background-color: var(--bg-card-header) !important;
    color: #ffffff !important;
    margin: -20px -20px 20px -20px !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 11px 11px 0 0 !important;
    display: flex !important;
    align-items: center !important;
}

.img-tool-workspace h2 i {
    color: #ffffff !important;
    margin-right: 10px !important;
}

/* Compact Drag & Drop Upload Zone Overrides */
.upload-zone {
    padding: 24px 16px !important;
    border-radius: 8px !important;
    border: 2px dashed var(--border-color) !important;
    background-color: #ffffff !important;
    min-height: auto !important;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary) !important;
    background-color: #f8fafc !important;
}

.upload-icon {
    font-size: 32px !important;
    margin-bottom: 8px !important;
    color: var(--primary) !important;
}

.upload-zone p {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    color: var(--text-dark) !important;
}

.upload-zone span, 
.upload-zone .text-muted {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.upload-zone button {
    margin-top: 12px !important;
    padding: 6px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* Mobile responsive padding and sizing tune-ups */
@media (max-width: 768px) {
    .img-tool-workspace {
        padding: 16px !important;
    }
    .img-tool-workspace h2 {
        margin: -16px -16px 16px -16px !important;
        padding: 12px 16px !important;
        font-size: 15px !important;
    }
    .upload-zone {
        padding: 20px 12px !important;
    }
}

