/* =============================================================================
   PROFILE PAGE STYLES - ParlayBuilder
   ============================================================================= */

/* Profile root container - hidden by default */
#profile-root {
  display: none;
  min-height: 100vh;
  background: var(--bg-base, #0a1628);
}

#profile-root:empty {
  display: none;
}

/* When profile is active, hide everything else and show profile */
body.profile-active #profile-root {
  display: block !important;
}

body.profile-active .navbar,
body.profile-active #cover-page,
body.profile-active .workbench-layout,
body.profile-active .sidebar,
body.profile-active #main-app-wrapper {
  display: none !important;
}

/* Show landing-nav on profile - fixed at top (same as dashboard) */
body.profile-active .landing-nav {
  display: block !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
}

/* Keep bottom nav visible on profile */
body.profile-active .pb-bottom-nav {
  display: flex !important;
}

body.profile-active {
  padding-bottom: calc(var(--pb-bottom-nav-height, 64px) + max(env(safe-area-inset-bottom), 12px));
}

.profile-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
  padding-top: calc(70px + env(safe-area-inset-top, 0px));
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.profile-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-80, #e8ffe9);
  text-decoration: none;
  transition: all 0.2s ease;
}

.profile-back:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 211, 189, 0.3);
  color: var(--theme-accent, #00D3BD);
}

.profile-title {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

/* Profile tabs */
.profile-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

.profile-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--ink-60, #b4d7c4);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-tab:hover {
  color: var(--ink-80, #e8ffe9);
}

.profile-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-100, #ffffff);
}

/* Stats tab content */
#profile-rank-overview {
  margin-bottom: 16px;
}

#profile-rank-overview .rank-overview-card {
  margin-bottom: 0;
  background: #060e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#profile-stat-cards {
  margin-bottom: 16px;
}

#profile-stat-cards .desktop-stat-cards {
  grid-template-columns: repeat(3, 1fr);
}

#profile-rr-chart {
  margin-bottom: 24px;
}

.profile-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--theme-gradient-primary, linear-gradient(135deg, #00D3BD 0%, #00AD84 100%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: #000;
  margin: 0 auto 24px;
}

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

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

.profile-form .form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-60, #b4d7c4);
}

.profile-form .form-input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-100, #ffffff);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.profile-form .form-input:focus {
  outline: none;
  border-color: var(--theme-accent, #00D3BD);
  box-shadow: 0 0 0 3px rgba(0, 211, 189, 0.1);
}

.profile-form .form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-form .form-input::placeholder {
  color: var(--ink-40, #7a9f8c);
}

.profile-form .form-hint {
  font-size: 12px;
  color: var(--ink-40, #7a9f8c);
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.profile-page .btn {
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.profile-page .btn-primary {
  background: var(--theme-gradient-primary, linear-gradient(135deg, #00F5D4 0%, #00D3BD 50%, #00AD84 100%));
  color: #000;
}

.profile-page .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 211, 189, 0.3);
}

.profile-page .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.profile-page .btn-danger {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.profile-page .btn-danger:hover {
  background: rgba(231, 76, 60, 0.2);
}

.profile-status {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
  display: none;
}

.profile-status.success {
  display: block;
  background: rgba(0, 211, 189, 0.1);
  border: 1px solid rgba(0, 211, 189, 0.3);
  color: #00D3BD;
}

.profile-status.error {
  display: block;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.profile-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-60, #b4d7c4);
}

.profile-not-logged-in {
  text-align: center;
  padding: 60px 20px;
}

.profile-not-logged-in h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.profile-not-logged-in p {
  margin: 0 0 24px;
  color: var(--ink-60, #b4d7c4);
}

.profile-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--ink-100, #ffffff);
}

.profile-card.danger-zone {
  border-color: rgba(231, 76, 60, 0.2);
}

.profile-card.danger-zone .profile-section-title {
  color: #e74c3c;
}

.danger-zone-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-page .btn-danger-destructive {
  background: #e74c3c;
  border: 1px solid #c0392b;
  color: #fff;
}

.profile-page .btn-danger-destructive:hover {
  background: #c0392b;
}

.profile-page .btn-danger-destructive:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive — tablet and mobile */
@media (max-width: 1000px) {
  .profile-page {
    max-width: 100%;
    padding: 32px;
    padding-top: calc(70px + env(safe-area-inset-top, 0px) + 48px);
  }

  .profile-header {
    margin-bottom: 48px;
  }

  .profile-title {
    font-size: 36px;
  }

  .profile-back {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .profile-tabs {
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 32px;
  }

  .profile-tab {
    padding: 12px 0;
    font-size: 17px;
    border-radius: 10px;
  }

  #profile-stat-cards .desktop-stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-card {
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 32px;
  }

  .profile-avatar {
    width: 110px;
    height: 110px;
    font-size: 44px;
    margin-bottom: 32px;
  }

  .profile-form {
    gap: 32px;
  }

  .profile-form .form-group {
    gap: 10px;
  }

  .profile-form .form-label {
    font-size: 20px;
  }

  .profile-form .form-input {
    padding: 22px 24px;
    font-size: 22px;
    border-radius: 16px;
  }

  .profile-form .form-hint {
    font-size: 16px;
  }

  .profile-page .btn {
    padding: 18px 32px;
    font-size: 19px;
    border-radius: 14px;
  }

  .profile-section-title {
    font-size: 22px;
    margin-bottom: 24px;
  }

  .danger-zone-actions {
    gap: 16px;
  }

  .profile-status {
    padding: 16px 20px;
    font-size: 17px;
    border-radius: 12px;
  }

  .profile-loading {
    padding: 80px 24px;
    font-size: 18px;
  }

  .profile-not-logged-in {
    padding: 80px 24px;
  }

  .profile-not-logged-in h2 {
    font-size: 30px;
  }

  .profile-not-logged-in p {
    font-size: 18px;
  }
}
