/* ============================================================
   Rishta Helpers UK — Design System
   Colors extracted from logo: Deep Purple + Gold
   ============================================================ */

:root {
  --purple-900: #1A0825;
  --purple-800: #2D0F45;
  --purple-700: #3D1263;
  --purple-600: #5C1D96;
  --purple-500: #7B45B8;
  --purple-400: #9B6DC0;
  --purple-300: #BB99D8;
  --purple-200: #DCC5EC;
  --purple-100: #F2EBF8;
  --purple-50:  #FAF6FD;

  --gold-700:  #8A6A1A;
  --gold-600:  #A8832A;
  --gold-500:  #D4A843;
  --gold-400:  #E0BC62;
  --gold-300:  #EDD08A;
  --gold-200:  #F5E4B4;
  --gold-100:  #FBF4DC;

  --cream:      #FFF8F2;
  --white:      #FFFFFF;
  --text-dark:  #1A0825;
  --text-med:   #4A3060;
  --text-light: #7A6090;
  --text-muted: #A090B8;

  --success: #1a7a4a;
  --error:   #c0392b;
  --warning: #e67e22;
  --info:    var(--purple-600);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 4px rgba(61,18,99,.10);
  --shadow-md:  0 4px 16px rgba(61,18,99,.14);
  --shadow-lg:  0 8px 32px rgba(61,18,99,.18);
  --shadow-xl:  0 16px 48px rgba(61,18,99,.22);

  --transition: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--purple-800); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p  { color: var(--text-med); }
a  { color: var(--purple-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-500); }

/* ─── Layout ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.section    { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.5rem; border-radius: var(--radius-full); border: none;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition); text-decoration: none; white-space: nowrap;
  font-family: var(--font);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-500) 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(92,29,150,.35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--purple-700) 0%, var(--purple-600) 100%);
  box-shadow: 0 6px 20px rgba(92,29,150,.45); transform: translateY(-1px);
  color: #fff;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  color: var(--purple-800); box-shadow: 0 4px 14px rgba(212,168,67,.35);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-600) 0%, var(--gold-500) 100%);
  transform: translateY(-1px); color: var(--purple-900);
}
.btn-outline {
  background: transparent; color: var(--purple-600);
  border: 2px solid var(--purple-300);
}
.btn-outline:hover:not(:disabled) {
  background: var(--purple-50); border-color: var(--purple-500); color: var(--purple-700);
}
.btn-ghost {
  background: transparent; color: var(--text-med);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--purple-50); color: var(--purple-600); }
.btn-danger { background: var(--error); color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .5rem; border-radius: var(--radius-full); aspect-ratio: 1; }

/* ─── Cards ─── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 1.5rem; overflow: hidden;
}
.card-hover {
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .9rem; font-weight: 600; color: var(--text-dark); margin-bottom: .4rem; }
.form-label span { color: var(--error); margin-left: .15rem; }
.form-control {
  width: 100%; padding: .7rem 1rem; border-radius: var(--radius-md);
  border: 2px solid var(--purple-200); background: var(--white);
  font-size: .95rem; color: var(--text-dark); font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(123,69,184,.15); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--purple-50); color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--error); margin-top: .3rem; display: none; }
.form-error.show { display: block; }

/* ─── Navigation ─── */
#navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--purple-200);
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 1.25rem; max-width: 1200px; margin: 0 auto;
}
.navbar-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.navbar-logo img { height: 40px; width: auto; }
.navbar-logo-text { font-size: 1.1rem; font-weight: 800; color: var(--purple-700); line-height: 1.2; }
.navbar-logo-text span { display: block; font-size: .7rem; font-weight: 500; color: var(--gold-500); }
.navbar-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  padding: .5rem .85rem; border-radius: var(--radius-full);
  font-size: .9rem; font-weight: 500; color: var(--text-med);
  transition: all var(--transition); position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--purple-600); background: var(--purple-50); }
