/* Adjust Saturation & Hue 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;
}

/* Hue Slider - Rainbow gradient */
.hue-slider {
    background: linear-gradient(to right,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%);
    height: 8px;
    border-radius: 4px;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #052c65;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hue-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #052c65;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Preset buttons */
.preset-btn {
    transition: all 0.2s ease;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .preset-btn {
    border-color: #495057;
    color: #adb5bd;
}

[data-bs-theme="dark"] .preset-btn:hover {
    background-color: #052c65;
    border-color: #052c65;
    color: white;
}

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

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

[data-bs-theme="dark"] #originalPreviewImage {
    border-color: #495057;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] #originalPreviewImage:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.6);
}

/* Canvas styling */
canvas {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    user-select: none;
}

/* Preview boxes */
.preview-box {
    position: relative;
}

.preview-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.95rem;
}

[data-bs-theme="dark"] .preview-label {
    color: #e9ecef;
}

/* Auto-resize textarea */
.auto-resize-textarea {
    overflow: hidden;
    resize: none;
    min-height: 38px;
    transition: height 0.2s ease;
}

/* Card styling */
[data-bs-theme="dark"] .card {
    background-color: #212529;
    border-color: #495057;
}

[data-bs-theme="dark"] .card-header {
    background-color: #1a1d20;
    border-bottom-color: #495057;
}

[data-bs-theme="dark"] .card-header h5 {
    color: #e9ecef;
}

/* Form controls */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .toolOutput {
    background-color: #212529;
    border-color: #495057;
    color: #e9ecef;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .toolOutput:focus {
    background-color: #1a1d20;
    border-color: #052c65;
    color: #e9ecef;
}

[data-bs-theme="dark"] .form-control[readonly],
[data-bs-theme="dark"] .toolOutput[readonly] {
    background-color: #1a1d20;
    color: #adb5bd;
}

/* Alert info */
.alert-info {
    background-color: #e6f0ff;
    border-color: #052c65;
    color: #052c65;
}

[data-bs-theme="dark"] .alert-info {
    background-color: #0a1628;
    border-color: #1e4a8a;
    color: #93c5fd;
}

/* Spinner */
.spinner-border {
    border-color: rgba(5, 44, 101, 0.2);
    border-right-color: #052c65;
    width: 1.5rem;
    height: 1.5rem;
}

[data-bs-theme="dark"] .spinner-border {
    border-color: rgba(147, 197, 253, 0.2);
    border-right-color: #93c5fd;
}

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

#downloadLink[href]:not([href="#"]):not([href=""]) {
    display: inline-block !important;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #originalPreviewImage {
        max-height: 150px;
        max-width: 100%;
    }

    .preview-box {
        margin-bottom: 1rem;
    }

    .preset-btn {
        font-size: 0.875rem;
    }
}
