/* =====================================================
   NammaTha – Global CSS
   Mobile-first Fintech Design System
   Color Palette:
   --nt-blue:    #1A237E  (Deep Blue primary)
   --nt-purple:  #7C3AED  (Purple accent)
   --nt-green:   #10B981  (Emerald highlight)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --nt-primary:     #4F46E5; /* Indigo 600 */
  --nt-primary-dark:#4338CA; /* Indigo 700 */
  --nt-secondary:   #6366F1; /* Indigo 500 */
  --nt-blue:        #0F172A; /* Slate 900 (Professional Blue) */
  --nt-blue-light:  #334155; /* Slate 700 */
  --nt-blue-dark:   #020617; /* Slate 950 */
  --nt-purple:      #7C3AED;
  --nt-green:       #10B981; /* Emerald 500 */
  --nt-green-light: #34D399;
  --nt-white:       #FFFFFF;
  --nt-bg:          #F8FAFC; /* Slate 50 */
  --nt-card:        #FFFFFF;
  --nt-text:        #0F172A; /* Slate 900 */
  --nt-muted:       #64748B; /* Slate 500 */
  --nt-border:      #E2E8F0; /* Slate 200 */
  --nt-shadow:      0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --nt-shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --nt-radius:      12px;
  --nt-radius-sm:   8px;
  --nt-radius-full: 999px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--nt-bg);
  color: var(--nt-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Loader ─────────────────────────────────────────── */
#nt-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--nt-blue-dark) 0%, var(--nt-blue) 100%);
  transition: opacity 0.5s ease;
}
#nt-loader.hide { opacity: 0; pointer-events: none; }
#nt-loader .loader-logo { width: 80px; margin-bottom: 24px; }
#nt-loader .loader-quote {
  color: rgba(255,255,255,0.85); font-size: 15px; font-weight: 500;
  text-align: center; max-width: 260px; line-height: 1.5;
}
.loader-spinner {
  width: 48px; height: 48px; border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Typography ─────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; }
.nt-title    { font-size: 28px; font-weight: 800; }
.nt-subtitle { font-size: 16px; color: var(--nt-muted); }

/* ── Navigation ────────────────────────────────────── */
.nt-navbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--nt-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: sticky; top: 0; z-index: 1000;
}
.nt-mobile-nav {
  display: flex; height: 60px; background: #fff; border-top: 1px solid var(--nt-border);
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
}
.is-chat-view .nt-mobile-nav {
  position: sticky; top: 60px; bottom: auto; border-top: none; border-bottom: 1px solid var(--nt-border);
  height: 50px;
}
.nt-mobile-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--nt-muted); text-decoration: none; font-size: 11px; gap: 4px;
}
.nt-mobile-nav a.active { color: var(--nt-primary); font-weight: 600; }
.nt-mobile-nav a i { font-size: 20px; }

@media (min-width: 768px) {
  .nt-mobile-nav { display: none; }
}

