/*
 * SharePoint Tenant Issue Form Styles
 * Prefix: shp-
 */

.shp-form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

/* Full-width background using pseudo-element */
.shp-form-container.light-blue {
  padding-top: 40px;
  padding-bottom: 40px;
}

.shp-form-container.light-blue::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background-color: #dde8f1;
  z-index: -1;
}

.shp-form-title {
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 600;
}

.shp-form-message {
  padding: 15px 20px;
  margin-bottom: 25px;
  border-radius: 4px;
}

.shp-form-message.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.shp-form-message.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.shp-form-message ul {
  margin: 0;
  padding-left: 20px;
}

.shp-form {
  /* background: #fff; */
  /* padding: 30px;(max-width: 768px) */
  border-radius: 8px;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.shp-form-field {
  margin-bottom: 25px;
}

.shp-form-label {
  display: block;
  /* font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px; */
}

.shp-form-label .text-danger {
  color: #dc3545;
  margin-left: 3px;
}

.shp-form-input,
.shp-form-textarea,
.shp-form-select {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  line-height: 46px;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  background-color: #fff;
  color: #333;
  box-sizing: border-box;
}

.shp-form-input:focus-visible,
.shp-form-textarea:focus-visible,
.shp-form-select:focus-visible {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.shp-form-textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 16px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}

.shp-form-select {
  cursor: pointer;
  appearance: 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='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.shp-form-submit {
  margin-top: 30px;
  text-align: right;
}

.shp-form-button {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    transform 0.1s ease;
}

.shp-form-button:hover {
  transform: translateY(-1px);
}

.shp-form-button:active {
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .shp-form-container {
    /* padding: 15px; */
  }

  .shp-form {
    /* padding: 20px; */
  }

  .shp-form-title {
    font-size: 24px;
  }

  .shp-form-submit {
    /* text-align: center; */
  }

  .shp-form-button {
    width: 100%;
  }
}

/* Error states */
.shp-form-input.is-invalid,
.shp-form-textarea.is-invalid,
.shp-form-select.is-invalid,
.shp-search-input.is-invalid {
  border-color: #dc3545;
  background-image: none !important;
}

.shp-form-input.is-invalid:focus,
.shp-form-textarea.is-invalid:focus,
.shp-form-select.is-invalid:focus,
.shp-search-input.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.shp-form-error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  display: block;
}

.shp-field-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.shp-field-error.show {
  display: block;
}

/* Loading state */
.shp-form-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.shp-form-button:disabled:hover {
  transform: none;
}

/* Searchable dropdown */
.shp-searchable-select {
  position: relative;
}

.shp-search-input {
  cursor: text;
}

.shp-dropdown-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.shp-dropdown-list.show {
  display: block;
}

.shp-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.shp-dropdown-item:hover,
.shp-dropdown-item.highlighted {
  background-color: #f0f0f0;
}

.shp-dropdown-item:active {
  background-color: #e0e0e0;
}

/* Consent checkbox */
.shp-form-consent {
  margin-top: 10px;
}

.shp-form-consent .form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.shp-consent-checkbox {
  width: 13px;
  height: 13px;
  min-width: 13px;
  margin-top: 3px;
  cursor: pointer;
  /* accent-color: #007bff; */
}

.shp-consent-label {
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.shp-consent-link {
  display: block;
  margin-top: 8px;
  margin-left: 23px;
  font-size: 13px;
}

.shp-consent-link a {
  text-decoration: underline;
}

.shp-consent-checkbox.is-invalid {
  outline: 2px solid #dc3545;
  outline-offset: 1px;
}

.shp-file-upload-wrapper {
  position: relative;
}
.shp-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.shp-file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background-color: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.shp-file-upload-area:hover,
.shp-file-upload-area.dragover {
  border-color: #003366;
  background-color: #f0f5fa;
}
.shp-file-upload-icon {
  color: #666;
  margin-bottom: 0.75rem;
}
.shp-file-upload-area:hover .shp-file-upload-icon,
.shp-file-upload-area.dragover .shp-file-upload-icon {
  color: #003366;
}
.shp-file-upload-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: #666;
  font-size: 0.95rem;
}
.shp-file-upload-text strong {
  color: #003366;
}
.shp-file-upload-text span {
  font-size: 0.85rem;
}
.shp-file-list {
  margin-top: 1rem;
}
.shp-file-list:empty {
  display: none;
}
.shp-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: #f5f5f5;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.shp-file-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}
.shp-file-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shp-file-item-size {
  color: #888;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.shp-file-item-remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  font-size: 1.2rem;
  transition: color 0.2s;
}
.shp-file-item-remove:hover {
  color: #c00;
}
.shp-file-item-error {
  background-color: #fee;
  border: 1px solid #c00;
}
.shp-file-item-error .shp-file-item-size {
  color: #c00;
}

body:has(.shp-form-container) {
  overflow-x: clip;
}