.nav-link .badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--gold-500); color: var(--purple-900);
  font-size: .65rem; font-weight: 700; border-radius: var(--radius-full);
  min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.navbar-actions { display: flex; align-items: center; gap: .5rem; }
.navbar-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem; cursor: pointer;
  border: 2px solid var(--purple-200); overflow: hidden;
}
.navbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: .4rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--purple-700); border-radius: 2px; transition: all var(--transition); }
.mobile-menu {
  display: none; position: fixed; inset: 64px 0 0; background: var(--white);
  z-index: 99; padding: 1rem; overflow-y: auto;
  flex-direction: column; gap: .5rem;
}
.mobile-menu.open { display: flex; }
.mobile-nav-link {
  padding: .85rem 1rem; border-radius: var(--radius-md); font-size: 1rem;
  font-weight: 500; color: var(--text-med); display: flex; align-items: center; gap: .75rem;
}
.mobile-nav-link:hover, .mobile-nav-link.active { background: var(--purple-50); color: var(--purple-600); }

/* ─── Islamic Decorative Elements ─── */
.arch-border {
  border: 3px solid var(--gold-500);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  padding: 2rem;
}
.divider-ornament {
  display: flex; align-items: center; gap: 1rem; margin: 2rem 0;
  color: var(--gold-500); font-size: 1.2rem;
}
.divider-ornament::before, .divider-ornament::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}
.star-accent { color: var(--gold-500); }
.crescent { font-size: 1.2em; color: var(--gold-500); }

/* ─── Hero Section ─── */
.hero {
  background: linear-gradient(160deg, var(--purple-800) 0%, var(--purple-600) 50%, var(--purple-500) 100%);
  color: #fff; padding: 5rem 0 4rem; position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(212,168,67,.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(212,168,67,.1) 0%, transparent 40%);
  pointer-events: none;
}
.hero-pattern {
  position: absolute; inset: 0; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff' fill-opacity='1'%3E%3Cpath d='M30 0L37.5 22.5H60L41.25 36.25L48.75 60L30 46.25L11.25 60L18.75 36.25L0 22.5H22.5Z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 720px; margin: 0 auto; }
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.15rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; }
.hero-tagline {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(212,168,67,.2); border: 1px solid rgba(212,168,67,.4);
  color: var(--gold-300); padding: .4rem 1rem; border-radius: var(--radius-full);
  font-size: .85rem; font-weight: 600; margin-bottom: 1.5rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 2rem; justify-content: center; margin-top: 3rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 2rem; font-weight: 800; color: var(--gold-400); display: block; line-height: 1; }
.hero-stat-label { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: .3rem; }