.nt-navbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--nt-primary); font-weight: 800; font-size: 20px; }
.nt-navbar-brand img { height: 32px; }
.nt-navbar-actions { display: flex; align-items: center; gap: 12px; }
.nt-icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--nt-bg); border: 1px solid var(--nt-border);
  cursor: pointer; transition: all 0.2s ease; text-decoration: none;
  color: var(--nt-text);
}
.nt-icon-btn:hover { background: var(--nt-blue); color: #fff; border-color: var(--nt-blue); }
.nt-badge {
  position: absolute; top: -4px; right: -4px;
  background: #EF4444; color: #fff; font-size: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ── Side Drawer ────────────────────────────────────── */
.nt-drawer-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.nt-drawer-overlay.open { opacity: 1; pointer-events: all; }
.nt-drawer {
  position: fixed; top: 0; left: -320px; width: 300px; height: 100vh;
  background: var(--nt-white); z-index: 3001; transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: var(--nt-shadow-lg);
}
.nt-drawer.open { left: 0; }
.nt-drawer-header {
  background: linear-gradient(135deg, var(--nt-blue-dark), var(--nt-blue-light));
  padding: 40px 24px 24px;
}
.nt-drawer-user-avatar {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.4);
  object-fit: cover; margin-bottom: 12px;
}
.nt-drawer-name  { color: #fff; font-weight: 700; font-size: 17px; }
.nt-drawer-email { color: rgba(255,255,255,0.7); font-size: 13px; }
.nt-drawer-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nt-drawer-nav a {
  display: flex; align-items: center; gap: 14px; padding: 13px 24px;
  color: var(--nt-text); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: all 0.2s ease; border-radius: 0;
}
.nt-drawer-nav a:hover, .nt-drawer-nav a.active {
  background: var(--nt-bg); color: var(--nt-purple);
  border-left: 3px solid var(--nt-purple);
}
.nt-drawer-nav a i { width: 22px; text-align: center; font-size: 16px; }
.nt-drawer-footer { padding: 16px 24px; border-top: 1px solid var(--nt-border); }
.nt-drawer-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Legacy Bottom Nav - Removed in favor of nt-mobile-nav */
.nt-bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--nt-muted); text-decoration: none; font-size: 11px; font-weight: 500;
  padding: 4px 16px; border-radius: var(--nt-radius-sm); transition: all 0.2s ease;
}
.nt-bottom-nav a i { font-size: 20px; }
.nt-bottom-nav a.active, .nt-bottom-nav a:hover { color: var(--nt-purple); }
.nt-bottom-nav a.active i { transform: scale(1.15); }

/* ── Global Modal Z-index ────────────────────────────── */
.modal { z-index: 106000 !important; }
.modal-backdrop { z-index: 105000 !important; opacity: 0 !important; display: none !important; }

/* ── Main Content ────────────────────────────────────── */
.nt-content { padding: 20px 16px 100px; max-width: 600px; margin: 0 auto; }

