:root {
  --bg: #001d13;
  --bg2: #00311f;
  --panel: rgba(0, 54, 34, .82);
  --panel2: rgba(0, 35, 23, .88);
  --line: rgba(218, 151, 36, .45);
  --gold: #e8a72d;
  --gold2: #ffbd35;
  --text: #fff7e8;
  --muted: rgba(255, 247, 232, .72);
  --soft: rgba(255, 255, 255, .08);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 30% 0%, rgba(0, 97, 60, .42), transparent 42%),
    linear-gradient(180deg, #002f1f 0%, #00170f 100%);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

.profile-desktop-app {
  min-height: 100vh;
  padding-bottom: 24px;
}

.profile-desktop-topbar {
  height: 78px;
  padding: 0 58px;
  border-bottom: 1px solid rgba(218, 151, 36, .28);
  background: rgba(0, 22, 15, .78);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: 230px auto minmax(340px, 480px) auto;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.profile-logo-link img {
  width: 195px;
  display: block;
}

.profile-main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
}

.profile-main-nav a {
  text-decoration: none;
  color: rgba(255,255,255,.86);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 27px 0;
  border-bottom: 2px solid transparent;
}

.profile-main-nav a.active {
  color: #fff;
  border-bottom-color: var(--gold);
}

.profile-search {
  height: 48px;
  border: 1px solid rgba(218,151,36,.45);
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 48px;
  background: rgba(255,255,255,.04);
  overflow: hidden;
}

.profile-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 0 18px;
  font-size: 15px;
}

.profile-search input::placeholder {
  color: rgba(255,255,255,.45);
}

.profile-search button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

.profile-top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-end;
}

.profile-top-actions button {
  position: relative;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.profile-top-actions b {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--gold2);
  color: #1b1200;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.profile-mini-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--gold);
}

.profile-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-layout {
  width: min(1780px, calc(100vw - 96px));
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
}

.profile-left {
  min-width: 0;
}

.profile-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(218,151,36,.32);
  border-bottom: 0;
  background:
    linear-gradient(90deg, rgba(0,35,23,.92), rgba(0,64,40,.78)),
    radial-gradient(circle at 70% 50%, rgba(218,151,36,.13), transparent 42%);
}

.profile-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: .2;
  background:
    radial-gradient(circle at 10% 20%, rgba(218,151,36,.25), transparent 18%),
    linear-gradient(135deg, transparent 0 45%, rgba(218,151,36,.12) 45% 46%, transparent 46%);
  pointer-events: none;
}

.profile-hero-inner {
  position: relative;
  z-index: 1;
  min-height: 330px;
  display: grid;
  grid-template-columns: 390px 1fr;
  align-items: center;
  gap: 36px;
  padding: 34px 64px;
}

.profile-photo-wrap {
  position: relative;
  width: 230px;
  height: 230px;
  justify-self: center;
}

#viewerPhoto {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 4px solid var(--gold2);
  object-fit: cover;
  background: #fff4d8;
  box-shadow: 0 16px 50px rgba(0,0,0,.36);
}

#editPhotoBtn {
  position: absolute;
  right: 9px;
  bottom: 15px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--gold2);
  background: #00633d;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.profile-info-block h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 46px;
  line-height: 1.05;
  display: flex;
  align-items: center;
  gap: 14px;
}

.verified-badge {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--gold2);
  color: #1c1200;
  font-size: 18px;
  display: inline-grid;
  place-items: center;
  font-family: Arial, sans-serif;
}

.profile-handle {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 20px;
}

.profile-bio {
  margin: 0 0 20px;
  font-size: 19px;
  color: #fff;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 620px;
  margin: 0 0 22px;
}

.profile-stats article {
  text-align: center;
  border-right: 1px solid rgba(218,151,36,.35);
}

.profile-stats article:last-child {
  border-right: 0;
}

.stat-icon {
  display: block;
  color: var(--gold2);
  font-size: 24px;
  margin-bottom: 4px;
}

.profile-stats strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.profile-stats small {
  display: block;
  color: rgba(255,255,255,.78);
  font-size: 16px;
  margin-top: 3px;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 540px;
}

.profile-actions button {
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: rgba(0,50,32,.55);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.profile-content-card {
  border: 1px solid rgba(218,151,36,.32);
  border-radius: 0 0 18px 18px;
  background: rgba(0,29,19,.62);
  overflow: hidden;
}

.profile-tabs {
  height: 54px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(218,151,36,.35);
}

.profile-tabs button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.profile-tabs button.active {
  color: var(--gold2);
  border-bottom-color: var(--gold2);
}

.profile-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.profile-post {
  position: relative;
  height: 215px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(218,151,36,.38);
  text-decoration: none;
  color: #fff;
}

.profile-post img,
.profile-post video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.75));
}

.post-info {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
}

.post-info h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.22;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}

.post-info small {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,.80);
  font-size: 12px;
}

.profile-loading,
.profile-empty {
  grid-column: 1 / -1;
  min-height: 190px;
  border: 1px dashed rgba(218,151,36,.35);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.profile-load-more {
  padding: 8px 0 18px;
  display: grid;
  place-items: center;
}

.profile-load-more button {
  height: 38px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: rgba(0,50,32,.55);
  color: var(--gold2);
  font-weight: 900;
  cursor: pointer;
}

.profile-right {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-card {
  border: 1px solid rgba(218,151,36,.38);
  border-radius: 14px;
  background: rgba(0, 47, 31, .72);
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  padding: 22px;
}

.side-card header,
.side-card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.side-card h2 {
  margin: 0 0 18px;
  color: var(--gold2);
  font-size: 19px;
}

.side-card header h2 {
  margin: 0;
}

.side-card header a {
  color: var(--gold2);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}

.about-card p {
  color: rgba(255,255,255,.86);
  line-height: 1.65;
  margin: 0;
}

.side-line {
  height: 1px;
  background: rgba(218,151,36,.25);
  margin: 18px 0;
}

.side-meta {
  color: rgba(255,255,255,.84) !important;
  margin-top: 12px !important;
}

.highlight-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.highlight-item {
  text-align: center;
  text-decoration: none;
}

.highlight-item img,
.highlight-item video {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: #000;
}

.highlight-item span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #fff;
}

.playlist-list {
  display: grid;
  gap: 12px;
}

.playlist-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(218,151,36,.18);
}

