/* ===== ScholrNet v2 - Mobile-First Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

:root {
  --primary: #1a2744;
  --primary-hover: #2d4a7a;
  --accent: #c9a84c;
  --accent-soft: #e8d48b;
  --bg: #ebf4ff;
  --bg-card: #ffffff;
  --bg-hover: #fdf0f0;
  --border: #cbd5e1;
  --text: #1e293b;
  --text-muted: #5a6a7a;
  --text-light: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #e86565;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

input, textarea, select {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,39,68,0.08);
}

/* ===== Utility ===== */
.hidden { display: none !important; }
@media (min-width: 640px) { .sm\:block { display: block !important; } }
@media (max-width: 639px) { .sm\:hidden { display: none !important; } }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }.gap-2 { gap: 0.5rem; }.gap-3 { gap: 0.75rem; }.gap-4 { gap: 1rem; }
.p-2 { padding: 0.5rem; }.p-3 { padding: 0.75rem; }.p-4 { padding: 1rem; }.p-5 { padding: 1.25rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }.mt-3 { margin-top: 0.75rem; }.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }.mb-3 { margin-bottom: 0.75rem; }
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.relative { position: relative; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.border { border: 1px solid var(--border); }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 0.75rem;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 2.75rem;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.75rem; min-height: 2.75rem; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; min-height: auto; padding: 0.5rem; }
.btn-xs { padding: 0.15rem 0.35rem; font-size: 0.65rem; min-height: auto; }

/* ===== Badge ===== */
.badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 800;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-primary { background: rgba(10,102,194,0.1); color: var(--primary); }
.badge-success { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-muted { background: rgba(100,116,139,0.1); color: var(--text-muted); }

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 28px; width: auto; }
/* ===== Tab Navigation ===== */
.tab-nav {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 0.125rem;
  overflow-x: auto;
  padding: 0.25rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1.5rem;
  background: linear-gradient(to right, transparent, var(--bg-card));
  pointer-events: none;
  z-index: 1;
}
.tab-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  min-height: 2.75rem;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); background: var(--bg-hover); border-radius: 0.5rem 0.5rem 0 0; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--accent); }

/* ===== Layout ===== */
body { padding-top: 6.5rem; }
.page { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }

/* ===== Post Card ===== */
.post-header { display: flex; align-items: flex-start; gap: 0.75rem; }
.avatar {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.75rem;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.625rem; border-radius: 0.5rem; }
.post-title { font-weight: 700; font-size: 0.9375rem; margin-top: 0.5rem; }
.post-content { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.375rem; line-height: 1.6; }
.post-actions { display: flex; gap: 1.5rem; padding-top: 0.75rem; margin-top: 0.75rem; border-top: 1px solid var(--border); }
.post-action-btn {
  display: flex; align-items: center; gap: 0.375rem;
  font-size: 0.75rem; font-weight: 600;
  background: none; border: none; color: var(--text-muted);
  padding: 0.25rem 0.5rem; border-radius: 0.5rem;
  transition: all 0.15s;
}
.post-action-btn:hover { background: var(--bg-hover); color: var(--text); }
.post-action-btn.liked { color: var(--danger); }
.tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.tag { font-size: 0.625rem; background: var(--bg-hover); color: var(--text-muted); padding: 0.125rem 0.5rem; border-radius: 0.375rem; }

/* ===== Comment ===== */
.comment { display: flex; gap: 0.5rem; padding: 0.5rem; background: var(--bg-hover); border-radius: 0.75rem; margin-bottom: 0.5rem; }
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-size: 0.6875rem; font-weight: 800; }
.comment-text { font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.125rem; }

