/* Image Resizer Tool - Custom Styles */

/* Remove input validation borders */
.toolInput:invalid,
.toolInput:valid {
    border-color: #ced4da !important;
    box-shadow: none !important;
}

.toolInput:focus {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Scale Range Slider */
#scaleSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #e9ecef 0%, #e9ecef 100%);
    outline: none;
    border-radius: 4px;
    margin: 15px 0;
    position: relative;
}

/* Scale Slider WebKit */
#scaleSlider::-webkit-slider-track {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(to right, #e9ecef 0%, #e9ecef 100%);
    border-radius: 4px;
    border: none;
}

#scaleSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #052c65;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(5, 44, 101, 0.3);
    position: relative;
    top: -8px;
    transition: all 0.2s ease;
}

#scaleSlider::-webkit-slider-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 44, 101, 0.4);
}

#scaleSlider::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(5, 44, 101, 0.5);
}

/* Scale Slider Firefox */
#scaleSlider::-moz-range-track {
    height: 8px;
    background: linear-gradient(to right, #e9ecef 0%, #e9ecef 100%);
    border-radius: 4px;
    border: none;
}

#scaleSlider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #052c65;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(5, 44, 101, 0.3);
    transition: all 0.2s ease;
}

#scaleSlider::-moz-range-thumb:hover {
    background: #041f4a;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 44, 101, 0.4);
}

#scaleSlider::-moz-range-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(5, 44, 101, 0.5);
}

/* Scale percentage labels - prevent text selection */
#scaleSliderContainer .text-muted {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* Quality Range Slider - Exact same style as Scale Slider */
#quality {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e9ecef;
    outline: none;
    border-radius: 3px;
    margin: 10px 0;
    cursor: pointer;
}

/* Quality percentage labels - prevent text selection */
#quality + .d-flex .text-muted {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

#quality::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #052c65;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#quality::-webkit-slider-thumb:hover {
    background: #031d4a;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#quality::-webkit-slider-thumb:active {
    background: #021433;
    transform: scale(1.2);
}

#quality::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #052c65;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#quality::-moz-range-thumb:hover {
    background: #031d4a;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#quality::-moz-range-thumb:active {
    background: #021433;
    transform: scale(1.2);
}

#imageInput {
    position: relative;
    transition: all 0.3s ease;
}

/* Cursor pointers for interactive elements */
.form-check-input {
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
}

.btn {
    cursor: pointer;
}

.toolBtn {
    cursor: pointer;
}

/* Prevent text selection on badges and labels */
.badge {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

.form-label {
    cursor: default;
}

/* Input group text - prevent selection */
.input-group-text {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* Card headers - prevent selection */
.card-header h5 {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* Text colors - Light mode default */

/* Dark mode support - Bootstrap theme system */
/* Additional cursor and selection styles */
.form-control {
    cursor: text;
}

.form-control[readonly] {
    cursor: default;
}

.form-select {
    cursor: pointer;
}

.form-range {
    cursor: pointer;
}

input[type="checkbox"], input[type="radio"] {
    cursor: pointer;
}

input[type="file"] {
    cursor: pointer;
}

/* Download button styling - matches convert button exactly */
#downloadLink {
    color: white !important;
    text-decoration: none !important;
}

/* Force show download button when it has href */
#downloadLink[href]:not([href="#"]):not([href=""]) {
    display: inline-block !important;
}

#downloadLink:hover {
    color: white !important;
    text-decoration: none !important;
}

#downloadLink:visited {
    color: white !important;
    text-decoration: none !important;
}

#downloadLink:focus {
    color: white !important;
    text-decoration: none !important;
}

#downloadLink:active {
    color: white !important;
    text-decoration: none !important;
}

/* Override Bootstrap button hover effects completely */
#downloadLink.btn:hover {
    color: white !important;
}

#downloadLink.btn:focus {
    color: white !important;
    box-shadow: none !important;
}

#downloadLink.btn:active {
    color: white !important;
}

#downloadLink.btn:focus-visible {
    color: white !important;
    box-shadow: none !important;
}

/* Prevent selection on small text elements */
small.text-muted {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* Card body text */
.card-body {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Form text help */
.form-text {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

/* Preview image styling */
#originalPreviewImage {
    max-height: 120px;
    max-width: 200px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.15s ease-in-out;
    object-fit: contain;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#previewImage {
    max-height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#originalPreviewImage:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

#previewImage:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

/* Preview container styling */
#previewContainer {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Small original preview container - no background */
#originalPreviewContainer {
    margin-top: 0.75rem;
}

/* Download button styling - now matches resize button */
#downloadLink {
    transition: all 0.15s ease-in-out;
}

#downloadLink:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(25, 135, 84, 0.25);
}

/* Form validation styling */
.toolInput:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.toolInput:valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Error state styling */
.error-state {
    background-color: #fff0f0 !important;
    border-color: #dc3545 !important;
}

/* Loading state styling */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #originalPreviewImage,
    #previewImage {
        max-height: 200px;
    }

    .col-md-4 {
        margin-bottom: 1rem;
    }
}
