/* Form Elements Text Color - #113F67 */

/* Input Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="color"],
input[type="file"] {
    color: #113F67 !important;
    font-family: 'Sarabun', sans-serif;
    font-weight: 400;
}

/* Textarea */
textarea {
    color: #113F67 !important;
    font-family: 'Sarabun', sans-serif;
    font-weight: 400;
}

/* Select */
select {
    color: #113F67 !important;
    font-family: 'Sarabun', sans-serif;
    font-weight: 400;
}

/* Select Options */
select option {
    color: #113F67 !important;
    background-color: #ffffff;
}

/* Labels */
label {
    color: #113F67 !important;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/* Placeholder Text */
input::placeholder,
textarea::placeholder {
    color: rgba(17, 63, 103, 0.6) !important;
    font-family: 'Sarabun', sans-serif;
    font-weight: 300;
}

/* Focus States */
input:focus,
textarea:focus,
select:focus {
    color: #113F67 !important;
    outline: 2px solid rgba(17, 63, 103, 0.3);
    outline-offset: 2px;
}

/* Disabled States */
input:disabled,
textarea:disabled,
select:disabled {
    color: rgba(17, 63, 103, 0.4) !important;
    background-color: #f8fafc;
}

/* Form Control Classes (if using custom classes) */
.form-control,
.form-input,
.form-select,
.form-textarea {
    color: #113F67 !important;
    font-family: 'Sarabun', sans-serif;
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(17, 63, 103, 0.6) !important;
}

/* Livewire/Alpine.js specific inputs */
[wire\:model] {
    color: #113F67 !important;
}

[x-model] {
    color: #113F67 !important;
}

/* Input Groups */
.input-group input,
.input-group select,
.input-group textarea {
    color: #113F67 !important;
}

/* Bootstrap/Tailwind Override */
.form-control,
.form-select,
.form-check-label,
.form-label {
    color: #113F67 !important;
}

/* Specific for KU OPAS */
.ku-form-input,
.opas-input,
.admin-input {
    color: #113F67 !important;
    font-family: 'Sarabun', sans-serif;
}

/* Checkbox and Radio Labels */
input[type="checkbox"] + label,
input[type="radio"] + label,
.form-check-label {
    color: #113F67 !important;
}

/* File Input */
input[type="file"]::-webkit-file-upload-button {
    color: #113F67;
    background-color: #f1f5f9;
    border: 1px solid rgba(17, 63, 103, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Sarabun', sans-serif;
}

/* Date/Time Input */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.2) sepia(1) saturate(2) hue-rotate(200deg);
}

/* Search Input Clear Button */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23113F67'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-size: 16px 16px;
    cursor: pointer;
}

/* Responsive Font Sizes */
@media (max-width: 768px) {
    input, textarea, select, label {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    input, textarea, select, label {
        color: #113F67 !important;
        border: 2px solid #113F67 !important;
    }
}

/* Dark Mode Override (if needed to maintain color) */
@media (prefers-color-scheme: dark) {
    input, textarea, select, label {
        color: #113F67 !important;
        background-color: #ffffff;
    }
}

/* Print Styles */
@media print {
    input, textarea, select, label {
        color: #113F67 !important;
        background: transparent !important;
    }
}