/* Form Stilleri */

/* Form Container */
.form {
  width: 100%;
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

/* Label */
.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-medium);
  color: var(--gray-700);
  font-size: var(--text-sm);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger-color);
}

/* Input ve Textarea */
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base) ease;
  outline: none;
}

.form-control:hover {
  border-color: var(--gray-400);
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-control::placeholder {
  color: var(--gray-500);
}

.form-control:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Textarea */
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Select */
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base) ease;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  padding-right: var(--space-10);
  appearance: none;
}

.form-select:hover {
  border-color: var(--gray-400);
}

.form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* Checkbox ve Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  cursor: pointer;
}

.form-check-input {
  width: 20px;
  height: 20px;
  margin-right: var(--space-3);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent-color);
}

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

/* Custom Checkbox */
.custom-checkbox {
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-checkbox .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: var(--white);
  border: 2px solid var(--gray-400);
  border-radius: var(--radius-base);
  transition: all var(--transition-base) ease;
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--accent-color);
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.custom-checkbox .checkmark:after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

/* Custom Radio */
.custom-radio {
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
}

.custom-radio input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-radio .radio-mark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: var(--white);
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  transition: all var(--transition-base) ease;
}

.custom-radio:hover input ~ .radio-mark {
  border-color: var(--accent-color);
}

.custom-radio input:checked ~ .radio-mark {
  border-color: var(--accent-color);
}

.custom-radio .radio-mark:after {
  content: '';
  position: absolute;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
}

.custom-radio input:checked ~ .radio-mark:after {
  display: block;
}

/* Switch Toggle */
.form-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.form-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.form-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-400);
  transition: all var(--transition-base) ease;
  border-radius: var(--radius-full);
}

.form-switch .slider:before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: all var(--transition-base) ease;
  border-radius: 50%;
}

.form-switch input:checked + .slider {
  background-color: var(--accent-color);
}

.form-switch input:checked + .slider:before {
  transform: translateX(24px);
}

/* Range Slider */
.form-range {
  width: 100%;
  height: 6px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-base) ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: var(--shadow-lg);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base) ease;
}

/* File Input */
.form-file {
  position: relative;
  display: inline-block;
  cursor: pointer;
  overflow: hidden;
}

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

.form-file-label {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-weight: var(--font-medium);
  transition: all var(--transition-base) ease;
}

.form-file:hover .form-file-label {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

/* Input Group */
.input-group {
  display: flex;
  width: 100%;
}

.input-group-prepend,
.input-group-append {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
  color: var(--gray-700);
  font-weight: var(--font-medium);
}

.input-group-prepend {
  border-right: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.input-group-append {
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

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

.input-group .form-control:first-child {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.input-group .form-control:last-child {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

/* Form Validation */
.form-control.is-valid {
  border-color: var(--success-color);
}

.form-control.is-valid:focus {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-control.is-invalid {
  border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-feedback {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.valid-feedback {
  color: var(--success-color);
}

.invalid-feedback {
  color: var(--danger-color);
}

/* Form Help Text */
.form-text {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-600);
}

/* Floating Labels */
.form-floating {
  position: relative;
}

.form-floating .form-control {
  padding-top: var(--space-6);
  padding-bottom: var(--space-2);
}

.form-floating label {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  font-size: var(--text-base);
  color: var(--gray-600);
  pointer-events: none;
  transition: all var(--transition-base) ease;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
  top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--accent-color);
}
