/* ═══════════════════════════════════════════════════════════════
   UniConnect — CSS
   Theme: Dark cyber-campus · Syne + DM Sans · Gen Z energy
═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a25;
  --surface: #16161f;
  --surface2: #1e1e2e;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --accent: #7c6af7;
  --accent2: #a78bfa;
  --accent-glow: rgba(124,106,247,0.25);
  --green: #22d3a5;
  --pink: #f472b6;
  --yellow: #fbbf24;
  --orange: #fb923c;

  --text: #f1f0ff;
  --text2: #a8a5c0;
  --text3: #6b6880;

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

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 100px;

  --nav-h: 68px;
  --top-h: 64px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

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

/* ═══ SCREENS ═══ */
.screen { display: none; }
.screen.active { display: block; }

/* ═══════════════ LANDING ═══════════════ */
.landing-bg {
  position: fixed; inset: 0; z-index: 0;
  background: var(--bg);
  overflow: hidden;
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,106,247,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,106,247,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.glow-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.35;
  animation: orb-float 8s ease-in-out infinite;
}
.orb1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -100px; animation-delay: 0s; }
.orb2 { width: 400px; height: 400px; background: var(--pink); bottom: -100px; right: -80px; animation-delay: 3s; }
.orb3 { width: 300px; height: 300px; background: var(--green); top: 40%; left: 50%; animation-delay: 5s; }

@keyframes orb-float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(20px,-30px) scale(1.05); }
}

.auth-page { display: none; }
.auth-page.active { display: flex; flex-direction: column; }

.landing-content {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.brand-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 32px;
  animation: fade-up 0.8s ease both;
  background: rgba(124,106,247,0.08);
}

.landing-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(64px, 16vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  animation: fade-up 0.8s 0.1s ease both;
}
.title-line { display: block; color: var(--text); }
.title-line.accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
  text-stroke: 2px var(--accent);
  position: relative;
}
.title-line.accent::after {
  content: 'CONNECT';
  position: absolute; left: 0; top: 0;
  color: var(--accent);
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  animation: text-reveal 1s 0.5s ease forwards;
}
@keyframes text-reveal {
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

.landing-sub {
  font-size: 18px; color: var(--text2);
  margin-bottom: 48px;
  animation: fade-up 0.8s 0.2s ease both;
}

.landing-actions {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 64px;
  animation: fade-up 0.8s 0.3s ease both;
}

.landing-stats {
  display: flex; gap: 32px; align-items: center;
  animation: fade-up 0.8s 0.4s ease both;
}
.stat { text-align: center; }
.stat-num { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text3); }
.stat-divider { width: 1px; height: 40px; background: var(--border2); }

/* ═══════════════ BUTTONS ═══════════════ */
.btn-primary {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: 14px 32px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 0 0 var(--accent-glow);
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
  background: var(--accent2);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.full-width { width: 100%; justify-content: center; display: flex; }

.btn-ghost {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-pill);
  padding: 14px 32px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ═══════════════ AUTH FORMS ═══════════════ */
.auth-container {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.back-btn {
  position: absolute; top: 24px; left: 24px;
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  font-family: var(--font-body); font-size: 14px;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--accent); }

.auth-logo {
  width: 64px; height: 64px;
  background: var(--accent);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 22px; color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px var(--accent-glow);
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  margin-bottom: 8px;
}

.auth-sub { color: var(--text2); font-size: 14px; }
.auth-sub .highlight { color: var(--accent); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

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

.form-group label {
  font-size: 13px; font-weight: 500;
  color: var(--text2); letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group select option { background: var(--surface); }

.form-error {
  color: #f87171; font-size: 13px;
  display: none;
  padding: 10px 14px;
  background: rgba(248,113,113,0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248,113,113,0.2);
}
.form-error.show { display: block; }

.form-switch {
  text-align: center; font-size: 14px;
  color: var(--text2);
}
.form-switch a {
  color: var(--accent); cursor: pointer;
  font-weight: 500; text-decoration: none;
}
.form-switch a:hover { text-decoration: underline; }

/* ═══════════════ TOP BAR ═══════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--top-h);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  z-index: 100;
}

.topbar-left {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

.topbar-logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.topbar-uni {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text3);
  background: var(--surface);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.topbar-center { flex: 1; }

.search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px;
  font-size: 18px; color: var(--text3);
  pointer-events: none;
}
#search-input {
  width: 100%; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 16px 0 38px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
#search-input:focus {
  border-color: var(--accent);
  background: var(--surface2);
}
#search-input::placeholder { color: var(--text3); }

.topbar-right {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

.icon-btn {
  background: none; border: none;
  cursor: pointer; position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
  font-size: 18px;
}
.icon-btn:hover { background: var(--surface); }

.badge {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: var(--pink);
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  color: #fff; display: flex;
  align-items: center; justify-content: center;
}

.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: #fff;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.avatar-btn:hover { border-color: var(--accent); }

/* ═══════════════ SEARCH DROPDOWN ═══════════════ */
.search-dropdown {
  position: fixed; top: var(--top-h); left: 50%;
  transform: translateX(-50%);
  width: min(500px, 90vw);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 99; overflow: hidden;
  display: none;
}
.search-dropdown.open { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg3); }
.search-result-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 15px; color: #fff; flex-shrink: 0;
}
.search-result-info strong { display: block; font-weight: 600; font-size: 14px; }
.search-result-info span { font-size: 12px; color: var(--text3); }

/* ═══════════════ APP MAIN ═══════════════ */
.app-main {
  padding-top: var(--top-h);
  padding-bottom: calc(var(--nav-h) + 16px);
  min-height: 100vh;
}

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

/* ═══════════════ STORIES ═══════════════ */
.stories-wrap {
  display: flex; gap: 16px;
  padding: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories-wrap::-webkit-scrollbar { display: none; }

.story-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  cursor: pointer; flex-shrink: 0;
}
.story-item span {
  font-size: 11px; color: var(--text2);
  white-space: nowrap;
}

.story-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  position: relative;
}
.story-avatar::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink), var(--yellow));
  z-index: -1;
}
.story-avatar.add-av {
  background: var(--surface2);
  border: 2px dashed var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--text3);
  font-weight: 300;
}
.story-avatar.add-av::before { display: none; }

