/**
 * Form Validation & Helper Styles
 * CB Hizmet Online Satış Platformu
 */

/* Checkbox & Radio Styles */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2563eb;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.file-input-label i {
    color: #2563eb;
    font-size: 1.2rem;
}

.file-name {
    font-size: 0.9rem;
    color: #64748b;
}

/* Image Preview */
.image-preview {
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
    max-width: 300px;
    border: 2px solid #e2e8f0;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Input Icons */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.input-with-icon .form-control {
    padding-left: 45px;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 120px;
}

/* Form Sections */
.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: #2563eb;
}

/* Color Picker */
input[type="color"].form-control {
    height: 50px;
    padding: 5px;
    cursor: pointer;
}

/* Number Input */
input[type="number"].form-control {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"].form-control::-webkit-inner-spin-button,
input[type="number"].form-control::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    padding-right: 45px;
}

.search-input-wrapper button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #2563eb;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}

.search-input-wrapper button:hover {
    background: #1e40af;
}

/* Date & Time Inputs */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    padding-right: 16px;
}

/* Password Toggle */
.password-toggle-wrapper {
    position: relative;
}

.password-toggle-wrapper .form-control {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
}

.password-toggle:hover {
    color: #2563eb;
}

/* Form Help Text */
.form-help {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #1e40af;
}

.form-help i {
    margin-right: 8px;
}

/* Loading State */
.form-control.loading {
    background: linear-gradient(90deg, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Character Counter */
.char-counter {
    font-size: 0.875rem;
    color: #64748b;
    text-align: right;
    margin-top: 6px;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.danger {
    color: #ef4444;
}
