// Enterprise-Grade Profile Component Styling
// Color Palette
$primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
$primary-blue: #0066cc;
$primary-blue-light: #e6f2ff;
$primary-blue-dark: #0052a3;
$accent-teal: #0099a1;
$accent-purple: #8b5cf6;
$text-dark: #1a1a1a;
$text-medium: #4a4a4a;
$text-light: #6b6b6b;
$text-lighter: #9ca3af;
$border-color: #e8eaed;
$border-focus: #0066cc;
$background-light: #f8f9fa;
$background-page: #f5f7fa;
$background-elevated: #ffffff;
$white: #ffffff;
$success-green: #10b981;
$success-green-light: #d1fae5;
$success-green-dark: #059669;
$error-red: #ef4444;
$error-red-light: #fee2e2;
$error-red-dark: #dc2626;
$warning-orange: #f59e0b;
$shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
$shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
$shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
$shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
$border-radius-sm: 8px;
$border-radius-md: 12px;
$border-radius-lg: 16px;
$border-radius-xl: 20px;
$transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
$transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
$transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

.profile-section {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-header-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-header-content {
  flex: 1;
  min-width: 200px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: $text-dark;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
  background: $primary-gradient;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.section-description {
  font-size: 16px;
  color: $text-medium;
  margin: 0;
  letter-spacing: 0.1px;
  line-height: 1.5;
}

.edit-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: $primary-gradient;
  color: $white;
  border: none;
  border-radius: $border-radius-md;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all $transition-base;
  box-shadow: $shadow-md;
  position: relative;
  overflow: hidden;
  white-space: nowrap;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity $transition-base;
  }

  svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    position: relative;
    z-index: 1;
    transition: transform $transition-base;
  }

  span {
    position: relative;
    z-index: 1;
  }

  &:hover {
    transform: translateY(-2px);
    box-shadow: $shadow-lg;

    &::before {
      opacity: 1;
    }

    svg {
      transform: rotate(5deg) scale(1.1);
    }
  }

  &:active {
    transform: translateY(0);
    box-shadow: $shadow-md;
  }
}

.profile-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 252, 0.98) 100%);
  backdrop-filter: blur(10px);
  border-radius: $border-radius-lg;
  box-shadow: $shadow-xl;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 32px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: $primary-gradient;
    opacity: 0.8;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: $primary-gradient;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: $shadow-xl, 0 0 0 4px rgba(102, 126, 234, 0.1);
  overflow: hidden;
  position: relative;
  transition: all $transition-base;

  &::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: $primary-gradient;
    opacity: 0;
    transition: opacity $transition-base;
    z-index: -1;
    filter: blur(12px);
  }

  &:hover {
    transform: scale(1.05);
    box-shadow: $shadow-2xl, 0 0 0 4px rgba(102, 126, 234, 0.15);

    &::before {
      opacity: 0.4;
    }
  }

  .avatar-image-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
  }

  svg {
    width: 60px;
    height: 60px;
    color: $white;
    stroke-width: 2;
    opacity: 0.9;
  }
}

.avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: $primary-gradient;
  color: $white;
  border: 3px solid $white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: $shadow-md;
  transition: all $transition-base;
  z-index: 10;

  svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
    transition: transform $transition-base;
  }

  &:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: $shadow-lg;
  }

  &:active {
    transform: scale(1.05) rotate(10deg);
  }
}

.hidden-input {
  display: none;
}

.profile-name {
  flex: 1;
  min-width: 200px;

  h3 {
    font-size: 28px;
    font-weight: 700;
    color: $text-dark;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
  }

  p {
    font-size: 16px;
    color: $text-medium;
    margin: 0 0 12px 0;
    letter-spacing: 0.1px;
  }
}

.profile-verified {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, $success-green-light 0%, rgba(209, 250, 229, 0.5) 100%);
  color: $success-green;
  border-radius: $border-radius-sm;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
  margin-top: 8px;
  box-shadow: $shadow-sm;

  svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
    flex-shrink: 0;
  }

  span {
    letter-spacing: 0.2px;
  }
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: $border-radius-md;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all $transition-base;
  gap: 16px;
  flex-wrap: wrap;

  &:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: $shadow-sm;
    transform: translateX(4px);
  }
}

.detail-label {
  font-size: 14px;
  font-weight: 600;
  color: $text-medium;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 200px;
  flex-shrink: 0;
}

.detail-value {
  font-size: 15px;
  font-weight: 500;
  color: $text-dark;
  text-align: right;
  flex: 1;
  min-width: 150px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: $border-radius-sm;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: $shadow-sm;

  &.status-confirmed {
    background: linear-gradient(135deg, $success-green 0%, $success-green-dark 100%);
    color: $white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  }

  &.status-cancelled {
    background: linear-gradient(135deg, $error-red 0%, $error-red-dark 100%);
    color: $white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  }
}

// Edit Profile Form
.edit-profile-form {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 252, 0.98) 100%);
  backdrop-filter: blur(10px);
  border-radius: $border-radius-lg;
  box-shadow: $shadow-xl;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 40px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: $primary-gradient;
    opacity: 0.8;
  }
}

