/* public/components/profile-page/profile-page.css */

.profile-page-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* Header & Title */
.profile-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 4px;
}

.profile-page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.profile-page-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 3px 0 0 0;
}

.profile-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* URL Banner Card */
.profile-url-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.05)) !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  border-radius: var(--r-md);
  padding: 14px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.url-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}

.url-banner-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.url-banner-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 700;
}

.url-banner-link {
  font-family: var(--font-mono, monospace);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  margin-top: 2px;
  word-break: break-all;
}

.url-banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Live Card Preview */
.pp-live-preview-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  position: relative;
}

.pp-cover-header {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  transition: background 300ms ease;
}

.pp-avatar-wrapper {
  position: absolute;
  bottom: -36px;
  right: 24px;
  width: 80px;
  height: 80px;
}

.pp-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  border: 4px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pp-custom-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.pp-online-dot {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--surface);
  box-shadow: 0 0 8px #10b981;
}

.pp-preview-body {
  padding: 50px 24px 24px 24px;
}

.pp-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pp-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px 0;
}

.pp-job-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.pp-bio {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.pp-skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.pp-skills-grid .skill-badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 700;
}

.pp-trust-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.pp-trust-item {
  font-size: 11.5px;
  color: var(--text-2);
}

.pp-trust-item strong {
  color: var(--text);
  font-weight: 800;
}

/* Username Group */
.username-input-group {
  display: flex;
  align-items: center;
  width: 100%;
}

.username-prefix {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-inline-end: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 700;
  white-space: nowrap;
}

.username-input-group .field-input {
  border-radius: 0 var(--r-sm) var(--r-sm) 0 !important;
  flex: 1;
}

/* Color Swatches */
.pp-swatches-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.pp-color-opt {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.pp-color-opt:hover {
  transform: scale(1.15);
}

.pp-color-opt.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 12px var(--brand);
  transform: scale(1.15);
}

.pp-custom-color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease, color 150ms ease;
}

.pp-custom-color-btn:hover {
  transform: scale(1.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.pp-custom-color-btn.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 12px var(--brand, #00E5FF);
  transform: scale(1.15);
}

.pp-custom-color-popover {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  width: 230px;
  max-width: calc(100vw - 40px);
}

.pp-custom-color-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pp-custom-color-popover-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
}

.pp-custom-color-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.pp-custom-color-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.pp-custom-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pp-native-color-input {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  padding: 2px;
  flex-shrink: 0;
}

.pp-custom-hex-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: monospace;
  font-size: 13px;
  color: #ffffff;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s ease;
}

.pp-custom-hex-input:focus {
  border-color: var(--brand, #00E5FF);
}

.pp-custom-color-feedback {
  font-size: 11px;
  color: #f87171;
  margin-top: 6px;
}

/* Bento Stats */
.pp-stat-bento {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  text-align: center;
}

.pp-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
  font-family: var(--font-mono, monospace);
}

.pp-stat-num.green-text {
  color: #10b981;
}

.pp-stat-lbl {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 700;
  margin-top: 2px;
}

/* Section Accordion Rows */
.profile-section-row {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: border-color 150ms ease;
}

.profile-section-row:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.profile-section-row .section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  user-select: none;
}

.profile-section-row .sec-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.profile-section-row .sec-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
}

.visibility-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 700;
}

.visibility-checkbox-label input {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.profile-section-row .chevron {
  font-size: 10px;
  color: var(--text-2);
  transition: transform 200ms ease;
}

.profile-section-row .section-body {
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
  border-top: 1px solid var(--border);
}

/* Unsaved Changes Indicator */
.unsaved-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.unsaved-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

/* Save Main Button */
.pp-save-main-btn {
  width: 100%;
  padding: 14px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  height: 48px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px var(--brand-soft) !important;
}

@media (max-width: 900px) {
  .profile-page-main-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Template selector preview button */
.pp-tmpl-opt {
  position: relative;
}

.pp-tmpl-preview-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pp-tmpl-preview-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.1);
}

[dir="rtl"] .pp-tmpl-preview-btn {
  right: auto;
  left: 6px;
}

/* Phone & WhatsApp Input Group */
.pp-phone-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.pp-phone-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.pp-phone-dial-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 8px 12px;
  background: var(--card-2, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: var(--r-sm, 8px);
  color: var(--text, #f1f5f9);
  font-size: 13px;
  font-weight: 700;
  direction: ltr;
  user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pp-phone-input {
  flex: 1;
  min-width: 0;
  direction: ltr;
  text-align: start;
}

.pp-phone-preview {
  font-size: 11.5px;
  line-height: 1.4;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  word-break: break-word;
  box-sizing: border-box;
}

.pp-phone-preview.valid {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.pp-phone-preview.invalid {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

@media (max-width: 480px) {
  .pp-phone-input-wrap {
    flex-wrap: nowrap;
  }
  .pp-phone-dial-badge {
    min-width: 52px;
    padding: 8px 8px;
    font-size: 12px;
  }
  #pp-phone-country,
  #pp-edit-country {
    font-size: 12px;
  }
}

#pp-phone-country,
#pp-edit-country {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