.playlist-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.playlist-item img,
.playlist-item video {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.playlist-item strong {
  display: block;
  font-size: 15px;
}

.playlist-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.side-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 0;
}

.profile-bottom-nav {
  display: none;
}

.viewer-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.viewer-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,20,12,.76);
  backdrop-filter: blur(8px);
}

.viewer-auth-card {
  position: relative;
  width: min(520px, 100%);
  background: #fff;
  color: #111;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 34px 100px rgba(0,0,0,.42);
}

.viewer-auth-card h2 {
  margin: 0;
  color: #003d24;
}

.google-auth-btn,
.auth-submit {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  border: 0;
  font-weight: 950;
  cursor: pointer;
}

.google-auth-btn {
  background: #fff;
  color: #111;
  border: 1px solid rgba(0,0,0,.18);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #6b7280;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(0,0,0,.12);
  flex: 1;
}

#authForm {
  display: grid;
  gap: 14px;
}

#authForm label {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

#authForm input {
  min-height: 46px;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 10px;
  padding: 0 14px;
}

.auth-submit {
  background: linear-gradient(135deg, #004b2b, #006536);
  color: #fff;
}

.auth-status {
  display: none;
  padding: 11px 13px;
  border-radius: 10px;
  font-weight: 900;
}

.auth-status.show { display: block; }
.auth-status.error { color: #991b1b; background: #fee2e2; }
.auth-status.success { color: #065f46; background: #dcfce7; }

.auth-switch {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #004b2b;
  font-weight: 950;
  cursor: pointer;
  margin-top: 12px;
}

.auth-note {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .profile-desktop-topbar {
    grid-template-columns: 190px 1fr auto;
    padding: 0 18px;
  }

  .profile-main-nav,
  .profile-top-actions {
    display: none;
  }

  .profile-layout {
    width: min(980px, calc(100vw - 28px));
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .profile-right {
    display: none;
  }

  .profile-hero-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 24px 18px;
    text-align: center;
  }

  .profile-info-block h1 {
    justify-content: center;
    font-size: 38px;
  }

  .profile-stats {
    margin-left: auto;
    margin-right: auto;
  }

  .profile-actions {
    margin-left: auto;
    margin-right: auto;
  }

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

  .profile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(76px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(0,0,0,.96);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 80;
  }

  .profile-bottom-nav a {
    text-decoration: none;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.78);
    font-weight: 800;
    padding-top: 8px;
  }

  .profile-bottom-nav span {
    font-size: 28px;
    line-height: 1;
  }

  .profile-bottom-nav small {
    font-size: 12px;
  }

  .profile-bottom-nav a.active {
    color: var(--gold2);
  }

  .profile-desktop-app {
    padding-bottom: 100px;
  }
}

@media (max-width: 760px) {
  .profile-logo-link img {
    width: 150px;
  }

  .profile-search {
    height: 42px;
  }

  .profile-photo-wrap,
  #viewerPhoto {
    width: 170px;
    height: 170px;
  }

  #editPhotoBtn {
    width: 46px;
    height: 46px;
  }

  .profile-stats strong {
    font-size: 24px;
  }

  .profile-stats small {
    font-size: 14px;
  }

  .profile-actions {
    grid-template-columns: 1fr;
  }

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

  .profile-post {
    height: 240px;
  }
}

/* BADAWY REALTIME LIVE PROFILE BADGE */
.profile-live-panel {
  margin: 14px 0;
  border: 1px solid rgba(255, 45, 85, .65);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0 0, rgba(255,45,85,.18), transparent 34%),
    rgba(0, 34, 22, .88);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  overflow: hidden;
}

.profile-live-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.profile-live-head strong {
  color: #fff;
  font-weight: 950;
  font-size: 18px;
}

.profile-live-head small {
  margin-left: auto;
  background: #ff2d55;
  color: white;
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 950;
}

.live-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ff2d55;
  box-shadow: 0 0 0 0 rgba(255,45,85,.8);
  animation: livePulse 1.15s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(255,45,85,.8); }
  80% { box-shadow: 0 0 0 14px rgba(255,45,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,85,0); }
}

.profile-live-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.profile-live-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
}

.profile-live-item img {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 2px solid #ff2d55;
  object-fit: cover;
  background: #fff;
}

.profile-live-item b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 15px;
}

.profile-live-item b span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff2d55;
}

.profile-live-item p {
  margin: 4px 0;
  color: rgba(255,255,255,.82);
}

.profile-live-item small {
  color: rgba(255,255,255,.62);
  font-weight: 800;
}

.profile-live-item a {
  min-height: 38px;
  padding: 0 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #ff2d55;
  color: white;
  text-decoration: none;
  font-weight: 950;
}

@media (max-width: 760px) {
  .profile-live-panel {
    margin: 12px 14px;
  }

  .profile-live-item {
    grid-template-columns: 48px 1fr;
  }

  .profile-live-item a {
    grid-column: 1 / -1;
  }
}
