/* Form Elements Visibility Enhancements */
/* यह CSS file सभी form elements को स्पष्ट और readable बनाती है */

/* Base form styling improvements */
* {
    box-sizing: border-box;
}

/* Ensure all form elements have proper contrast and visibility */
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"],
textarea,
select {
    /* High contrast colors for better visibility */
    color: #2c3e50 !important;
    background-color: #ffffff !important;
    border: 2px solid #bdc3c7 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Focus state for better visibility */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2) !important;
    outline: none !important;
    background-color: #ffffff !important;
    color: #2c3e50 !important;
}

/* Placeholder text styling */
input::placeholder,
textarea::placeholder {
    color: #7f8c8d !important;
    font-weight: 400 !important;
    opacity: 1 !important;
}

/* Select dropdown styling */
select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Select options styling */
select option {
    color: #2c3e50 !important;
    background-color: #ffffff !important;
    padding: 8px 12px !important;
    font-weight: 500 !important;
}

/* Textarea specific styling */
textarea {
    min-height: 120px !important;
    resize: vertical !important;
    font-family: 'Ek Mukta', 'Arial', sans-serif !important;
    line-height: 1.6 !important;
}

/* Form labels - make them more prominent */
label,
.control-label,
.form-label {
    color: #2c3e50 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    margin-bottom: 8px !important;
    display: block !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
}

/* Form groups spacing */
.form-group {
    margin-bottom: 25px !important;
}

/* Required field indicators */
.required {
    color: #e74c3c !important;
    font-weight: bold !important;
}

/* Error states */
.has-error input,
.has-error textarea,
.has-error select {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

/* Success states */
.has-success input,
.has-success textarea,
.has-success select {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2) !important;
}

/* Checkbox and radio button styling */
input[type="checkbox"],
input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    margin-right: 8px !important;
    accent-color: #3498db !important;
}

/* Checkbox and radio labels */
.checkbox label,
.radio label {
    font-weight: 500 !important;
    color: #2c3e50 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    margin-bottom: 10px !important;
}

/* Button styling improvements */
.btn {
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.btn-primary {
    background-color: #3498db !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #2980b9 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.btn-success {
    background-color: #27ae60 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background-color: #229954 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.btn-danger {
    background-color: #e74c3c !important;
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #c0392b !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.btn-warning {
    background-color: #f39c12 !important;
    color: #ffffff !important;
}

.btn-warning:hover {
    background-color: #e67e22 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

/* Form validation messages */
.help-block,
.form-text,
.invalid-feedback {
    color: #e74c3c !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-top: 5px !important;
    display: block !important;
}

.valid-feedback {
    color: #27ae60 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-top: 5px !important;
    display: block !important;
}

/* Form sections and panels */
.panel,
.card {
    border: 1px solid #bdc3c7 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    margin-bottom: 20px !important;
}

.panel-heading,
.card-header {
    background-color: #ecf0f1 !important;
    color: #2c3e50 !important;
    font-weight: 600 !important;
    padding: 15px 20px !important;
    border-bottom: 1px solid #bdc3c7 !important;
}

.panel-body,
.card-body {
    padding: 20px !important;
    background-color: #ffffff !important;
}

/* Table form elements */
.table input,
.table select,
.table textarea {
    margin: 0 !important;
    border: 1px solid #bdc3c7 !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
}

/* Search and filter forms */
.search-form,
.filter-form {
    background-color: #f8f9fa !important;
    padding: 20px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    border: 1px solid #e9ecef !important;
}

/* File upload styling */
input[type="file"] {
    padding: 8px !important;
    border: 2px dashed #bdc3c7 !important;
    background-color: #f8f9fa !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

input[type="file"]:hover {
    border-color: #3498db !important;
    background-color: #e3f2fd !important;
}

/* Range input styling */
input[type="range"] {
    width: 100% !important;
    height: 8px !important;
    border-radius: 4px !important;
    background: #bdc3c7 !important;
    outline: none !important;
    -webkit-appearance: none !important;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #3498db !important;
    cursor: pointer !important;
}

/* Disabled form elements */
input:disabled,
textarea:disabled,
select:disabled {
    background-color: #ecf0f1 !important;
    color: #7f8c8d !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Readonly form elements */
input[readonly],
textarea[readonly] {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border-color: #ced4da !important;
}

/* Responsive form adjustments */
@media (max-width: 768px) {
    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"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 14px 16px !important;
    }
    
    .btn {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    .form-group {
        margin-bottom: 20px !important;
    }
}

/* Print styles for forms */
@media print {
    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"],
    textarea,
    select {
        border: 1px solid #000 !important;
        background-color: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
    
    .btn {
        background-color: #f8f9fa !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
}

/* Marathi text specific improvements */
.marathi-text,
.devanagari {
    font-family: 'Ek Mukta', 'Arial', sans-serif !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    letter-spacing: 0.5px !important;
}

/* Ensure form elements work well with Marathi text */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-family: 'Ek Mukta', 'Arial', sans-serif !important;
    direction: ltr !important; /* Keep input direction LTR for better UX */
}

/* Form help text */
.form-help {
    color: #6c757d !important;
    font-size: 14px !important;
    font-style: italic !important;
    margin-top: 5px !important;
}

/* Loading states */
.form-loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.form-loading::after {
    content: "Loading..." !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #3498db !important;
    font-weight: 600 !important;
}
