/**
 * Modern Form Style - Global
 * دیزاین مدرن و یکپارچه برای تمام فرم‌های سیستم
 */

/* ===== Form Group ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.form-group label::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* ===== All Form Controls ===== */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border: 3px solid #e0e7ff;
    border-radius: 15px;
    font-size: 15px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
    background: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08);
    font-weight: 500;
    color: #1e293b;
    min-height: 52px;
    line-height: 1.5;
}

/* ===== Hover State ===== */
.form-control:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
textarea:hover,
select:hover {
    border-color: #c7d2fe;
    box-shadow: 0 5px 18px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

/* ===== Focus State ===== */
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.15), 0 5px 18px rgba(99, 102, 241, 0.2);
    background: white;
}

/* ===== Placeholder ===== */
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* ===== Select Specific ===== */
select.form-control,
select {
    padding: 16px 50px 16px 20px !important;
    background: white !important;
    border: 3px solid #e0e7ff !important;
    border-radius: 15px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1) !important;
    position: relative !important;
    height: auto !important;
    min-height: 52px !important;
    line-height: 1.5 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%236366f1' d='M10 14l-6-6h12z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 18px center !important;
    background-size: 18px !important;
}

select.form-control:hover,
select:hover {
    border-color: #6366f1 !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2) !important;
    transform: translateY(-2px);
}

select.form-control:focus,
select:focus {
    background: white !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.15), 0 6px 20px rgba(99, 102, 241, 0.25) !important;
    outline: none !important;
}

/* ===== Select Options ===== */
select.form-control option,
select option {
    text-align: right !important;
    direction: rtl !important;
    font-size: 15px !important;
    padding: 15px 20px !important;
    background: white !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    line-height: 1.8 !important;
}

select.form-control option:checked,
select option:checked {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
}

/* ===== Textarea Specific ===== */
textarea.form-control,
textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* ===== Disabled State ===== */
.form-control:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* ===== Read Only ===== */
.form-control[readonly],
input[readonly],
textarea[readonly] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: default !important;
}

/* ===== Error State ===== */
.form-control.error,
input.error,
textarea.error,
select.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* ===== Success State ===== */
.form-control.success,
input.success,
textarea.success,
select.success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* ===== Small Size ===== */
.form-control-sm {
    padding: 10px 15px !important;
    min-height: 40px !important;
    font-size: 13px !important;
}

/* ===== Large Size ===== */
.form-control-lg {
    padding: 20px 25px !important;
    min-height: 60px !important;
    font-size: 16px !important;
}

/* ===== Input Group ===== */
.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

/* ===== Checkbox & Radio ===== */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: auto;
    margin-left: 8px;
    cursor: pointer;
    accent-color: #6366f1;
}

/* ===== File Input ===== */
input[type="file"] {
    padding: 12px 15px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    margin-left: 12px;
}

input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