/* ─── Feature Cards ─── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.feature-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 1.75rem;
  border: 1px solid var(--purple-100); box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.feature-card:hover { border-color: var(--gold-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--purple-100), var(--purple-50));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem; border: 1px solid var(--purple-200);
}
.feature-title { font-size: 1.05rem; font-weight: 700; color: var(--purple-800); margin-bottom: .5rem; }
.feature-desc { font-size: .9rem; color: var(--text-light); line-height: 1.6; }

/* ─── Profile Cards (Browse) ─── */
.profiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.profile-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--purple-100);
  transition: all var(--transition); cursor: pointer;
}
.profile-card:hover { box-shadow: var(--shadow-md); border-color: var(--purple-300); transform: translateY(-2px); }
.profile-card-photo {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
  display: flex; align-items: center; justify-content: center; position: relative;
}
.profile-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-card-avatar {
  width: 80px; height: 80px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; color: #fff;
}
.profile-card-badges {
  position: absolute; top: .75rem; right: .75rem;
  display: flex; gap: .35rem; flex-direction: column; align-items: flex-end;
}
.badge-verified {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--purple-900); font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: var(--radius-full);
  display: flex; align-items: center; gap: .25rem;
}
.badge-premium {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: var(--radius-full);
}
.badge-trial {
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff; font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: var(--radius-full);
}
.badge-online {
  width: 10px; height: 10px; background: #2ecc71; border-radius: 50%;
  border: 2px solid #fff; position: absolute; bottom: .5rem; left: .5rem;
}
.profile-card-body { padding: 1rem; }
.profile-card-name { font-size: 1.05rem; font-weight: 700; color: var(--purple-800); }
.profile-card-meta { font-size: .85rem; color: var(--text-light); margin-top: .2rem; }
.profile-card-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.tag {
  font-size: .75rem; padding: .2rem .65rem; border-radius: var(--radius-full);
  background: var(--purple-50); color: var(--purple-600); border: 1px solid var(--purple-200);
}
.tag-gold  { background: var(--gold-100);  color: var(--gold-700);  border-color: var(--gold-300); }
.tag-trial { background: #ccfbf1; color: #0f766e; border-color: #5eead4; }
.adrop-item {
  display: block; width: 100%; text-align: left;
  padding: .6rem 1.1rem; background: none; border: none;
  cursor: pointer; font-size: .88rem; color: var(--text-dark);
  font-weight: 500; line-height: 1.4; white-space: nowrap; flex-shrink: 0;
}
.adrop-item:hover:not(:disabled) { background: var(--purple-50); color: var(--purple-700); }
.adrop-item:disabled { opacity: .45; cursor: not-allowed; }
.adrop-sep { height: 1px; background: var(--purple-100); margin: .25rem 0; flex-shrink: 0; }
.profile-card-actions {
  padding: .75rem 1rem; border-top: 1px solid var(--purple-100);
  display: flex; gap: .5rem;
}

/* ─── Browse Filters ─── */
.browse-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
.browse-layout.filters-open { grid-template-columns: 280px 1fr; }
.filter-panel {
  display: none;
  background: var(--white); border-radius: var(--radius-lg); padding: 1.25rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--purple-100);
  position: sticky; top: 80px;
}
.filter-panel.open { display: block; }
.filter-title { font-size: 1rem; font-weight: 700; color: var(--purple-800); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.filter-group { margin-bottom: 1rem; }
.filter-label { font-size: .8rem; font-weight: 600; color: var(--text-med); margin-bottom: .4rem; display: block; text-transform: uppercase; letter-spacing: .05em; }
.range-display { font-size: .85rem; color: var(--purple-600); font-weight: 600; text-align: center; margin-top: .3rem; }
input[type=range] {
  width: 100%; accent-color: var(--purple-600); cursor: pointer;
}
.filter-checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text-med); cursor: pointer; }
.filter-checkbox input { accent-color: var(--purple-600); width: 16px; height: 16px; cursor: pointer; }

/* ─── Chat ─── */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 128px); gap: 0; background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.chat-list { border-right: 1px solid var(--purple-100); overflow-y: auto; }
.chat-list-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--purple-100); font-weight: 700; color: var(--purple-800); font-size: 1.05rem; }
.chat-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem; cursor: pointer; transition: background var(--transition);
  border-bottom: 1px solid var(--purple-100);
}
.chat-item:hover, .chat-item.active { background: var(--purple-50); }
.chat-item-avatar {
  width: 48px; height: 48px; border-radius: var(--radius-full); flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 1rem; overflow: hidden; position: relative;
}
.chat-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Two-row body — WhatsApp style */
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top  { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; margin-bottom: .18rem; }
.chat-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.chat-item-name { font-size: .92rem; font-weight: 600; color: var(--purple-800); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-time { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.chat-item-preview { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-unread {
  background: var(--purple-600); color: #fff; border-radius: var(--radius-full);
  font-size: .68rem; font-weight: 700; min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0 4px;
}
.chat-window { display: flex; flex-direction: column; }
.chat-window-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--purple-100);
  display: flex; align-items: center; gap: .75rem; background: var(--white);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-direction: column; gap: 1rem; font-size: .9rem; }
.msg-row { display: flex; }
.msg-row.sent  { justify-content: flex-end; }
.msg-row.recv  { justify-content: flex-start; }
.msg-bubble {
  max-width: 65%; padding: .65rem 1rem; border-radius: 18px;
  font-size: .9rem; line-height: 1.5; word-break: break-word;
}
.msg-row.sent .msg-bubble {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: #fff; border-bottom-right-radius: 4px;
}
.msg-row.recv .msg-bubble {
  background: var(--purple-50); color: var(--text-dark);
  border: 1px solid var(--purple-100); border-bottom-left-radius: 4px;
}
.msg-time { font-size: .7rem; opacity: .65; margin-top: .25rem; text-align: right; }
.chat-input-area {
  padding: 1rem 1.25rem; border-top: 1px solid var(--purple-100);
  display: flex; gap: .75rem; align-items: flex-end; background: var(--white);
}
.chat-input {
  flex: 1; padding: .65rem 1rem; border-radius: var(--radius-lg);
  border: 2px solid var(--purple-200); font-family: var(--font); font-size: .95rem;
  resize: none; max-height: 120px; outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--purple-500); }

