/* Modern Minimal Form Styles */
form {
  h5 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
  }

  .form-group {
    margin-bottom: 20px;

    label {
      display: block;
      width: 100%;
      font-size: 14px;
      font-weight: 500;
      margin-bottom: 6px;
      color: #374151;
    }

    small {
      color: #6b7280;
      font-size: 12px;
      margin-top: 4px;
      display: block;
    }

    input[type="text"],
    input[type="date"],
    input[type="number"],
    input[type="email"],
    input[type="search"],
    input[type="password"],
    textarea,
    select {
      display: block;
      width: 100%;
      padding: 12px 16px;
      font-size: 14px;
      border: 1px solid #d1d5db;
      border-radius: 0;
      background-color: #ffffff;
      color: #374151;
      transition: all 0.2s ease;
      appearance: none;
    }

    input[type="text"]:focus,
    input[type="date"]:focus,
    input[type="number"]:focus,
    input[type="email"]:focus,
    input[type="search"]:focus,
    input[type="password"]:focus,
    textarea:focus,
    select:focus {
      border-color: var(--primary-color);
      outline: none;
      box-shadow: 0 0 0 3px rgba(33, 49, 88, 0.1);
    }

    input[type="text"]:hover,
    input[type="date"]:hover,
    input[type="number"]:hover,
    input[type="email"]:hover,
    input[type="search"]:hover,
    input[type="password"]:hover,
    textarea:hover,
    select:hover {
      border-color: #9ca3af;
    }

    input[type="checkbox"] {
      width: 16px;
      height: 16px;
      border: 1px solid #d1d5db;
      border-radius: 0;
      margin-right: 8px;
      cursor: pointer;
      position: relative;
      appearance: none;
      background: white;

      &:checked {
        background: var(--primary-color);
        border-color: var(--primary-color);
      }

      &:checked::after {
        content: "✓";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 10px;
        font-weight: bold;
      }

      &:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
      }
    }

    .trix-content {
      margin-bottom: 0;
      border-radius: 0;
      border: 1px solid #d1d5db;
      min-height: 120px;
      padding: 12px 16px;
      transition: all 0.2s ease;

      &:focus {
        border-color: var(--primary-color);
        outline: none;
        box-shadow: 0 0 0 3px rgba(33, 49, 88, 0.1);
      }
    }

    &.file-input {
      border: 2px dashed var(--secondary-color);
      border-radius: 0;
      padding: 24px;
      text-align: center;
      background: #f9fafb;
      transition: all 0.2s ease;

      &:hover {
        border-color: var(--primary-color);
        background: #f3f4f6;
      }
    }

    .error {
      color: var(--danger-color);
      margin: 6px 0 0 0;
      font-size: 12px;
      font-weight: 500;
    }
  }
}

.checkbox {
  display: flex;
  align-items: center;
  margin: 0 0 20px 0;
  cursor: pointer;

  label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
  }
}

fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 0;
  margin-bottom: 24px;
  padding: 20px;

  legend {
    padding: 0 12px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
  }

  .form-group:last-of-type {
    margin-bottom: 0;
  }
}

.search-field {
  display: inline-block;
  max-width: 240px;
}

/* Form validation states */
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group.has-success input,
.form-group.has-success textarea,
.form-group.has-success select {
  border-color: var(--green-color);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Select dropdown styling */
select {
  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 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* Textarea resize */
textarea {
  resize: vertical;
  min-height: 80px;
}

.discounts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.discount-checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  background-color: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;

  &:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
  }

  input[type="checkbox"] {
    margin-right: 8px;
    margin-bottom: 0;
  }

  label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    flex: 1;
  }
}

@media (max-width: 640px) {
  .discounts-grid {
    grid-template-columns: 1fr;
  }
}
