/* Image to Text (OCR) 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;
}

/* Text colors - Light mode default */

/* Dark mode support - Bootstrap theme system */
/* Image Preview */
#imagePreview {
    max-height: 400px;
    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: zoom-in;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

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

[data-bs-theme="dark"] #imagePreviewContainer {
    background-color: #212529;
    border-color: #495057;
}

/* Progress Section */
#progressSection .card {
    border-left: 4px solid #052c65;
}

/* Results Section */
#resultsSection .card {
    border-left: 4px solid #052c65;
}

/* Extracted text textarea */
#extractedText {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 200px;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

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

.form-label.fw-bold {
    font-weight: 600;
}

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

/* Buttons */
.btn {
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.toolBtn {
    cursor: pointer;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

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

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

.form-select {
    cursor: pointer;
}

/* Language select */
#ocrLanguage {
    font-size: 1rem;
}

/* Confidence bar colors */
.progress-bar.bg-warning {
    background-color: #ffc107 !important;
}

.progress-bar.bg-danger {
    background-color: #dc3545 !important;
}

/* Icons in card headers */
.card-header img {
    vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #imagePreview {
        max-height: 300px;
    }

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

/* Spinner animation */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Prevent text selection on interactive elements */
.btn, .badge, .form-check-label, .input-group-text {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Allow text selection in output fields */
.toolOutput {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}