.form-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.form-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  color: $text-dark;
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
  background: $primary-gradient;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
    color: $primary-blue;
  }
}

.form-subtitle {
  font-size: 15px;
  color: $text-medium;
  margin: 0;
  letter-spacing: 0.1px;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.form-section {
  background: rgba(255, 255, 255, 0.6);
  border-radius: $border-radius-lg;
  padding: 28px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all $transition-base;

  &:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: $shadow-sm;
  }
}

.section-header {
  margin-bottom: 24px;
}

.section-subtitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: $text-dark;
  margin: 0 0 6px 0;
  letter-spacing: -0.2px;

  svg {
    width: 22px;
    height: 22px;
    color: $primary-blue;
    stroke-width: 2.5;
  }
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;

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

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: $text-dark;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.required-indicator {
  color: $error-red;
  font-weight: 700;
  font-size: 16px;
}

.form-input {
  padding: 12px 16px;
  border: 1.5px solid $border-color;
  border-radius: $border-radius-md;
  font-size: 15px;
  font-weight: 400;
  color: $text-dark;
  background: $white;
  transition: all $transition-base;
  font-family: inherit;
  box-shadow: $shadow-sm;

  &::placeholder {
    color: $text-lighter;
    font-weight: 400;
  }

  &:focus {
    outline: none;
    border-color: $primary-blue;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1), $shadow-md;
    transform: translateY(-1px);
    background: $white;
  }

  &:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: $shadow-sm;
  }

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;

  .input-icon {
    position: absolute;
    left: 16px;
    color: $text-medium;
    font-weight: 600;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
  }

  .form-input {
    padding-left: 36px;
  }
}

.form-hint {
  font-size: 12px;
  color: $text-lighter;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.char-counter {
  font-size: 12px;
  font-weight: 600;
  color: $text-medium;
  padding: 2px 8px;
  background: $background-light;
  border-radius: $border-radius-sm;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.cancel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: $white;
  color: $text-medium;
  border: 1.5px solid $border-color;
  border-radius: $border-radius-md;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all $transition-base;
  box-shadow: $shadow-sm;

  svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
    transition: transform $transition-base;
  }

  &:hover {
    background: $background-light;
    border-color: $text-light;
    color: $text-dark;
    transform: translateY(-2px);
    box-shadow: $shadow-md;

    svg {
      transform: rotate(90deg);
    }
  }

  &:active {
    transform: translateY(0);
    box-shadow: $shadow-sm;
  }
}

.submit-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: $primary-gradient;
  color: $white;
  border: none;
  border-radius: $border-radius-md;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all $transition-base;
  box-shadow: $shadow-md;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity $transition-base;
  }

  svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
    position: relative;
    z-index: 1;
    transition: transform $transition-base;
  }

  span {
    position: relative;
    z-index: 1;
  }

  &:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: $shadow-lg;

    &::before {
      opacity: 1;
    }

    svg {
      transform: scale(1.1) translateX(2px);
    }
  }

  &:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: $shadow-md;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: $shadow-sm;

    &:hover {
      transform: none;
      box-shadow: $shadow-sm;
    }
  }
}

// Responsive Design
@media (max-width: 1024px) {
  .profile-section {
    padding: 24px;
  }

  .profile-card,
  .edit-profile-form {
    padding: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .profile-section {
    padding: 20px;
  }

  .profile-header-section {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .detail-label {
    min-width: auto;
  }

  .detail-value {
    text-align: left;
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
    width: 100%;
  }

  .cancel-btn,
  .submit-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 24px;
  }

  .profile-card,
  .edit-profile-form {
    padding: 20px;
  }

  .form-section {
    padding: 20px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }
}

// Enhanced focus states for accessibility
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid $primary-blue;
  outline-offset: 2px;
  border-radius: $border-radius-sm;
}

// Smooth transitions
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

// Performance optimizations
.profile-section,
.profile-card,
.edit-profile-form {
  will-change: transform;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// Enterprise Fields Styles
.subsection-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: $text-dark;
  margin: 1.5rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
  
  &:first-child {
    margin-top: 0;
  }
}

.array-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  
  .array-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    
    input {
      flex: 1;
    }
    
    .add-btn {
      padding: 0.75rem;
      background: $primary-blue;
      color: $white;
      border: none;
      border-radius: $border-radius-sm;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all $transition-base;
      flex-shrink: 0;
      min-width: 44px;
      
      &:hover {
        background: $primary-blue-dark;
        transform: scale(1.05);
      }
      
      svg {
        width: 20px;
        height: 20px;
      }
    }
  }
  
  .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    
    .tag {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 1rem;
      background: $primary-blue-light;
      color: $primary-blue-dark;
      border-radius: 20px;
      font-size: 0.875rem;
      font-weight: 500;
      
      .tag-remove {
        background: transparent;
        border: none;
        color: $primary-blue-dark;
        cursor: pointer;
        padding: 0;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all $transition-base;
        
        &:hover {
          background: rgba(0, 102, 204, 0.1);
          transform: scale(1.1);
        }
        
        svg {
          width: 14px;
          height: 14px;
        }
      }
    }
  }
}