/* ═══════════════ COMPOSER ═══════════════ */
.composer-card {
  margin: 0 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; gap: 12px;
}

.composer-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: #fff;
}

.composer-body { flex: 1; min-width: 0; }

.composer-body textarea {
  width: 100%;
  background: none;
  border: none; outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.5;
  resize: none; overflow: hidden;
  min-height: 44px;
}
.composer-body textarea::placeholder { color: var(--text3); }

.composer-actions {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.composer-media { display: flex; gap: 8px; }
.media-btn {
  background: none; border: none;
  cursor: pointer; font-size: 18px;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.media-btn:hover { background: var(--surface2); }
.media-btn[title="GIF"] {
  font-size: 11px; font-weight: 700;
  color: var(--green); letter-spacing: 0.05em;
}

.btn-post {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  background: var(--accent);
  color: #fff; border: none;
  border-radius: var(--radius-pill);
  padding: 8px 20px; cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.03em;
}
.btn-post:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

/* ═══════════════ FEED POSTS ═══════════════ */
.feed-loading {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  padding: 48px 16px;
  color: var(--text3);
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.post-card {
  margin: 0 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fade-up 0.3s ease both;
  transition: border-color var(--transition);
}
.post-card:hover { border-color: var(--border2); }

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

.post-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}

.post-user-info { flex: 1; min-width: 0; }
.post-user-info strong {
  display: block; font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--text);
}
.post-user-info strong:hover { color: var(--accent); }

.post-meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 12px; color: var(--text3);
}

.uni-chip {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.verified-badge { color: var(--accent); font-size: 13px; }

.post-menu-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 18px;
  width: 32px; height: 32px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.post-menu-btn:hover { background: var(--surface2); color: var(--text); }

.post-content {
  padding: 4px 16px 14px;
  font-size: 15px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}

.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.post-actions {
  display: flex; align-items: center;
  padding: 10px 16px 14px;
  gap: 4px;
  border-top: 1px solid var(--border);
}

.action-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px; padding: 6px 10px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}
.action-btn:hover { background: var(--surface2); color: var(--text); }
.action-btn.liked { color: var(--pink); }
.action-btn.liked:hover { background: rgba(244,114,182,0.1); }

.action-btn .count { font-weight: 600; }

.share-btn { margin-left: auto; }

/* ═══════════════ DISCOVER ═══════════════ */
.discover-header {
  padding: 24px 16px 16px;
}
.discover-header h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
}
.discover-header p { color: var(--text2); font-size: 14px; }

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; padding: 0 16px;
}

.discover-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.discover-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.discover-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 20px; color: #fff;
}

