/*
 * Project side-panel forms — WIX design system
 * Used by create-project-form.html (and shared patterns for edit form)
 */

#sidePanel .side-panel-content:has(.project-create-form) {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.WIX-root.project-create-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-family: var(--wix-font-family);
  font-size: var(--wix-text-body);
  color: var(--wix-color-gray-900);
}

.WIX-root.project-create-form #createProjectForm {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.WIX-root.project-create-form .project-create-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--wix-space-5) var(--wix-space-6);
  min-height: 0;
}

.WIX-root.project-create-form .project-create-actions {
  flex-shrink: 0;
  border-top: 1px solid var(--wix-border-color);
  padding: var(--wix-space-4) var(--wix-space-6);
  background: var(--wix-color-gray-50);
}

.WIX-root.project-create-form .project-create-actions .WIX-row {
  width: 100%;
}

/* Form fields */
.WIX-root.project-create-form .WIX-form-group {
  margin-bottom: var(--wix-space-4);
}

.WIX-root.project-create-form .WIX-label {
  display: block;
  margin-bottom: var(--wix-space-2);
}

.WIX-root.project-create-form .form-control,
.WIX-root.project-create-form .form-select,
.WIX-root.project-create-form .WIX-input,
.WIX-root.project-create-form .WIX-select,
.WIX-root.project-create-form .WIX-textarea {
  width: 100%;
  padding: 0.5625rem var(--wix-space-3);
  font-family: var(--wix-font-family);
  font-size: var(--wix-text-body);
  color: var(--wix-color-gray-900);
  background-color: var(--wix-color-white);
  border: 1px solid var(--wix-color-gray-300);
  border-radius: var(--wix-radius);
  transition: border-color var(--wix-transition-fast),
              box-shadow var(--wix-transition-fast),
              background-color var(--wix-transition-fast);
}

.WIX-root.project-create-form .WIX-textarea,
.WIX-root.project-create-form textarea.form-control {
  min-height: 72px;
  resize: vertical;
  line-height: var(--wix-leading-normal);
}

.WIX-root.project-create-form .form-control:focus,
.WIX-root.project-create-form .form-select:focus,
.WIX-root.project-create-form .WIX-input:focus,
.WIX-root.project-create-form .WIX-select:focus,
.WIX-root.project-create-form .WIX-textarea:focus {
  outline: none;
  border-color: var(--wix-color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.WIX-root.project-create-form .form-control.is-valid,
.WIX-root.project-create-form .form-select.is-valid,
.WIX-root.project-create-form .form-control-color.is-valid {
  border-color: var(--wix-color-success);
  background-color: #f0fdf4;
}

.WIX-root.project-create-form .form-control.is-invalid,
.WIX-root.project-create-form .form-select.is-invalid {
  border-color: var(--wix-color-danger);
  background-color: #fef2f2;
}

.WIX-root.project-create-form .invalid-feedback {
  display: block;
  margin-top: var(--wix-space-1);
  font-size: var(--wix-text-xs);
  color: var(--wix-color-danger);
}

.WIX-root.project-create-form .project-create-color-row {
  display: flex;
  align-items: center;
  gap: var(--wix-space-3);
}

.WIX-root.project-create-form .form-control-color {
  width: 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--wix-color-gray-300);
  border-radius: var(--wix-radius);
  cursor: pointer;
}

.WIX-root.project-create-form .project-create-color-hint {
  font-size: var(--wix-text-sm);
  color: var(--wix-color-gray-500);
}

/* Select2 */
.WIX-root.project-create-form .select2-container {
  width: 100% !important;
  display: block !important;
}

.WIX-root.project-create-form .select2-container--default .select2-selection--single {
  height: 38px;
  border: 1px solid var(--wix-color-gray-300);
  border-radius: var(--wix-radius);
  background: var(--wix-color-white);
  transition: border-color var(--wix-transition-fast),
              box-shadow var(--wix-transition-fast),
              background-color var(--wix-transition-fast);
}

.WIX-root.project-create-form .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: var(--wix-space-3);
  padding-right: var(--wix-space-3);
  font-size: var(--wix-text-body);
  color: var(--wix-color-gray-900);
}

.WIX-root.project-create-form .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

.WIX-root.project-create-form .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--wix-color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.WIX-root.project-create-form .select2-container--default .select2-selection--single.is-valid {
  border-color: var(--wix-color-success);
  background-color: #f0fdf4;
}

.WIX-root.project-create-form .select2-container--default .select2-selection--single.is-invalid {
  border-color: var(--wix-color-danger);
  background-color: #fef2f2;
}

.WIX-root.project-create-form .select2-dropdown {
  border: 1px solid var(--wix-border-color);
  border-radius: var(--wix-radius);
  box-shadow: var(--wix-shadow-md);
  font-family: var(--wix-font-family);
  font-size: var(--wix-text-body);
}

.WIX-root.project-create-form .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--wix-color-primary);
}

/* Buttons */
.WIX-root.project-create-form .WIX-btn {
  min-width: 120px;
}

.WIX-root.project-create-form .WIX-btn--primary,
.WIX-root.project-create-form .WIX-btn--primary:hover {
  color: var(--wix-color-white);
}

/* Alert container */
.WIX-root.project-create-form #formAlertContainer {
  margin-top: var(--wix-space-3);
}

.WIX-root.project-create-form #formAlertContainer .alert {
  margin-bottom: 0;
  border-radius: var(--wix-radius-md);
  font-size: var(--wix-text-body);
}

.WIX-root.project-create-form #formAlertContainer .alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

@media (max-width: 768px) {
  .WIX-root.project-create-form .project-create-content,
  .WIX-root.project-create-form .project-create-actions {
    padding-left: var(--wix-space-4);
    padding-right: var(--wix-space-4);
  }

  .WIX-root.project-create-form .project-create-actions .WIX-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .WIX-root.project-create-form .WIX-btn {
    width: 100%;
  }
}
