/* ============================================
   NOVA — Main CSS
   ============================================ */

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --bg4: #22222e;
  --surface: #1e1e2a;
  --surface2: #262636;
  --border: #2a2a3a;
  --border2: #333348;

  --primary: #7c6fcd;
  --primary-glow: rgba(124, 111, 205, 0.3);
  --primary-light: #9d92e0;
  --accent: #e85d7a;
  --accent2: #4ecdc4;
  --accent3: #ffd93d;

  --text: #f0f0f8;
  --text2: #a0a0c0;
  --text3: #606080;

  --online: #4ecdc4;
  --danger: #e85d7a;
  --success: #4ecdc4;
  --warning: #ffd93d;

  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(124, 111, 205, 0.15);

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --sidebar-w: 260px;
  --topbar-h: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- UTILITY ---- */
.hidden { display: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  width: 100%;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg4); border-color: var(--primary); }

.icon-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* ---- APP LAYOUT ---- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-small {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 0;
}
.user-profile-mini:hover { background: var(--surface); }

.user-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.user-status {
  font-size: 11px;
  color: var(--text3);
}
.user-status.online { color: var(--online); }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  border-radius: 0;
  position: relative;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, var(--primary-glow), transparent);
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
}
.nav-item.active .nav-icon { color: var(--primary); }

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.btn-logout {
  margin: 16px;
  padding: 12px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.topbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- PAGES ---- */
.pages-container {
  flex: 1;
  overflow: hidden;
}

.page {
  display: none;
  padding: 24px;
  max-width: 720px;
  margin: 0 auto;
  animation: fadeIn 0.2s ease;
}
.page.active { display: block; }

#page-messages.active { display: flex; padding: 0; max-width: 100%; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
}

/* ---- STORIES ---- */
.stories-bar {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 0 0 16px;
  margin-bottom: 24px;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }

#stories-list {
  display: flex;
  gap: 16px;
}

.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.story-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.2s;
  font-family: var(--font-display);
  font-weight: 700;
}

.story-ring.active {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg2), var(--bg2)) padding-box,
              linear-gradient(135deg, var(--primary), var(--accent)) border-box;
}

.story-ring.add {
  background: var(--surface2);
  border: 2px dashed var(--border2);
  font-size: 24px;
  color: var(--primary);
}

.story span {
  font-size: 11px;
  color: var(--text2);
  max-width: 60px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- POSTS ---- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.post-card:hover { border-color: var(--border2); }

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.post-user-info {
  flex: 1;
}

.post-username {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.post-username:hover { color: var(--primary-light); }

.post-time {
  font-size: 11px;
  color: var(--text3);
}

.post-options-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.post-options-btn:hover { background: var(--bg4); color: var(--text); }

.post-body {
  padding: 0 16px 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.post-media {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
}

.post-actions {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  padding: 4px 12px;
}

.post-action-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
}
.post-action-btn:hover { background: var(--bg4); color: var(--text); }
.post-action-btn.liked { color: var(--accent); }
.post-action-btn.liked:hover { color: var(--accent); }

/* ---- MESSAGES ---- */
.messages-layout {
  display: flex;
  width: 100%;
  height: calc(100vh - var(--topbar-h));
}

.conversations-list {
  width: 300px;
  border-right: 1px solid var(--border);
  background: var(--bg2);
  overflow-y: auto;
  flex-shrink: 0;
}

.conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg2);
}
.conv-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.conv-item:hover { background: var(--surface); }
.conv-item.active { background: var(--surface2); }

.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-last { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-unread {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text3);
}
.chat-empty .empty-icon { font-size: 48px; opacity: 0.3; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.chat-user-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.chat-user-status { font-size: 11px; color: var(--online); }

.chat-call-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.msg-bubble {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msg-bubble.me { align-self: flex-end; align-items: flex-end; }
.msg-bubble.them { align-self: flex-start; }

.msg-text {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.me .msg-text {
  background: linear-gradient(135deg, var(--primary), #6a5fc0);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.them .msg-text {
  background: var(--surface2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-time { font-size: 10px; color: var(--text3); padding: 0 4px; }

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--primary); }

.send-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.send-btn:hover { transform: scale(1.1); }

/* ---- SEARCH / EXPLORE ---- */
.search-bar {
  position: relative;
  margin-bottom: 24px;
}
.search-bar input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 48px 14px 20px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--primary); }
.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 18px;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.user-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-glow); }

.user-card .avatar {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  font-size: 24px;
}

.user-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.user-card-username { font-size: 12px; color: var(--text3); margin-bottom: 12px; }