/* ── Cards ───────────────────────────────────────────── */
.nt-card {
  background: var(--nt-card); border-radius: var(--nt-radius);
  box-shadow: var(--nt-shadow); padding: 20px; margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nt-card:hover { transform: translateY(-2px); box-shadow: var(--nt-shadow-lg); }
.nt-goal-card-cover {
  width: 100%; height: 140px; object-fit: cover;
  border-radius: var(--nt-radius-sm); margin-bottom: 14px;
}
.nt-goal-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--nt-bg); border-radius: var(--nt-radius-full);
  padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--nt-muted);
  margin-bottom: 8px;
}
.nt-progress-wrap { background: #E8EAFB; border-radius: var(--nt-radius-full); height: 8px; overflow: hidden; }
.nt-progress-bar {
  height: 100%; border-radius: var(--nt-radius-full);
  background: linear-gradient(90deg, var(--nt-primary), var(--nt-secondary));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.nt-progress-bar.complete {
  background: linear-gradient(90deg, var(--nt-green), var(--nt-green-light));
}

/* ── Buttons ─────────────────────────────────────────── */
.nt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--nt-radius-sm);
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; transition: all 0.25s ease;
  text-decoration: none; white-space: nowrap;
}
.nt-btn-primary {
  background: var(--nt-primary);
  color: #fff; box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1), 0 2px 4px -1px rgba(79, 70, 229, 0.06);
}
.nt-btn-primary:hover { transform: translateY(-1px); background: var(--nt-primary-dark); box-shadow: var(--nt-shadow-lg); color: #fff; }
.nt-btn-outline {
  background: transparent; color: var(--nt-primary);
  border: 1px solid var(--nt-primary); padding: 12px 22px;
}
.nt-btn-outline:hover { background: var(--nt-primary); color: #fff; }
.nt-btn-green  { background: linear-gradient(135deg, var(--nt-green), var(--nt-green-light)); color: #fff; }
.nt-btn-block  { width: 100%; }
.nt-btn-sm     { padding: 9px 16px; font-size: 13px; border-radius: 8px; }
.nt-btn-google {
  background: #fff; color: #3c4043; border: 2px solid var(--nt-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.nt-btn-google:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); transform: translateY(-1px); }

/* ── Forms ───────────────────────────────────────────── */
.nt-form-group { margin-bottom: 18px; }
.nt-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--nt-text); }
.nt-input {
  width: 100%; padding: 14px 16px; border-radius: var(--nt-radius-sm);
  border: 2px solid var(--nt-border); font-family: inherit; font-size: 15px;
  background: var(--nt-bg); color: var(--nt-text); outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nt-input:focus {
  border-color: var(--nt-primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}
.nt-input-wrap { position: relative; }
.nt-input-wrap .nt-input { padding-right: 48px; }
.nt-eye-btn {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--nt-muted); padding: 4px;
}
.nt-error { font-size: 13px; color: #EF4444; margin-top: 5px; }

/* ── Auth Pages ──────────────────────────────────────── */
.nt-auth-wrapper {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 20px;
}
.nt-auth-card {
  width: 100%; max-width: 420px;
  background: var(--nt-card); border-radius: var(--nt-radius);
  box-shadow: var(--nt-shadow-lg); padding: 36px 28px;
}
.nt-auth-logo { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 8px; display: block; }
.nt-auth-brand { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--nt-primary) 0%, var(--nt-secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nt-auth-subtitle { text-align: center; color: var(--nt-muted); margin-bottom: 28px; font-size: 15px; }
.nt-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--nt-muted); font-size: 13px; }
.nt-divider::before, .nt-divider::after { content:''; flex:1; height:1px; background: var(--nt-border); }

/* ── Avatar ──────────────────────────────────────────── */
.nt-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.nt-avatar-sm { width: 32px; height: 32px; }
.nt-avatar-lg { width: 72px; height: 72px; }

/* ── Quote Banner ────────────────────────────────────── */
.nt-quote-banner {
  background: linear-gradient(135deg, var(--nt-blue-dark), var(--nt-blue));
  border-radius: var(--nt-radius); padding: 20px 24px; margin-bottom: 20px;
  color: #fff; text-align: center; overflow: hidden;
}
.nt-quote-text { font-size: 15px; font-weight: 500; line-height: 1.6; }
.nt-quote-icon { font-size: 32px; margin-bottom: 8px; }

/* ── Activity Timeline ────────────────────────────────── */
.nt-timeline { list-style: none; padding: 0; }
.nt-timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--nt-border); }
.nt-timeline li:last-child { border-bottom: none; }
.nt-timeline-dot {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--nt-bg); border: 1px solid var(--nt-primary);
  display: flex; align-items: center; justify-content: center;
  color: var(--nt-primary); font-size: 14px;
}
.nt-timeline-body { flex:1; }
.nt-timeline-body .nt-amt { font-weight: 700; color: var(--nt-green); }

/* ── Goal Hero Section ─────────────────────────────────── */
.nt-goal-hero {
  position: relative; border-radius: var(--nt-radius); overflow: hidden;
  height: 200px; margin-bottom: 20px;
}
.nt-goal-hero img { width: 100%; height: 100%; object-fit: cover; }
.nt-goal-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,15,50,0.85) 0%, transparent 60%);
  display: flex; align-items: flex-end; padding: 20px;
}
.nt-goal-hero-overlay .goal-title { color: #fff; font-size: 22px; font-weight: 800; }

/* ── Member List ─────────────────────────────────────── */
.nt-member {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--nt-border);
}
.nt-member:last-child { border-bottom: none; }
.nt-member-info { flex:1; }
.nt-member-name { font-weight: 600; font-size: 15px; }
.nt-member-contrib { font-size: 13px; color: var(--nt-muted); }
.nt-member-amount { font-weight: 700; color: var(--nt-green); font-size: 15px; }

/* ── Chat ────────────────────────────────────────────── */
.nt-chat-container {
  display: flex; flex-direction: column; height: calc(100vh - 110px);
  background: var(--nt-bg); position: relative;
}
.is-chat-view main { padding-bottom: 0; }
body:not(.is-chat-view) main { padding-bottom: 60px; }
@media (min-width: 768px) {
  .nt-chat-container { height: calc(100vh - 60px); }
}
.nt-chat-messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }

