/* NexifyERP - Professional Form Styling */
/* Consistent form styling across all modules */

/* ==================== Form Inputs ==================== */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    height: 2.5rem; /* 40px - consistent height for all inputs */
    color: #374151;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Textarea needs auto height */
textarea {
    height: auto;
    padding: 0.75rem 1rem !important; /* Explicit padding for textarea */
}

/* Focus State */
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Disabled State */
.form-input:disabled,
input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="date"]:disabled,
input[type="datetime-local"]:disabled,
input[type="time"]:disabled,
textarea:disabled,
select:disabled {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ==================== Textarea ==================== */
textarea {
    min-height: 80px;
    resize: vertical;
    padding: 0.75rem 1rem !important; /* Explicit left/right padding */
}

/* ==================== Select Dropdown ==================== */
select {
    /* Match exact height with inputs */
    height: 2.5rem; /* 40px */
    padding: 0.5rem 2.5rem 0.5rem 1rem !important; /* top right bottom left - explicit padding */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select::-ms-expand {
    display: none;
}

/* Multiple select */
select[multiple] {
    height: auto;
    min-height: 5rem;
    padding: 0.75rem 1rem !important; /* Consistent padding for multiple select */
    background-image: none;
}

/* Select option padding */
select option {
    padding: 0.5rem 1rem; /* Padding for dropdown options */
}

/* ==================== Checkbox & Radio ==================== */
input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ==================== Form Labels ==================== */
.form-label,
label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* ==================== Input with Icon ==================== */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .icon-left {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-icon-wrapper .icon-right {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-icon-wrapper.has-icon-left input {
    padding-left: 2.5rem;
}

.input-icon-wrapper.has-icon-right input {
    padding-right: 2.5rem;
}

/* ==================== Error State ==================== */
.form-input.error,
input.error,
textarea.error,
select.error {
    border-color: #ef4444;
}

.form-input.error:focus,
input.error:focus,
textarea.error:focus,
select.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error,
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ==================== Success State ==================== */
.form-input.success,
input.success,
textarea.success,
select.success {
    border-color: #10b981;
}

.form-input.success:focus,
input.success:focus,
textarea.success:focus,
select.success:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ==================== Form Groups ==================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

/* ==================== Input Sizes ==================== */
.form-input-sm,
input.form-input-sm,
select.form-input-sm,
textarea.form-input-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    height: 2rem; /* 32px */
}

textarea.form-input-sm {
    height: auto;
    padding: 0.5rem 0.75rem !important; /* Proper padding for small textarea */
}

select.form-input-sm {
    padding: 0.375rem 2.25rem 0.375rem 0.875rem !important; /* More left padding */
}

select.form-input-sm option {
    padding: 0.375rem 0.875rem;
}

.form-input-lg,
input.form-input-lg,
select.form-input-lg,
textarea.form-input-lg {
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    height: 3rem; /* 48px */
}

textarea.form-input-lg {
    height: auto;
    padding: 0.875rem 1.125rem !important; /* Proper padding for large textarea */
}

select.form-input-lg {
    padding: 0.625rem 2.75rem 0.625rem 1.125rem !important; /* More left padding */
}

select.form-input-lg option {
    padding: 0.625rem 1.125rem;
}

/* ==================== Read-only State ==================== */
.form-input:read-only,
input:read-only,
textarea:read-only {
    background-color: #f9fafb;
    cursor: default;
}

/* ==================== Required Field Indicator ==================== */
.required,
label .required {
    color: #ef4444;
    margin-left: 0.125rem;
}

/* ==================== Help Text ==================== */
.form-help,
.help-text {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ==================== File Input ==================== */
input[type="file"] {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    padding: 0.375rem 0.75rem;
    margin-right: 0.75rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #e5e7eb;
}

/* ==================== Search Input ==================== */
input[type="search"] {
    padding-right: 2.5rem;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* ==================== Form Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

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

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f9fafb;
}

/* ==================== Select2 ==================== */
/* Single Select */
.select2-container--default .select2-selection--single {
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #374151;
    line-height: 36px;
    padding-left: 12px;
    padding-right: 32px;
}

/* ==================== yajra datatable issue ==================== */
table.dataTable th.text-center,
table.dataTable td.text-center {
    text-align: center !important;
}

table.dataTable th.text-right,
table.dataTable td.text-right {
    text-align: right !important;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 640px) {
    .form-input,
    input,
    textarea,
    select {
        font-size: 1rem; /* Prevents zoom on iOS */
    }
}
/* ==================== modal ==================== */
.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 100%;
    min-width: 35rem;
    padding: 1.5rem;
}