.user-card-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- FRIENDS ---- */
.friends-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 20px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- USER LIST (small) ---- */
.user-list-sm {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-item-sm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.user-item-sm:hover { background: var(--bg4); }
.user-item-sm .name { font-size: 14px; font-weight: 500; }
.user-item-sm .handle { font-size: 12px; color: var(--text3); }

/* ---- NOTIFICATIONS ---- */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-item:hover { background: var(--surface2); }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-text { flex: 1; font-size: 14px; }
.notif-text strong { font-weight: 600; }
.notif-time { font-size: 11px; color: var(--text3); }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm { max-width: 320px; }

@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: var(--font-display); font-weight: 700; }
.modal-header button { background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-footer .btn-secondary,
.modal-footer .btn-primary {
  width: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}
.modal textarea:focus { border-color: var(--primary); }

.modal input[type="text"],
.modal input[type="password"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.modal input:focus { border-color: var(--primary); }

.post-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.mood-selector { display: flex; gap: 4px; }
.mood-selector button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.1s;
}
.mood-selector button:hover { transform: scale(1.3); }

.post-media-preview img,
.post-media-preview video {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ---- CALL MODAL ---- */
.call-modal {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 9/16;
  max-height: 90vh;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.call-bg-blur {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1040, #0f1a20, #200a1a);
  z-index: 0;
}

.call-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 32px;
}

.call-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 0 40px rgba(124,111,205,0.5);
  border: 3px solid var(--primary);
}

.call-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.call-status {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
}

.call-timer {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 4px;
  margin-bottom: 20px;
  color: var(--primary-light);
}

.remote-video {
  width: 100%;
  flex: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg3);
  margin-bottom: 16px;
  display: none;
}

.local-video {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  display: none;
  z-index: 10;
}

.call-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: auto;
}

.call-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.call-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.call-btn.active { background: var(--primary); border-color: var(--primary); }
.call-btn.end { background: var(--danger); border-color: var(--danger); width: 64px; height: 64px; font-size: 26px; }
.call-btn.end:hover { background: #c94060; transform: scale(1.1); }
.call-btn.muted { background: rgba(232,93,122,0.3); border-color: var(--danger); }

/* ---- INCOMING CALL ---- */
.incoming-call {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  animation: pulse-ring 2s ease infinite, modalIn 0.3s ease;
  min-width: 280px;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 20px transparent; }
}

.incoming-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 auto 16px;
  border: 3px solid var(--primary);
}

.incoming-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.incoming-type { font-size: 13px; color: var(--text2); margin-bottom: 32px; }

.incoming-actions { display: flex; gap: 32px; justify-content: center; }

.call-action {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.call-action.accept { background: var(--success); animation: pulse 1s ease infinite; }
.call-action.decline { background: var(--danger); }
.call-action:hover { transform: scale(1.1); }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---- OPTIONS ---- */
.options-list { display: flex; flex-direction: column; gap: 4px; padding: 8px !important; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.option-btn:hover { background: var(--bg4); }
.option-btn.danger { color: var(--danger); }
.option-btn.danger:hover { background: rgba(232,93,122,0.1); }

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---- PROFILE ---- */
.profile-cover {
  height: 180px;
  background: linear-gradient(135deg, #1a1040 0%, #0f1a20 50%, #200a1a 100%);
  border-radius: var(--radius);
  margin-bottom: -50px;
  position: relative;
}

.profile-header {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 0 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  border: 4px solid var(--bg);
  flex-shrink: 0;
}

.profile-info { flex: 1; }
.profile-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.profile-handle { font-size: 13px; color: var(--text3); margin-bottom: 8px; }
.profile-bio { font-size: 14px; color: var(--text2); }

.profile-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.stat-item { text-align: center; cursor: pointer; }
.stat-num { font-family: var(--font-display); font-size: 20px; font-weight: 700; display: block; }
.stat-label { font-size: 11px; color: var(--text3); }

.loading-posts {
  text-align: center;
  color: var(--text3);
  padding: 40px;
  font-size: 14px;
}

/* ---- COMMENTS ---- */
.comments-section {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
}

.comment-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}
.comment-input:focus { border-color: var(--primary); }

.comment-send {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.comment-bubble {
  background: var(--surface2);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1;
}
.comment-author { font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.comment-text { font-size: 13px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close { display: block; }

  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .topbar-brand { display: block; }

  .conversations-list { width: 100%; border-right: none; }
  .chat-panel { display: none; }

  .messages-layout { flex-direction: column; }
  #page-messages.active.chat-open .conversations-list { display: none; }
  #page-messages.active.chat-open .chat-panel { display: flex; height: calc(100vh - var(--topbar-h)); }

  .user-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .page { padding: 16px; }

  .call-modal { max-width: 100%; max-height: 100%; border-radius: 0; min-height: 100vh; }
}

@media (max-width: 480px) {
  .user-grid { grid-template-columns: 1fr 1fr; }
  .profile-stats { gap: 16px; }
}