.discover-card-name {
  font-weight: 600; font-size: 14px;
  text-align: center;
}
.discover-card-dept {
  font-size: 11px; color: var(--text3);
  text-align: center;
}
.discover-card-level {
  font-size: 11px; font-weight: 700;
  color: var(--green);
  background: rgba(34,211,165,0.1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.btn-connect {
  width: 100%;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 7px 0; cursor: pointer;
  transition: var(--transition); letter-spacing: 0.05em;
}
.btn-connect:hover { background: var(--accent); color: #fff; }

/* ═══════════════ CHAT ═══════════════ */
.chat-layout {
  display: flex; height: calc(100vh - var(--top-h) - var(--nav-h));
}

.chat-sidebar {
  width: 280px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}

.chat-sidebar-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.chat-sidebar-header h3 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
}

.chat-list { flex: 1; overflow-y: auto; }

.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.chat-item:hover { background: var(--surface2); }
.chat-item.active { background: var(--surface2); }

.chat-item-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-info strong { display: block; font-size: 14px; font-weight: 600; }
.chat-item-info span { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 11px; color: var(--text3); flex-shrink: 0; }

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

.chat-empty-state {
  flex: 1; display: flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 40px;
  color: var(--text2);
}
.chat-empty-icon { font-size: 48px; }
.chat-empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--text);
}
.chat-empty-state p { font-size: 14px; text-align: center; }

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.chat-header-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: #fff;
}
.chat-header-info strong { display: block; font-size: 14px; font-weight: 600; }
.chat-header-info span { font-size: 12px; color: var(--green); }

.messages-area {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex;
  flex-direction: column; gap: 8px;
}

.msg {
  max-width: 72%; padding: 10px 14px;
  border-radius: 16px; font-size: 14px;
  line-height: 1.5; word-break: break-word;
}
.msg.sent {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.received {
  align-self: flex-start;
  background: var(--surface2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: 10px; opacity: 0.6;
  display: block; margin-top: 4px;
}

.chat-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-wrap input {
  flex: 1; background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  color: var(--text); font-family: var(--font-body);
  font-size: 14px; outline: none;
  transition: border-color var(--transition);
}
.chat-input-wrap input:focus { border-color: var(--accent); }
.chat-input-wrap input::placeholder { color: var(--text3); }

.send-btn {
  width: 40px; height: 40px;
  background: var(--accent); border: none;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition);
  flex-shrink: 0; color: #fff;
}
.send-btn:hover { background: var(--accent2); transform: scale(1.05); }

/* ═══════════════ PROFILE ═══════════════ */
.profile-cover {
  height: 140px;
  background: linear-gradient(135deg, #1a1030, #0f1a30, #1a0f30);
  position: relative;
}
.profile-cover::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(124,106,247,0.3) 0%, transparent 60%),
    radial-gradient(circle at 70% 50%, rgba(244,114,182,0.2) 0%, transparent 60%);
}

.profile-main {
  padding: 0 16px 24px;
  background: var(--bg);
}

.profile-avatar-wrap {
  margin-top: -36px;
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 28px; color: #fff;
  border: 3px solid var(--bg);
  position: relative; z-index: 1;
}

.btn-edit-profile {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  background: none;
  border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--radius-pill);
  padding: 8px 20px; cursor: pointer;
  transition: var(--transition); letter-spacing: 0.03em;
}
.btn-edit-profile:hover { border-color: var(--accent); color: var(--accent); }

.profile-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  margin-bottom: 2px;
}
.profile-username { font-size: 14px; color: var(--text3); margin-bottom: 8px; }
.profile-bio { font-size: 14px; color: var(--text2); margin-bottom: 16px; line-height: 1.5; }

.profile-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  font-size: 12px; font-weight: 500;
  padding: 4px 12px; border-radius: var(--radius-pill);
}
.chip-dept { background: rgba(124,106,247,0.15); color: var(--accent2); }
.chip-level { background: rgba(34,211,165,0.15); color: var(--green); }
.chip-uni { background: rgba(251,191,36,0.15); color: var(--yellow); }

.profile-stats {
  display: flex; gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-stat { text-align: center; }
.profile-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
}
.profile-stat-label { font-size: 12px; color: var(--text3); }

.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.profile-posts-list { display: flex; flex-direction: column; gap: 12px; }

/* ═══════════════ NOTIFICATIONS ═══════════════ */
.notif-header {
  padding: 24px 16px 16px;
}
.notif-header h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
}

.notif-list { padding: 0 16px; }

.notif-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.notif-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.notif-text strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.notif-text span { font-size: 13px; color: var(--text2); }
.notif-text time { display: block; font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ═══════════════ BOTTOM NAV ═══════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}

