/* ══════════════════════════════════════════════════════════════
   User Profile Page Styles
   ══════════════════════════════════════════════════════════════ */

.profile-page {
  max-width: 500px;
  margin: 0 auto;
  padding: var(--sp-xl);
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
}

/* ── Photo Section ─────────────────────────────────────────── */

.profile-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-lg);
  padding: var(--sp-lg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-primary);
  display: none;
}

.profile-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 48px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-upload-btn {
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: var(--fs-sm-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-ui);
}

.profile-upload-btn:hover {
  background: var(--color-accent);
}

.profile-upload-btn:active {
  transform: scale(0.98);
}

/* ── Profile Info Section ──────────────────────────────────── */

.profile-info-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  padding: var(--sp-lg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.profile-field:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-label {
  font-size: var(--fs-sm-base);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
}

.profile-field-content {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  justify-content: space-between;
}

.profile-value {
  font-size: var(--fs-base);
  color: var(--color-text-primary);
  flex: 1;
}

.profile-edit-btn {
  padding: 4px 10px;
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  font-size: var(--fs-sm-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-ui);
  white-space: nowrap;
}

.profile-edit-btn:hover {
  background: var(--color-accent);
  color: white;
}

/* ── Edit Mode ────────────────────────────────────────────── */

.profile-field.edit-mode .profile-value {
  display: none;
}

.profile-field.edit-mode .auth-input {
  display: block !important;
  flex: 1;
}

.profile-field.edit-mode .profile-edit-btn {
  display: none;
}

.auth-input {
  padding: var(--sp-sm);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  font-size: var(--fs-base);
  font-family: var(--font-ui);
  display: none;
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(200, 146, 42, 0.1);
}

/* ── Action Buttons ────────────────────────────────────────– */

.profile-actions {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
}

/* ── Pending Badge ────────────────────────────────────────── */

.pending-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #E8A83B;
  color: white;
  border-radius: 12px;
  font-size: var(--fs-sm-small);
  font-weight: 600;
  text-transform: uppercase;
}

/* ── Crop Modal ───────────────────────────────────────────── */

.crop-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
}

.crop-modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.crop-modal-body {
  flex: 1;
  padding: var(--sp-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  min-height: 400px;
}

.crop-preview {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
}

.crop-controls {
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
}

.crop-control-btn {
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: var(--fs-base);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-ui);
  min-width: 44px;
}

.crop-control-btn:hover {
  background: var(--color-accent);
}

.crop-control-btn:active {
  transform: scale(0.98);
}

/* ── Password Strength Indicator ────────────────────────────– */

.password-strength-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.password-strength-bar {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-indicator {
  height: 100%;
  width: 0;
  transition: width 0.3s, background-color 0.3s;
  background-color: var(--color-error);
}

.password-strength-text {
  font-size: var(--fs-sm-base);
  font-weight: 600;
  color: var(--color-error);
}

/* ── Cropper.js Styles ────────────────────────────────────– */

.cropper-container {
  position: relative;
  direction: ltr;
  font-size: 0;
  line-height: 0;
  color: #000;
  box-sizing: border-box;
  user-select: none;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
  max-height: 400px;
  margin: 0 auto;
}

.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  position: absolute;
  top: 0;
  left: 0;
}

.cropper-canvas,
.cropper-drag-box {
  width: 100%;
  height: 100%;
}

.cropper-modal {
  opacity: 0.5;
  background: #000;
}

.cropper-guides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cropper-guide {
  position: absolute;
  display: none;
  width: 33.33333%;
  height: 33.33333%;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.cropper-dashed {
  border-style: dashed;
}

.cropper-center {
  display: block;
  position: absolute;
  width: 0;
  height: 0;
  line-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.cropper-center::before,
.cropper-center::after {
  content: ' ';
  position: absolute;
  display: block;
  width: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
  top: 0;
  left: -10px;
}

.cropper-center::after {
  width: 1px;
  height: 20px;
  top: -10px;
  left: 0;
}

.cropper-face,
.cropper-line,
.cropper-point {
  position: absolute;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.cropper-face {
  cursor: move;
  background: rgba(255, 255, 255, 0.1);
}

.cropper-line {
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.cropper-point {
  width: 5px;
  height: 5px;
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.5);
}

.cropper-modal + .cropper-guides .cropper-guide,
.cropper-modal + .cropper-guides .cropper-dashed,
.cropper-modal + .cropper-guides .cropper-center,
.cropper-modal + .cropper-guides .cropper-face,
.cropper-modal + .cropper-guides .cropper-line,
.cropper-modal + .cropper-guides .cropper-point {
  display: block;
}

/* ── Responsive Design ────────────────────────────────────── */

@media (max-width: 480px) {
  .profile-page {
    padding: var(--sp-md);
    gap: var(--sp-lg);
  }

  .profile-photo-section,
  .profile-info-section {
    padding: var(--sp-md);
  }

  .profile-field-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-edit-btn {
    align-self: flex-start;
  }

  .crop-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 8px 8px 0 0;
  }

  .crop-modal-body {
    min-height: 300px;
  }

  .crop-preview {
    max-height: 300px;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-actions .cmp-btn {
    width: 100%;
  }
}
