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

/* Cursor pointers for interactive elements */
.btn {
    cursor: pointer;
}

.toolBtn {
    cursor: pointer;
}

/* Button icons styling */
.toolBtn img {
    transition: all 0.2s ease;
}

/* Dark mode button styling */
[data-bs-theme="dark"] .btn-success {
    background-color: #198754;
    border-color: #198754;
}

[data-bs-theme="dark"] .btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

[data-bs-theme="dark"] .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #adb5bd;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

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

/* Dark mode form labels */
[data-bs-theme="dark"] .form-label {
    color: #e9ecef;
}

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

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

/* Drawing Canvas */
.canvas-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.drawing-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

[data-bs-theme="dark"] .canvas-wrapper {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4);
}

/* Form controls */
.form-control {
    cursor: text;
}

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

.form-select {
    cursor: pointer;
}

/* Range slider */
.form-range {
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    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;
}

/* Dark mode text elements */
[data-bs-theme="dark"] small.text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .form-text {
    color: #adb5bd !important;
}

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

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .toolOutput:focus,
[data-bs-theme="dark"] .form-select: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;
}

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

/* Dark mode preview images */
[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;
}

/* Processing status */
#processingStatus {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert info - brand color theme */
.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 - brand color */
.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;
}

/* Progress bar - brand color gradient */
.progress {
    background-color: #e9ecef;
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background: linear-gradient(90deg, #052c65 0%, #0a58ca 100%);
    transition: width 0.3s ease;
}

[data-bs-theme="dark"] .progress {
    background-color: #495057;
}

[data-bs-theme="dark"] .progress-bar {
    background: linear-gradient(90deg, #052c65 0%, #1e7ed8 100%);
}

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

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

/* Card body label icons */
.card-body .form-label img {
    opacity: 0.7;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.card-body .form-label:hover img {
    opacity: 1;
}

/* Dark mode filter icons */
[data-bs-theme="dark"] .card-body .form-label img {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

[data-bs-theme="dark"] .card-body .form-label:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Button icons in outline buttons */
.btn-outline-secondary img {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover img {
    opacity: 1;
}

[data-bs-theme="dark"] .btn-outline-secondary img {
    filter: brightness(0) invert(1);
}

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

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

    .canvas-wrapper {
        max-width: 100%;
    }

    .drawing-canvas {
        width: 100%;
    }
}

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

/* Comparison container animation */
#comparisonContainer {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
