$surface: #ffffff;
$border: #e2e8f0;
$primary: #1b64f2;
$danger: #e11d48;
$text: #0f172a;
$muted: #6b7280;

:host {
  display: block;
}

.profile-section {
  margin: 1.5rem auto;
  max-width: 1400px;
  background: $surface;
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.12);
}

.profile-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;

  @media (max-width: 640px) {
    flex-direction: column;
    align-items: flex-start;
  }
}

.section-title {
  margin: 0;
  font-size: 1.5rem;
  color: $text;
}

.section-description {
  margin: 0.25rem 0 0;
  color: $muted;
}

.edit-profile-btn {
  border: 1px solid rgba($primary, 0.4);
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  background: rgba($primary, 0.08);
  color: $primary;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.profile-card {
  border: 1px solid $border;
  border-radius: 22px;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(248, 250, 255, 0.9), #fff);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;

  @media (max-width: 640px) {
    flex-direction: column;
    align-items: flex-start;
  }
}

.profile-avatar-wrapper {
  position: relative;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: rgba($primary, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  .avatar-image-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.avatar-upload-btn {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: $primary;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(27, 100, 242, 0.2);
}

.profile-name {
  h3 {
    margin: 0;
    font-size: 1.4rem;
    color: $text;
  }

  p {
    margin: 0.15rem 0 0;
    color: $muted;
  }
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.04);
}

.detail-label {
  font-size: 0.85rem;
  color: $muted;
}

.detail-value {
  font-weight: 600;
  color: $text;
}

.status-badge {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;

  &.status-confirmed {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
  }

  &.status-cancelled {
    background: rgba(248, 113, 113, 0.2);
    color: #dc2626;
  }
}

.edit-profile-form {
  border: 1px solid $border;
  border-radius: 22px;
  padding: 1.5rem;
  background: #fff;
}

.form-header {
  margin-bottom: 1rem;
}

.form-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: $text;
}

.form-subtitle {
  margin: 0.25rem 0 0;
  color: $muted;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  border: 1px solid #edf0f7;
  border-radius: 18px;
  padding: 1.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;

  h4 {
    margin: 0;
    font-size: 1.1rem;
    color: $text;
  }

  p {
    margin: 0.2rem 0 0;
    color: $muted;
  }

  @media (max-width: 640px) {
    flex-direction: column;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;

  &.form-group-full {
    grid-column: 1 / -1;
  }
}

.form-label {
  font-weight: 600;
  color: $text;
}

.form-input,
.form-select,
.form-textarea {
  border: 1px solid $border;
  border-radius: 14px;
  padding: 0.8rem;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s ease;

  &:focus {
    border-color: $primary;
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 100, 242, 0.1);
  }
}

.form-textarea {
  resize: vertical;
}

.form-hint {
  font-size: 0.85rem;
  color: $muted;
}

.allergies-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.allergies-input {
  display: flex;
  gap: 0.5rem;
}

.add-btn {
  border: none;
  border-radius: 12px;
  padding: 0 0.9rem;
  background: rgba($primary, 0.12);
  color: $primary;
  cursor: pointer;
}

.allergies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.allergy-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.remove-allergy {
  border: none;
  background: transparent;
  color: $danger;
  cursor: pointer;
}

.allergies-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  color: $muted;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: $muted;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.cancel-btn,
.submit-button {
  border-radius: 14px;
  padding: 0.75rem 1.5rem;
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.cancel-btn {
  background: rgba(15, 23, 42, 0.08);
  color: $text;
}

.submit-button {
  background: linear-gradient(135deg, #1b64f2, #7b5bff);
  color: #fff;
  box-shadow: 0 15px 30px rgba(27, 100, 242, 0.2);

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