.nt-chat-date {
  align-self: center; background: rgba(0,0,0,0.06); color: var(--nt-muted);
  font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 12px;
  margin: 10px 0; text-transform: uppercase;
}

.nt-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 18px; position: relative;
  animation: bubbleIn 0.2s ease;
  word-wrap: break-word; overflow-wrap: break-word;
}
@keyframes bubbleIn { from { opacity:0; transform: scale(0.92); } to { opacity:1; transform: scale(1); } }
.nt-bubble.mine {
  align-self: flex-end; background: var(--nt-primary);
  color: #fff; border-bottom-right-radius: 4px;
}
.nt-bubble.theirs { align-self: flex-start; background: var(--nt-white); border-bottom-left-radius: 4px;
  box-shadow: var(--nt-shadow); }
.nt-bubble-sender { font-size: 11px; font-weight: 600; margin-bottom: 3px; color: var(--nt-green-light); }
.nt-bubble-time { font-size: 10px; opacity: 0.65; margin-top: 3px; text-align: right; }
.nt-chat-input-bar {
  padding: 10px 16px; background: var(--nt-white);
  border-top: 1px solid var(--nt-border);
  display: flex; gap: 10px; align-items: flex-end;
}
.nt-chat-input {
  flex: 1; min-height: 44px; max-height: 100px; overflow-y: auto;
  border: 2px solid var(--nt-border); border-radius: 22px; padding: 10px 16px;
  font-family: inherit; font-size: 14px; outline: none; resize: none;
  background: var(--nt-bg); transition: border-color 0.2s;
}
.nt-chat-input:focus { border-color: var(--nt-purple); }
.nt-chat-send {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--nt-blue), var(--nt-purple));
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.2s;
}
.nt-chat-send:hover { transform: scale(1.1); }

/* ── Chat Actions & Receipts ─────────────────────────── */
.nt-bubble-edited { font-size: 10px; font-style: italic; opacity: 0.6; margin-left: 5px; }
.nt-bubble-seen {
  font-size: 10px; color: var(--nt-primary); margin-top: 2px;
  display: flex; align-items: center; gap: 3px; justify-content: flex-end;
}
/* ── Chat Context Menu & Reactions ────────────────────── */
.nt-context-menu {
  position: fixed; background: var(--nt-card); border-radius: var(--nt-radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15); z-index: 2000; width: 180px;
  overflow: hidden; display: none;
}
.nt-context-menu div {
  padding: 10px 16px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background 0.2s ease;
}
.nt-context-menu div:hover { background: var(--nt-bg); }
.nt-context-menu div.danger { color: #d33; border-top: 1px solid var(--nt-border); }
.nt-context-menu div.danger:hover { background: #ffebeb; }

.ctx-react-bar {
  display: flex; gap: 10px; padding: 10px 16px; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--nt-border); background: var(--nt-bg); cursor: default !important;
}
.ctx-react-bar span {
  font-size: 20px; cursor: pointer; transition: transform 0.2s ease;
}
.ctx-react-bar span:hover { transform: scale(1.3); }

/* ── Reactions styling ── */
.nt-bubble-reactions {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; position:relative; z-index:5;
}
.reaction-badge {
  background: var(--nt-bg); border-radius: 12px; padding: 2px 6px; font-size: 11px;
  display: flex; align-items: center; gap: 4px; cursor: pointer;
  border: 1px solid var(--nt-border); color: var(--nt-text); transition: all 0.2s ease;
}
.reaction-badge.active {
  background: rgba(108,92,231,0.1); border-color: var(--nt-purple); color: var(--nt-purple);
}


.nt-file-preview {
  display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.05);
  padding: 8px 12px; border-radius: 8px; margin-bottom: 4px; text-decoration: none; color: inherit;
}
.nt-file-preview i { font-size: 24px; color: var(--nt-purple); }
.nt-file-info { display: flex; flex-direction: column; }
.nt-file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.nt-file-size { font-size: 11px; opacity: 0.7; }