/* ─── Verification & Subscription Badges ─── */
.verified-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--purple-900); font-size: .75rem; font-weight: 700;
  padding: .25rem .75rem; border-radius: var(--radius-full);
}
.subscription-banner {
  background: linear-gradient(135deg, var(--purple-700), var(--purple-600));
  color: #fff; border-radius: var(--radius-lg); padding: 1.5rem;
  text-align: center; margin: 1rem 0;
}
.subscription-banner h3 { color: var(--gold-400); }

/* ─── Pricing Cards ─── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.pricing-card {
  background: var(--white); border-radius: var(--radius-xl); padding: 2rem;
  border: 2px solid var(--purple-200); text-align: center;
  transition: all var(--transition); position: relative;
}
.pricing-card.featured {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(212,168,67,.15), var(--shadow-lg);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.pricing-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--purple-900); font-size: .75rem; font-weight: 700;
  padding: .3rem 1.25rem; border-radius: var(--radius-full);
}
.pricing-name { font-size: 1.1rem; font-weight: 700; color: var(--text-med); margin-bottom: .5rem; }
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--purple-700); line-height: 1; }
.pricing-price sup { font-size: 1rem; vertical-align: super; }
.pricing-period { font-size: .85rem; color: var(--text-muted); }
.pricing-divider { height: 1px; background: var(--purple-100); margin: 1.25rem 0; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 1.5rem; }
.pricing-features li {
  padding: .4rem 0; font-size: .9rem; color: var(--text-med);
  display: flex; align-items: center; gap: .6rem;
}
.pricing-features li::before { content: '✓'; color: var(--gold-500); font-weight: 700; flex-shrink: 0; }
.pricing-features li.no::before { content: '✗'; color: var(--text-muted); }
.pricing-features li.no { color: var(--text-muted); }

/* ─── Profile Detail Page ─── */
.profile-hero { background: linear-gradient(160deg, var(--purple-800), var(--purple-600)); padding: 2.5rem 0; }
.profile-hero-inner { display: flex; align-items: flex-end; gap: 2rem; }
.profile-hero-photo {
  width: 140px; height: 140px; border-radius: var(--radius-full);
  border: 4px solid var(--gold-500); overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700; color: #fff;
}
.profile-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero-info { color: #fff; }
.profile-hero-name { font-size: 2rem; font-weight: 800; color: #fff; }
.profile-hero-meta { color: rgba(255,255,255,.8); font-size: 1rem; margin-top: .25rem; }
.profile-section-title {
  font-size: 1rem; font-weight: 700; color: var(--purple-800);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--gold-200);
  display: flex; align-items: center; gap: .5rem;
}
.profile-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.profile-detail-item { }
.profile-detail-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.profile-detail-value { font-size: .95rem; color: var(--text-dark); font-weight: 500; }
.photo-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.photo-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); cursor: pointer; }

