/* ===== AM Creator — Profile Redesign (update.md) ===== */

#screen-profile .profile-container {
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  padding-top: 4px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 1024px) {
  #screen-profile .profile-container {
    width: min(100% - 64px, 1180px);
    gap: 22px;
  }
}

/* page title */
#screen-profile .dashboard-header {
  margin: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

/* generic card (header, account info, security) */
#screen-profile .profile-card {
  background: var(--card-bg, rgba(15, 23, 42, .6));
  border: 1px solid var(--border, rgba(255, 255, 255, .08));
  border-radius: 20px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .20);
  padding: 20px;
}
@media (min-width: 1024px) {
  #screen-profile .profile-card { padding: 26px; }
}

/* ===== HEADER ===== */
#screen-profile .profile-header {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: auto;
  max-height: none;
}
#screen-profile .profile-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
#screen-profile #profile-avatar-circle,
#screen-profile .profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 8px 22px rgba(99, 102, 241, .45);
  text-transform: uppercase;
}
#screen-profile .profile-header-meta { flex: 1 1 auto; min-width: 0; }
#screen-profile .profile-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#screen-profile #profile-username,
#screen-profile .profile-name {
  margin: 0;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary, #e5e7eb);
}
#screen-profile .profile-verified-badge { flex-shrink: 0; }
#screen-profile .profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 2px;
}
#screen-profile .pc-pill {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(129, 140, 248, .16);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, .35);
  display: inline-flex;
  align-items: center;
}
#screen-profile .pc-pill-lifetime {
  background: rgba(16, 185, 129, .15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, .35);
}
#screen-profile .pc-pill-active {
  background: rgba(34, 197, 94, .15);
  color: #86efac;
  border-color: rgba(34, 197, 94, .35);
}
#screen-profile .profile-header-role {
  font-size: .86rem;
  color: var(--text-secondary, #94a3b8);
}
#screen-profile .profile-header-since {
  font-size: .78rem;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}
#screen-profile .profile-actions,
#screen-profile .profile-header-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
#screen-profile .profile-header-actions .btn {
  padding: 10px 14px;
  font-size: .85rem;
  min-height: 48px;
}
#screen-profile .pc-logout-btn {
  color: var(--ds-danger, #be123c);
  border-color: rgba(190, 18, 60, .5);
  background: transparent;
}
#screen-profile .pc-logout-btn:hover {
  background: rgba(190, 18, 60, .10);
}

/* ===== OVERVIEW GRID ===== */
#screen-profile .overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
#screen-profile .overview-card {
  background: var(--card-bg, rgba(15, 23, 42, .6));
  border: 1px solid var(--border, rgba(255, 255, 255, .08));
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}
#screen-profile .overview-label {
  font-size: .66rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted, #64748b);
}
#screen-profile .overview-value {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 6px;
  color: var(--text-primary, #e5e7eb);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== SECTION HEAD ===== */
#screen-profile .pc-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
#screen-profile .pc-sh-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
#screen-profile .pc-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #e5e7eb);
}
#screen-profile .pc-section-head p {
  margin: 2px 0 0;
  font-size: .8rem;
  color: var(--text-secondary, #94a3b8);
}

/* ===== ACCOUNT INFO ===== */
#screen-profile .pc-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 768px) {
  #screen-profile .pc-info-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 30px;
  }
}
#screen-profile .pc-info .pinfo-colon-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, .08));
}
#screen-profile .pc-info .pinfo-colon-label {
  color: var(--text-secondary, #94a3b8);
}
#screen-profile .pc-info .pinfo-colon-value {
  color: var(--text-primary, #e5e7eb);
  font-weight: 600;
}

/* ===== SPLIT (API KEY + SECURITY) ===== */
#screen-profile .profile-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}
@media (min-width: 1024px) {
  #screen-profile .profile-split { gap: 22px; }
}

/* security card specifics */
#screen-profile .profile-security .pc-sec-desc {
  margin: 0 0 14px;
  font-size: .85rem;
  color: var(--text-secondary, #94a3b8);
}
#screen-profile .profile-security .pc-field-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  margin: 12px 0 6px;
}
#screen-profile .profile-security .profile-api-key-field {
  width: 100%;
}
#screen-profile .profile-security .profile-api-key-field input {
  width: 100%;
  box-sizing: border-box;
}
#screen-profile .profile-security .profile-api-actions {
  width: 100%;
  margin-top: 16px;
}
#screen-profile .profile-security #btn-reset-password {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

/* API key field: prevent horizontal scroll */
#screen-profile #profile-apikey-section .profile-api-key-field {
  overflow: hidden;
}
#screen-profile #profile-apikey-section .profile-api-key-field input {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

/* ===== MOBILE TUNING ===== */
@media (max-width: 640px) {
  #screen-profile #profile-avatar-circle,
  #screen-profile .profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.75rem;
  }
  #screen-profile .profile-actions,
  #screen-profile .profile-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  #screen-profile .profile-header-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 48px;
  }
  #screen-profile .overview-value { font-size: .98rem; }
}

/* Pro plan card accent (global, di luar scope #screen-profile) */
.plan-card-pro { border-color: var(--ds-accent-line) !important; }
.plan-card-pro::before { background: var(--ds-gradient) !important; }