/* ===== Profile Section ===== */
.profile-header { display: flex; align-items: center; gap: 1rem; }
.profile-avatar { width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; }
.profile-name { font-weight: 900; font-size: 1.125rem; }
.profile-school { font-size: 0.75rem; color: var(--text-muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.stat-box { padding: 0.5rem; background: var(--bg-hover); border-radius: 0.75rem; text-align: center; }
.stat-num { font-weight: 900; font-size: 1.125rem; }
.stat-label { font-size: 0.625rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.skills { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.skill { font-size: 0.625rem; font-weight: 700; background: rgba(10,102,194,0.08); color: var(--primary); padding: 0.125rem 0.5rem; border-radius: 0.75rem; }

/* ===== Verification badge ===== */
.verified-badge { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.625rem; font-weight: 800; padding: 0.125rem 0.5rem; border-radius: 999px; }
.verified-badge.success { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.verified-badge.warning { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.verified-badge.muted { background: rgba(100,116,139,0.1); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== Search ===== */
.search-bar { position: relative; max-width: 20rem; }
.search-bar input { padding-left: 2.25rem; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 0.875rem; }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.ad-card { border-radius: 0.75rem; background: var(--card); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; min-height: 10rem; }
.ad-company { font-size: 0.5rem; text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em; background: rgba(255,255,255,0.15); display: inline-block; padding: 0.125rem 0.5rem; border-radius: 999px; }
.ad-title { font-size: 0.875rem; font-weight: 800; margin-top: 0.5rem; }
.ad-content { font-size: 0.6875rem; opacity: 0.85; margin-top: 0.25rem; }

/* ===== Chat Drawer ===== */
.chat-drawer {
  position: fixed;
  bottom: 0;
  right: 1rem;
  width: 20rem;
  max-width: calc(100vw - 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 100;
  transition: transform 0.3s;
}
.chat-drawer.minimized { transform: translateY(calc(100% - 3rem)); }
.chat-header {
  background: #1e293b;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 1rem 1rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.chat-body { max-height: 24rem; overflow-y: auto; }
.chat-contact { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 3.25rem; }
.chat-contact:hover { background: var(--bg-hover); }
.chat-contact-list { max-height: 300px; overflow-y: auto; }
.chat-messages { padding: 0.75rem; max-height: 16rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-msg { max-width: 85%; padding: 0.5rem 0.75rem; border-radius: 0.75rem; font-size: 0.75rem; }
.chat-msg.sent { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 0; }
.chat-msg.received { background: var(--bg-hover); align-self: flex-start; border-bottom-left-radius: 0; }
.chat-input { display: flex; gap: 0.5rem; padding: 0.5rem; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; font-size: 0.6875rem; }

/* ===== Notification Dropdown ===== */
.notif-panel {
  position: absolute; right: 0; top: 100%; margin-top: 0.5rem;
  width: 22rem; max-width: calc(100vw - 2rem);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 200; max-height: 24rem; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.notif-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.75rem; }
.notif-item.unread { background: rgba(249,115,22,0.05); }
.notif-item:hover { background: var(--bg-hover); }

/* ===== Settings Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 300;
}
.modal {
  background: var(--bg-card); border-radius: 1rem;
  max-width: 32rem; width: 100%; max-height: 90vh;
  overflow-y: auto; border: 1px solid var(--border);
}
.modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ===== Alert Toast ===== */
.toast {
  position: fixed; bottom: 1rem; right: 1rem;
  padding: 0.75rem 1rem; border-radius: 0.75rem;
  font-size: 0.75rem; font-weight: 600;
  color: #fff; z-index: 1000;
  animation: slideUp 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.info { background: var(--primary); }

@keyframes slideUp {
  from { transform: translateY(1rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.2s ease; }

/* ===== Shimmer Loading ===== */
.shimmer {
  background: linear-gradient(90deg, var(--bg-hover) 25%, transparent 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Bottom Nav (Mobile) ===== */
/* REMOVED: using top tab-nav instead */
/* ===== Clubs ===== */
.club-card { transition: transform 0.15s, box-shadow 0.15s; }
.club-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.club-member { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 0.5rem; transition: background 0.15s; cursor: pointer; }
.club-member:hover { background: var(--bg-hover); }

/* ===== Menu Overlay & More Panel ===== */
/* REMOVED: more menu no longer needed */

/* ===== Responsive ===== */
@media (max-width: 639px) {
  body { padding-top: 6rem; }
  .page { padding: 0.75rem; }
  .card { padding: 0.75rem; border-radius: 0.75rem; }
  .header-inner { padding: 0.5rem 0.75rem; }
  .tab-nav { padding: 0.125rem 0.375rem; gap: 0; }
  .tab-btn { padding: 0.375rem 0.5rem; font-size: 0.6875rem; min-height: 2.75rem; }
  .btn-sm { min-height: 2.75rem; }
  .post-action-btn { padding: 0.5rem 0.75rem; }
  input, textarea, select { font-size: 16px !important; }
  .modal-body { padding: 1rem; }
  .modal-header { padding: 0.75rem 1rem; }
  .modal { margin: 0.5rem; }
  .profile-header { gap: 0.75rem; }
  .post-actions { gap: 0.75rem; }
  #chatView { height: 60vh !important; }
  .chat-drawer { display: none !important; }
  .notif-panel {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-height: 70vh !important;
    margin-top: 0 !important;
  }
  .palette-picker { justify-content: center; }
  #createPostModal .modal { height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; display: flex; flex-direction: column; }
  #createPostModal .modal-body { flex: 1; overflow-y: auto; }
  footer { display: none; }
}

@media (min-width: 640px) {
  .tab-nav { padding: 0.5rem 1.5rem; }
  .page { padding: 1.5rem; }
  .grid-3 { grid-template-columns: 1fr 2fr; }
  .main-content-lg { order: 2; }
  .sidebar-left { order: 1; }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 2fr 1fr; }
  .sidebar-right { display: block; order: 3; }
}

/* Mobile-first: sidebar right is hidden by default */
.sidebar-right { display: none; }

/* Chat page mobile fix */
@media (max-width: 639px) {
  .chat-main-col { grid-column: 1 !important; }
  .school-form-grid { grid-template-columns: 1fr !important; }
  .profile-form-grid { grid-template-columns: 1fr !important; }
}

/* Chart grid collapse on mobile */
@media (max-width: 639px) {
  .chart-grid { grid-template-columns: 1fr !important; }
}

/* Admin form responsive grids */
.ad-form-grid { grid-template-columns: 1fr; }
.ad-form-grid-3 { grid-template-columns: 1fr; }
.ad-form-grid-2 { grid-template-columns: 1fr; }
@media (min-width: 480px) {
  .ad-form-grid { grid-template-columns: 1fr 1fr; }
  .ad-form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .ad-form-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Palette picker hover effect */
.palette-option { transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.palette-option:hover { transform: scale(1.15); }

/* Skeleton loading */
@keyframes skeletonShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 800px 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
  border-radius: 0.5rem;
}
.skeleton-sm { height: 0.75rem; width: 40%; margin-bottom: 0.5rem; }
.skeleton-md { height: 1rem; width: 75%; margin-bottom: 0.5rem; }
.skeleton-lg { height: 6rem; width: 100%; margin-bottom: 0.5rem; }
.skeleton-circle { width: 2.5rem; height: 2.5rem; border-radius: 50%; flex-shrink: 0; }
.skeleton-card { padding: 1rem; background: var(--bg-card); border-radius: 1rem; margin-bottom: 0.75rem; }

/* Instagram-style media carousel */
.media-carousel { position:relative; overflow:hidden; border-radius:0.75rem; margin-top:0.75rem; background:var(--bg-hover); }
.media-carousel-track { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.media-carousel-track::-webkit-scrollbar { display:none; }
.media-carousel-slide { flex:0 0 100%; scroll-snap-align:start; display:flex; align-items:center; justify-content:center; max-height:500px; background:var(--bg-hover); }
.media-carousel-slide img, .media-carousel-slide video { width:100%; max-height:500px; object-fit:cover; display:block; }
.media-carousel-dots { position:absolute; bottom:8px; left:50%; transform:translateX(-50%); display:flex; gap:5px; padding:4px 8px; background:rgba(0,0,0,0.35); border-radius:12px; }
.media-carousel-dot { width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,0.5); cursor:pointer; transition:all 0.2s; border:none; padding:0; }
.media-carousel-dot.active { background:#fff; transform:scale(1.3); }
.media-carousel-embed { margin-top:0.75rem; position:relative; padding-bottom:56.25%; height:0; overflow:hidden; border-radius:0.75rem; }
.media-carousel-embed iframe { position:absolute; top:0; left:0; width:100%; height:100%; }

/* Typing indicator */
.typing-indicator { display:flex; align-items:center; gap:3px; padding:8px 12px; }
.typing-dot { width:6px; height:6px; border-radius:50%; background:var(--text-muted); animation:typingBounce 1.4s infinite ease-in-out; }
.typing-dot:nth-child(1) { animation-delay:0s; }
.typing-dot:nth-child(2) { animation-delay:0.2s; }
.typing-dot:nth-child(3) { animation-delay:0.4s; }
@keyframes typingBounce { 0%,60%,100% { transform:translateY(0); opacity:0.4; } 30% { transform:translateY(-4px); opacity:1; } }