/* ─── Progress Bar ─── */
.progress-bar { background: var(--purple-100); border-radius: var(--radius-full); height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--purple-600), var(--gold-500)); transition: width .5s ease; }

/* ─── Steps ─── */
.steps { display: flex; justify-content: space-between; position: relative; margin-bottom: 2.5rem; }
.steps::before {
  content: ''; position: absolute; top: 18px; left: 10%; right: 10%;
  height: 2px; background: var(--purple-200); z-index: 0;
}
.step { display: flex; flex-direction: column; align-items: center; gap: .5rem; z-index: 1; flex: 1; }
.step-circle {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: var(--white); border: 2px solid var(--purple-200);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: var(--text-muted);
  transition: all var(--transition);
}
.step.active .step-circle  { background: var(--purple-600); border-color: var(--purple-600); color: #fff; }
.step.done .step-circle    { background: var(--gold-500); border-color: var(--gold-500); color: var(--purple-900); }
.step-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-align: center; }
.step.active .step-label { color: var(--purple-600); }
.step.done .step-label   { color: var(--gold-600); }

/* ─── Toast Notifications ─── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--white); border-radius: var(--radius-md); padding: .85rem 1.25rem;
  box-shadow: var(--shadow-lg); border-left: 4px solid var(--purple-600);
  font-size: .9rem; color: var(--text-dark); min-width: 260px; max-width: 360px;
  animation: slideIn .25s ease; display: flex; align-items: center; gap: .75rem;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,8,37,.6);
  backdrop-filter: blur(4px); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-xl);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(.95); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 1.5rem 1.5rem 0; display: flex; align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.2rem; color: var(--purple-800); }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 1.25rem 1.5rem 1.5rem; }

/* ─── Admin ─── */
.admin-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.stat-card   { background: var(--white); border-radius: var(--radius-lg); padding: 1.25rem; border: 1px solid var(--purple-100); }
.stat-num    { font-size: 2rem; font-weight: 800; color: var(--purple-700); line-height: 1; }
.stat-label  { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.stat-gold .stat-num { color: var(--gold-600); }
.data-table  { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: .75rem 1rem; font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--purple-100); }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--purple-50); font-size: .9rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--purple-50); }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--purple-100); margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: .75rem 1.25rem; font-size: .9rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: all var(--transition); font-family: var(--font);
}
.tab-btn.active { color: var(--purple-600); border-color: var(--purple-600); }
.tab-btn:hover:not(.active) { color: var(--text-dark); background: var(--purple-50); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Utilities ─── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-purple  { color: var(--purple-600); }
.text-gold    { color: var(--gold-600); }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .8rem; }
.font-bold    { font-weight: 700; }
.mt-1  { margin-top: .5rem;  } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1  { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex  { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.separator { height: 1px; background: var(--purple-100); margin: 1.25rem 0; }

/* ─── Page Views ─── */
.view { display: none; }
.view.active { display: block; }

/* ─── Landing Sections ─── */
.how-it-works-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; text-align: center; position: relative; }
.hiw-step { }
.hiw-num {
  width: 56px; height: 56px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: #fff; font-size: 1.4rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(92,29,150,.3);
}
.hiw-title { font-weight: 700; color: var(--purple-800); margin-bottom: .5rem; }
.hiw-desc  { font-size: .9rem; color: var(--text-light); }

/* Testimonials */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.testimonial-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.5rem; border: 1px solid var(--purple-100); }
.testimonial-stars { color: var(--gold-500); font-size: 1.1rem; margin-bottom: .75rem; }
.testimonial-text  { font-style: italic; color: var(--text-med); margin-bottom: 1rem; line-height: 1.7; }
.testimonial-author { font-weight: 700; color: var(--purple-800); font-size: .9rem; }
.testimonial-meta   { font-size: .8rem; color: var(--text-muted); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--purple-100); }
.faq-question {
  width: 100%; background: none; border: none; text-align: left;
  padding: 1.1rem 0; font-size: .95rem; font-weight: 600;
  color: var(--purple-800); cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; font-family: var(--font); gap: 1rem;
}
.faq-question span { color: var(--gold-500); font-size: 1.2rem; transition: transform var(--transition); }
.faq-question.open span { transform: rotate(45deg); }
.faq-answer { font-size: .9rem; color: var(--text-med); padding-bottom: 1rem; display: none; line-height: 1.7; }
.faq-answer.open { display: block; }

