@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Lora:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --orange:  #ff6b00;
  --amber:   #ffaa00;
  --gold:    #ffcc00;
  --cream:   #faf6f0;
  --paper:   #fdf8f2;
  --border:  #f0e6d8;
  --text:    #3d2c1e;
  --muted:   #9b7b5a;
  --white:   #ffffff;
  --green:   #25D366;
  --upi:     #6c2bd9;
  --danger:  #ef4444;
  --shadow:  0 4px 24px rgba(180,100,20,.12);
  --radius:  16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Lora', Georgia, serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* ── Utilities ── */
.container  { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.text-muted { color: var(--muted); }
.text-center{ text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: none;
  font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all .2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--amber));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,0,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,107,0,.4); }
.btn-outline {
  background: transparent; color: var(--orange);
  border: 2px solid var(--orange);
}
.btn-outline:hover { background: #fff3e0; }
.btn-ghost  { background: #f5ede0; color: var(--muted); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-green  { background: var(--green); color: #fff; box-shadow: 0 4px 16px rgba(37,211,102,.3); }
.btn-upi    { background: linear-gradient(90deg,#6c2bd9,#b721ff); color:#fff; box-shadow:0 4px 16px rgba(108,43,217,.3); }
.btn-sm     { padding: 8px 14px; font-size: 12px; border-radius: 8px; }
.btn-full   { width: 100%; justify-content: center; }

/* ── Form ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  font-family: 'Playfair Display', serif;
}
.form-input, .form-select, .form-textarea {
  padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--paper);
  font-family: inherit; font-size: 14px; color: var(--text);
  outline: none; transition: border .2s; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,0,.1);
}
.form-textarea { resize: vertical; min-height: 72px; }
.input-prefix {
  position: relative;
}
.input-prefix span {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}
.input-prefix input { padding-left: 28px; }

/* ── Card ── */
.card {
  background: rgba(255,255,255,.92);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card-body   { padding: 28px; }
.card-header { padding: 20px 28px; border-bottom: 1.5px solid var(--border); }

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.alert-error   { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.alert-success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.alert-info    { background:#fff3e0; color:#92400e; border:1px solid #ffcc80; }

/* ── Nav ── */
.navbar {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(180,100,20,.07);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.navbar-logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 4px 12px rgba(255,107,0,.3);
  flex-shrink: 0;
}
.navbar-name {
  font-family: 'Playfair Display', serif;
  font-weight: 800; font-size: 18px; color: var(--text);
}
.navbar-name span { color: var(--orange); }
.navbar-tagline { font-size: 10px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.navbar-actions { display: flex; gap: 10px; align-items: center; }

/* ── Auth Page ── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  background: var(--cream);
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 80% 20%, #ffe0b244 0%, transparent 60%),
              radial-gradient(ellipse at 10% 80%, #f8bbd044 0%, transparent 60%);
}
.auth-box { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-tabs {
  display: flex; background: var(--paper);
  border-radius: 12px; padding: 4px; margin-bottom: 24px;
  border: 1.5px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 10px; color: var(--muted); transition: all .2s;
}
.auth-tab.active { background: #fff; color: var(--orange); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-divider {
  text-align: center; color: var(--muted);
  font-size: 12px; position: relative; margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ── Dashboard ── */
.dashboard { display: flex; gap: 28px; padding: 28px 20px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.sidebar { width: 260px; flex-shrink: 0; }
.main-content { flex: 1; min-width: 0; }

.profile-card-mini {
  background: linear-gradient(135deg, var(--orange), var(--amber));
  border-radius: var(--radius); padding: 24px 20px;
  text-align: center; color: #fff; position: relative; overflow: hidden;
}
.profile-card-mini::before {
  content: '';
  position: absolute; inset: 0; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='18' fill='none' stroke='white' stroke-width='1'/%3E%3C/svg%3E");
}
.avatar-wrap {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,.8);
  box-shadow: 0 0 0 4px rgba(255,255,255,.25);
  overflow: hidden; background: rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative;
}
.avatar-wrap img { width:100%; height:100%; object-fit:cover; }
.avatar-edit {
  position: absolute; bottom: 0; right: 0;
  background: var(--orange); border: 2px solid #fff;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; color: #fff;
}
.profile-card-mini h3 { font-family:'Playfair Display',serif; font-size:16px; font-weight:700; }
.profile-card-mini p  { font-size:12px; opacity:.85; margin-top:4px; }
.link-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.2); border-radius:20px;
  padding: 4px 12px; font-size:11px; margin-top:10px;
  cursor:pointer; transition:background .2s;
}
.link-badge:hover { background: rgba(255,255,255,.3); }

.sidebar-menu { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; border: none; background: none;
  text-align: left; width: 100%; transition: all .2s; text-decoration: none;
}
.sidebar-item:hover { background: var(--border); color: var(--text); }
.sidebar-item.active { background: #fff3e0; color: var(--orange); }

/* ── Section Panels ── */
.section { display: none; }
.section.active { display: block; }

.section-header {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700;
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}

/* ── Link Items ── */
.link-list { display: flex; flex-direction: column; gap: 12px; }
.link-item {
  background: var(--paper); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
}
.link-item-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #fff3e0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.link-item-info { flex: 1; min-width: 0; }
.link-item-info strong { display: block; font-size: 14px; font-weight: 700; }
.link-item-info span   { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.link-item-actions { display: flex; gap: 6px; }

.add-link-form {
  background: var(--paper); border: 2px dashed var(--border);
  border-radius: 14px; padding: 20px; margin-top: 16px;
}

/* ── Theme Grid ── */
.theme-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.theme-card {
  border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--border); transition: all .2s; background: none;
}
.theme-card.selected { border-color: var(--orange); box-shadow: 0 4px 20px rgba(255,107,0,.3); }
.theme-swatch { height: 52px; position: relative; }
.theme-label {
  padding: 6px 10px; background: var(--paper);
  font-size: 11px; font-weight: 700;
  font-family: 'Playfair Display', serif;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Copy Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1a1a1a; color: #fff; padding: 12px 24px;
  border-radius: 40px; font-size: 13px; font-weight: 600;
  transition: transform .3s ease; z-index: 999; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════
   PUBLIC PROFILE PAGE
══════════════════════════════════════════════════════════ */
.profile-page {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  padding: 0 16px 60px;
  position: relative; overflow-x: hidden;
}
.profile-bg {
  position: fixed; inset: 0; z-index: 0;
  background-size: cover; background-attachment: fixed;
}
.profile-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  padding-top: 60px;
}
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 14px;
  border: 3px solid rgba(255,255,255,.8);
  box-shadow: 0 0 0 5px rgba(255,255,255,.25);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 46px; background: rgba(255,255,255,.2);
}
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 24px; font-weight: 800;
  text-align: center; margin-bottom: 4px;
}
.profile-handle { text-align:center; font-size:13px; opacity:.75; margin-bottom:8px; font-family: monospace; }
.profile-bio { text-align:center; font-size:13px; line-height:1.6; opacity:.9; margin-bottom:24px; padding: 0 16px; }

.profile-links { display: flex; flex-direction: column; gap: 12px; }

.plink {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 14px;
  text-decoration: none; transition: all .2s;
  font-family: 'Playfair Display', serif;
  font-weight: 600; font-size: 15px;
}
.plink:hover { transform: translateY(-2px); filter: brightness(1.05); }
.plink-icon { font-size: 18px; }
.plink-label { flex: 1; }
.plink-arrow { opacity: .5; font-size: 13px; }

.plink-wa {
  background: #25D366; color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}
.plink-upi {
  background: linear-gradient(90deg,#6c2bd9,#b721ff); color:#fff;
  box-shadow: 0 4px 16px rgba(108,43,217,.35);
}
.plink-upi-amount {
  font-size: 11px; opacity: .75;
  font-family: 'Lora', serif; font-weight: 400;
}

.profile-footer {
  margin-top: 36px; text-align: center;
  font-size: 11px; opacity: .45;
  font-family: monospace; letter-spacing: .05em;
}
.profile-footer a { color: inherit; text-decoration: none; }
.profile-footer a:hover { opacity: 1; text-decoration: underline; }

/* ── Themes (public profile backgrounds) ── */
.bg-marigold  { background: linear-gradient(135deg,#ff6b00 0%,#ffa500 50%,#ffcc00 100%); }
.bg-midnight  { background: linear-gradient(135deg,#0a0a2e 0%,#1a1a5e 50%,#2d2d8f 100%); }
.bg-rose      { background: linear-gradient(135deg,#c2185b 0%,#e91e8c 50%,#f48fb1 100%); }
.bg-forest    { background: linear-gradient(135deg,#1b5e20 0%,#2e7d32 50%,#66bb6a 100%); }
.bg-cotton    { background: linear-gradient(135deg,#fdf6ec 0%,#fce8cc 50%,#f9d4a4 100%); }
.bg-ocean     { background: linear-gradient(135deg,#006064 0%,#00838f 50%,#00bcd4 100%); }

.text-light   { color: #fff; }
.text-dark    { color: #5c3b10; }
.btn-light    { background: rgba(255,255,255,.9); }
.btn-dark     { background: rgba(92,59,16,.12); border:1.5px solid rgba(92,59,16,.2); }

/* ── Responsive ── */
@media (max-width: 720px) {
  .dashboard    { flex-direction: column; padding: 16px; }
  .sidebar      { width: 100%; }
  .sidebar-menu { flex-direction: row; flex-wrap: wrap; }
  .sidebar-item { flex: 1; justify-content: center; min-width: 80px; }
  .theme-grid   { grid-template-columns: repeat(2,1fr); }
  .navbar       { padding: 12px 16px; }
}
