/* Wrapper */
#resize-tool {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f8f9fa;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}
#resize-tool * { box-sizing: border-box; }

/* Container - INCREASED WIDTH FOR DESKTOP */
.resize-container {
    max-width: 1150px; /* Increased from 600px to 850px */
    margin: 0 auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Header */
.resize-header-strip {
    background: #2563eb;
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 18px;
    text-align: center;
}

.resize-box { padding: 30px; }

/* Upload Area */
.upload-area {
    display: block;
    border: 2px dashed #2563eb;
    background: #eff6ff;
    padding: 40px 10px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 30px;
    transition: 0.2s;
}
.upload-area:active { background: #dbeafe; }
.upload-icon { font-size: 45px; color: #2563eb; margin-bottom: 15px; }
.upload-area p { margin: 0; font-weight: bold; font-size: 18px; color: #333; }

/* Preview */
.preview-box {
    text-align: center;
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 30px;
}
#preview-img {
    max-width: 100%;
    max-height: 250px;
    border: 1px solid #ccc;
    display: block;
    margin: 0 auto;
}

/* Disabled Area */
.disabled-area { opacity: 0.4; pointer-events: none; }
.enabled-area { opacity: 1; pointer-events: auto; }

/* SETTINGS GRID */
.settings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

/* Input Groups */
.set-group {
    flex: 1;
    min-width: 200px; /* Ensures 3 items per row on large screens */
}

/* Full Width Force */
.full-width {
    flex: 100%; /* Forces full width line */
    min-width: 100%;
}

.set-group label { display: block; font-size: 14px; font-weight: bold; margin-bottom: 8px; color:#444; }
.set-group input[type="number"], .set-group select {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size:15px;
}

/* Checkbox Row */
.checkbox-row { margin-top: -10px; margin-bottom: 10px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; }
.checkbox-group label { margin: 0; cursor: pointer; }
.checkbox-group input { width: 18px; height: 18px; cursor: pointer; }

/* Slider Styling (Updated for Color Fill) */
.slider-row {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

input[type=range] {
    -webkit-appearance: none; /* Remove default style */
    width: 100%;
    height: 8px;
    background: #e5e7eb; /* Light Gray Track (Empty part) */
    border-radius: 5px;
    cursor: pointer;
    outline: none;
    
    /* Magic Trick for Blue Fill */
    background-image: linear-gradient(#2563eb, #2563eb);
    background-size: 90% 100%; /* This will be updated by JS */
    background-repeat: no-repeat;
}

/* Chrome/Safari Thumb */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #2563eb; /* Blue Thumb */
    border: 3px solid #fff; /* White Border ring */
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Firefox Thumb */
input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    cursor: pointer;
}
/* Button */
.action-btn {
    width: 100%;
    padding: 18px;
    background: #888;
    color: white;
    border: none;
    font-size: 20px;
    font-weight: bold;
    border-radius: 6px;
    text-transform: uppercase;
}
.btn-ready {
    background: #16a34a !important;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.3);
}

/* Success Msg */
#success-msg {
    margin-top: 20px; padding: 15px; background: #dcfce7; color: #166534;
    border: 1px solid #86efac; text-align: center; border-radius: 5px; font-weight: bold;
}

/* MOBILE FIX */
@media (max-width: 768px) {
    #resize-tool {
        width: 100vw !important; margin-left: -50vw !important; margin-right: -50vw !important; 
        position: relative; left: 50%; right: 50%; padding: 15px 0 !important;
    }
    .resize-container { border: none; border-radius: 0; box-shadow: none; }
    .set-group { min-width: 45%; } /* 2 per row on mobile for inputs */
    #dpi_input { min-width: 100%; } /* DPI full width on small mobile if needed */
}