/* Image Compressor 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;
}

/* Compression Range Slider */
#compressionSlider {
    -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;
}

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

#compressionSlider::-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;
}

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

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

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

#compressionSlider::-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;
}

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

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

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

#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 */
.badg {
    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 compress 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-6 {
        margin-bottom: 1rem;
    }
}

/* Compression specific styles */
.compression-info {
    background-color: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.compression-info h6 {
    color: #155724;
    margin-bottom: 0.5rem;
}

.compression-info p {
    color: #155724;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* File size comparison */
.file-size-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.file-size-original {
    color: #6c757d;
    font-size: 0.9rem;
}

.file-size-compressed {
    color: #28a745;
    font-size: 0.9rem;
    font-weight: 600;
}

.file-size-reduction {
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Compression level indicator */
.compression-level-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.compression-level-low {
    background-color: #28a745;
}

.compression-level-medium {
    background-color: #ffc107;
}

.compression-level-high {
    background-color: #dc3545;
}

/* Progress bar for compression */
.compression-progress {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.compression-progress-bar {
    height: 100%;
    background-color: #007bff;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Compression settings card */
.compression-settings-card {
    border-left: 4px solid #007bff;
}

.compression-settings-card .card-header {
    background-color: #f8f9ff;
    border-bottom: 1px solid #e3f2fd;
}

/* Advanced settings card */
.advanced-settings-card {
    border-left: 4px solid #6c757d;
}

.advanced-settings-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