.nav-btn {
  flex: 1; background: none; border: none;
  cursor: pointer; display: flex;
  flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--text3);
}
.nav-btn:hover { color: var(--text); background: var(--surface); }
.nav-btn.active { color: var(--accent); }

.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 11px; font-weight: 500; font-family: var(--font-display); }

.post-btn {
  flex: 0 0 56px;
  width: 56px; height: 44px;
  background: var(--accent) !important;
  border-radius: 14px !important;
  color: #fff !important;
  box-shadow: 0 4px 20px var(--accent-glow);
  margin: 0 8px;
  padding: 0 !important;
  display: flex; align-items: center; justify-content: center;
}
.post-btn:hover {
  background: var(--accent2) !important;
  transform: translateY(-2px);
}
.plus-icon { font-size: 26px !important; font-weight: 300 !important; }

/* ═══════════════ MODALS ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.modal-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: min(480px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal-card { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.modal-header button {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 18px;
  width: 32px; height: 32px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-header button:hover { background: var(--surface); color: var(--text); }

/* ═══════════════ INSTALL BANNER ═══════════════ */
.install-banner {
  position: fixed; bottom: calc(var(--nav-h) + 12px);
  left: 12px; right: 12px;
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  z-index: 150;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slide-up 0.4s ease;
}

.install-content {
  display: flex; align-items: center; gap: 12px;
}
.install-icon { font-size: 28px; }
.install-text strong { display: block; font-size: 14px; font-weight: 600; }
.install-text span { font-size: 12px; color: var(--text2); }

.install-actions { display: flex; gap: 8px; align-items: center; }
.btn-install {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: 8px 18px; cursor: pointer;
  transition: var(--transition);
}
.btn-install:hover { background: var(--accent2); }
.btn-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 18px;
  width: 32px; height: 32px;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
}
.btn-dismiss:hover { background: var(--surface); }

/* ═══════════════ UTILITIES ═══════════════ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 48px 24px;
  color: var(--text3);
  text-align: center;
}
.empty-state span { font-size: 36px; }
.empty-state p { font-weight: 600; color: var(--text2); }
.empty-state small { font-size: 13px; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 640px) {
  .chat-sidebar { width: 100%; }
  .chat-sidebar.hidden { display: none; }
  .chat-window { width: 100%; }
  .chat-window.hidden { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .discover-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .app-main { max-width: 640px; margin: 0 auto; }
  .topbar { max-width: 100%; }
  .bottom-nav { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

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

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.comment-body {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.comment-body strong {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.comment-body strong:hover { color: var(--accent); }

.comment-time {
  font-size: 11px;
  color: var(--text3);
  margin-left: 6px;
}

.comment-body p {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}

.comment-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.comment-input:focus { border-color: var(--accent); }

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

/* ── STORIES ─────────────────────────────────────── */
.story-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.story-overlay.open { display: flex; }

.story-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.story-user-info strong { color: #fff; font-size: 15px; display: block; }
.story-user-info time { color: rgba(255,255,255,0.7); font-size: 12px; }

.story-close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-caption {
  position: absolute;
  bottom: 60px;
  left: 20px;
  right: 20px;
  color: #fff;
  font-size: 15px;
  text-align: center;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  padding: 8px 12px;
}

.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.story-nav.prev { left: 12px; }
.story-nav.next { right: 12px; }

.story-item.unseen .story-avatar {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ── EDIT PROFILE MODAL ─────────────────────────── */
.modal-body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-body label {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  resize: vertical;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  border-color: var(--accent);
}

/* ── NOTIFICATIONS ─────────────────────────────── */
.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: rgba(124,106,247,0.05); }

.notif-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.notif-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-text strong { font-size: 14px; color: var(--text); }
.notif-text span { font-size: 13px; color: var(--text2); }
.notif-text time { font-size: 11px; color: var(--text3); }
.notif-icon { font-size: 18px; }

/* ── CHAT UPDATES ────────────────────────────────── */
.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.chat-list-item:hover { background: var(--surface); }
.chat-list-item.unread { background: rgba(124,106,247,0.05); }

.chat-list-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.chat-list-info {
  flex: 1;
  overflow: hidden;
}

.chat-list-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-info span {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.chat-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

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

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.chat-back-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 4px;
}

/* ── MEDIA MODAL ─────────────────────────────────── */
#media-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#media-modal.open { display: flex; }

/* ── BOTTOM NAV 6 ITEMS ──────────────────────────── */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