/* ── Inline Edit UI ─────────────────────────────────── */
.edit-input-wrap { display: flex; gap: 8px; align-items: center; width: 100%; margin: 8px 0; }
.edit-input { 
  flex: 1; border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.1); 
  color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 14px; outline: none;
}
.theirs .edit-input { border-color: var(--nt-border); background: var(--nt-bg); color: var(--nt-text); }
.edit-actions { display: flex; gap: 10px; }
.edit-actions button { 
  border: none; background: none; color: #fff; cursor: pointer; padding: 6px;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  min-width: 32px; min-height: 32px; border-radius: 50%; background: rgba(255,255,255,0.1);
}
.theirs .edit-actions button { color: var(--nt-muted); background: rgba(0,0,0,0.05); }
.edit-actions .save-btn { color: var(--nt-green-light); }
.edit-actions .cancel-btn { color: #FFAAAA; }

/* ── Attachment Preview ────────────────────────────── */
#attachment-preview {
  display: none; padding: 8px 16px; background: var(--nt-bg); border-top: 1px solid var(--nt-border);
  align-items: center; gap: 10px;
}
#attachment-preview.show { display: flex; }
.preview-thumb { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; }
.preview-name { font-size: 12px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-remove { color: #EF4444; border: none; background: none; cursor: pointer; padding: 4px; font-size: 16px; }

/* ── Chat Search ────────────────────────────────────── */
.nt-chat-header {
  padding: 8px 16px; border-bottom: 1px solid var(--nt-border); display: flex; align-items: center; gap: 10px;
  background: #fff; position: sticky; top: 0; z-index: 500; min-height: 57px;
}
.nt-search-wrap { display: flex; align-items: center; flex: 1; position: relative; overflow: visible; gap: 4px; }
.nt-search-input {
  width: 0; opacity: 0; padding: 6px 0; border: none; outline: none;
  background: transparent; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px; color: var(--nt-text);
}
.nt-search-wrap.expanded .nt-search-input { width: 100%; opacity: 1; padding: 6px 36px 6px 12px; border-radius: 20px; background: rgba(0,0,0,0.05); }

.nt-search-nav { display: none; align-items: center; gap: 4px; border-radius: 20px; background: var(--nt-primary); color: #fff; padding: 2px 8px; font-size: 12px; margin-left: auto; }
.nt-search-wrap.expanded .nt-search-nav { display: flex; }
.nt-search-count { font-weight: 600; margin-right: 4px; white-space: nowrap; }
.nt-search-arrow { cursor: pointer; padding: 2px; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.nt-search-arrow:hover { transform: scale(1.2); }
.nt-search-arrow i { font-size: 14px; }

.nt-bubble.highlighted {
  border: 2px solid var(--nt-primary);
  box-shadow: 0 0 15px rgba(26, 35, 126, 0.3);
  transition: all 0.3s ease;
}
.nt-search-icon { 
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); 
  color: var(--nt-muted); font-size: 14px; opacity: 0; transition: opacity 0.3s;
}
.nt-search-wrap.expanded .nt-search-icon { opacity: 1; }

.nt-search-toggle { font-size: 18px; color: var(--nt-muted); cursor: pointer; transition: color 0.2s; }
.nt-search-toggle.active { color: var(--nt-primary); }

/* ── Selection Mode Header ─────────────────────────── */
.nt-selection-header {
    position: absolute; top: 0; left: 0; right: 0; height: 100%;
    background: var(--nt-blue-dark); color: #fff; z-index: 20;
    display: none; align-items: center; padding: 0 16px; gap: 16px;
    animation: slideDown 0.3s ease;
}
.nt-selection-header.active { display: flex; }
.nt-selection-count { flex: 1; font-weight: 700; font-size: 18px; }
.nt-selection-actions { display: flex; gap: 12px; }
.nt-selection-actions .nt-icon-btn { 
    background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; 
}
.nt-selection-actions .nt-icon-btn:hover { background: rgba(255,255,255,0.2); }

@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* ── Seen By Modal ──────────────────────────────────── */
.nt-seen-list { list-style: none; padding: 0; margin: 0; }
.nt-seen-item { 
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--nt-border);
}
.nt-seen-item:last-child { border-bottom: none; }
.nt-seen-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.nt-seen-name { font-weight: 600; font-size: 15px; }

/* Smarter Context Menu */
.nt-context-menu {
  position: fixed; z-index: 1000; min-width: 180px;
}

/* Limit image size in chat */
.nt-bubble img { max-width: 260px; height: auto; border-radius: 12px; display: block; margin: 4px 0; }
@media (max-width: 480px) {
  .nt-bubble img { max-width: 220px; }
  .nt-chat-container { height: calc(100vh - 125px); }
  .nt-content-wrap { padding-bottom: 0 !important; }
  .nt-bubble { max-width: 85%; }
}

/* ── Stat Cards ──────────────────────────────────────── */
.nt-stat-card {
  border-radius: var(--nt-radius-sm); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.nt-stat-card.blue   { background: linear-gradient(135deg, var(--nt-blue), var(--nt-blue-light)); color: #fff; }
.nt-stat-card.purple { background: linear-gradient(135deg, var(--nt-purple), var(--nt-purple-light)); color: #fff; }
.nt-stat-card.green  { background: linear-gradient(135deg, var(--nt-green), var(--nt-green-light)); color: #fff; }
.nt-stat-label { font-size: 12px; font-weight: 600; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }
.nt-stat-value { font-size: 22px; font-weight: 800; }

/* ── Modals ──────────────────────────────────────────── */
.nt-modal-backdrop {
  position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.nt-modal-backdrop.open { opacity: 1; pointer-events: all; }
.nt-modal {
  background: var(--nt-white); border-radius: var(--nt-radius) var(--nt-radius) 0 0;
  width: 100%; max-width: 500px; padding: 28px 24px 40px;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.nt-modal-backdrop.open .nt-modal { transform: translateY(0); }
.nt-modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* ── Celebration ─────────────────────────────────────── */
#celebration-overlay {
  position: fixed; inset: 0; z-index: 600; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#celebration-overlay canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.celebration-card {
  position: relative; z-index: 1; background: #fff; border-radius: var(--nt-radius);
  padding: 36px 28px; box-shadow: var(--nt-shadow-lg); text-align: center; max-width: 320px;
  pointer-events: all;
}
.celebration-emoji { font-size: 56px; margin-bottom: 12px; }
.celebration-title { font-size: 26px; font-weight: 800; color: var(--nt-green); margin-bottom: 8px; }
.celebration-msg { color: var(--nt-muted); font-size: 15px; line-height: 1.6; }

/* ── Invitation Card ─────────────────────────────────── */
.nt-invite-card {
  background: var(--nt-white); border-radius: var(--nt-radius-sm);
  border: 1px solid var(--nt-border); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.nt-invite-card-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Toast Notification ──────────────────────────────── */
#nt-toast-container {
  position: fixed; bottom: 80px; right: 16px; z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
}
.nt-toast {
  background: var(--nt-text); color: #fff; padding: 12px 18px;
  border-radius: var(--nt-radius-sm); font-size: 14px; font-weight: 500;
  box-shadow: var(--nt-shadow-lg); animation: toastIn 0.3s ease;
  max-width: 280px;
}
.nt-toast.success { background: var(--nt-green); }
.nt-toast.error   { background: #EF4444; }
@keyframes toastIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform: translateX(0); } }

/* ── Image upload preview ────────────────────────────── */
.nt-img-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--nt-purple); display: none; margin: 0 auto 12px; }
.nt-img-preview.show { display: block; }

/* ── Responsive helpers ──────────────────────────────── */
@media (min-width: 768px) {
  .nt-content { padding: 30px 24px 60px; }
  .nt-bottom-nav { display: none; }
  .nt-drawer { width: 280px; }
}
@media (max-width: 480px) {
  .nt-auth-card { padding: 28px 20px; }
}