/* Footer */
footer {
  background: var(--purple-900); color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
}
footer h4 { color: var(--gold-400); margin-bottom: 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--gold-400); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; text-align: center; font-size: .85rem; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .browse-layout.filters-open { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  /* Full-screen chat layout on mobile — list OR chat, never both */
  .chat-layout { grid-template-columns: 1fr; display: flex; flex-direction: column; height: calc(100vh - 128px); }
  .chat-list { display: none; flex: 1; overflow-y: auto; max-height: none; }
  .chat-list.open { display: flex; flex-direction: column; }
  .chat-list.open ~ .chat-window { display: none !important; }
  .chat-window { flex: 1; min-height: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .profile-hero-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ─── Tablet / large phone: hide desktop nav, show hamburger ─── */
@media (max-width: 768px) {
  .navbar-nav    { display: none; }
  .navbar-actions { display: none !important; }
  .hamburger     { display: flex; }
  .navbar-logo-text { font-size: .58rem; }
  .navbar-logo-text span { display: block; font-size: .5rem; }
  /* Admin tab bar scrolls horizontally without wrapping */
  .tabs          { -webkit-overflow-scrolling: touch; }
  /* Stat cards 2-column on tablet */
  .admin-grid    { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Small phone ─── */
@media (max-width: 640px) {
  /* Spacing */
  .hero          { padding: 3rem 0 2.5rem; }
  .section       { padding: 2.5rem 0; }
  .section-sm    { padding: 1.25rem 0; }
  .container     { padding: 0 .875rem; }
  .card          { padding: 1rem; }

  /* Forms */
  .form-row      { grid-template-columns: 1fr; }

  /* Profile grids */
  .profiles-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .profile-card-photo { aspect-ratio: 3/2; }
  .pricing-grid  { grid-template-columns: 1fr; }
  .footer-grid   { grid-template-columns: 1fr; }
  .hero-stats    { gap: 1.25rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .profile-detail-grid { grid-template-columns: 1fr; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }

  /* Admin */
  .admin-grid    { grid-template-columns: repeat(2, 1fr) !important; }
  .rev-chart-grid { grid-template-columns: 1fr !important; }
  .admin-profile-grid { grid-template-columns: 1fr; }
  .stat-card     { padding: .85rem .75rem; }
  .stat-num      { font-size: 1.4rem; }

  /* Onboarding */
  .onboard-choice-grid { grid-template-columns: repeat(2, 1fr); }
  .steps         { gap: .25rem; }
  .step-label    { display: none; }

  /* Toast */
  #toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
  .toast         { min-width: unset; width: 100%; }

  /* Prevent inputs overflowing their containers */
  input, select, textarea { max-width: 100%; }

  /* Browse search bar wraps cleanly */
  #browse-search { width: 100%; max-width: 100% !important; }

  /* Ensure tables inside cards scroll rather than break layout */
  .card > div[style*="overflow-x"] { -webkit-overflow-scrolling: touch; }

  /* Badges in profile cards wrap instead of overflow */
  .profile-card-tags { flex-wrap: wrap; }

  /* Hide sect (Sunni/Shia) in cards on mobile */
  .card-sect { display: none; }

  /* Express Interest and action buttons in browse cards — 50% smaller on mobile */
  .profile-card-actions .btn {
    font-size: .42rem;
    padding: .28rem .5rem;
    line-height: 1.4;
  }
}
