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

/* Quality Range 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;
}

/* 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 - matches convert button exactly */
#downloadLink {
    /* Same styling as convert button - no special effects */
    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 {
    /* Same hover as convert button - no special effects */
    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;
}

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

/* Format conversion specific styles */
.conversion-info {
    background-color: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.conversion-info h6 {
    color: #004085;
    margin-bottom: 0.5rem;
}

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

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

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

.format-converted {
    color: #007bff;
    font-size: 0.9rem;
    font-weight: 600;
}

.format-change {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.format-jpeg {
    background-color: #ff6b6b;
}

.format-png {
    background-color: #4ecdc4;
}

.format-webp {
    background-color: #45b7d1;
}

.format-bmp {
    background-color: #96ceb4;
}

.format-gif {
    background-color: #feca57;
}

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

.conversion-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;
}

/* Quality indicator */
.quality-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.quality-low {
    background-color: #dc3545;
}

.quality-medium {
    background-color: #ffc107;
}

.quality-high {
    background-color: #28a745;
}

/* Format support indicator */
.format-support {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.format-supported {
    color: #28a745;
}

.format-limited {
    color: #ffc107;
}

.format-unsupported {
    color: #dc3545;
}
