/**
 * Study Grid Prep – Exam Community Stylesheet (community.css)
 * Clean, professional, social-platform-inspired aesthetic.
 * Fully optimized for Phone (<768px), Tablet (768px - 1024px), and Laptop/Desktop (>1024px).
 */

/* ==========================================================================
   1. COLOR VARIABLES & DESIGN TOKENS (LIGHT & DARK THEMES)
   ========================================================================== */
:root {
  --bg: #F0F2F8;
  --surface: #FFFFFF;
  --surface2: #F4F6FB;
  --surface3: #E8ECF4;
  --border: #E2E8F2;
  --border-subtle: rgba(226, 232, 242, 0.7);
  --text: #0F172A;
  --text2: #5A6785;
  --text3: #94A3B8;
  --accent: #5B5BF6;
  --accent2: #7C3AED;
  --accent-light: rgba(91, 91, 246, 0.1);
  --accent-glow: rgba(91, 91, 246, 0.25);
  --red: #EF4444;
  --red-light: rgba(239, 68, 68, 0.1);
  --green: #10B981;
  --green-light: rgba(16, 185, 129, 0.1);
  --amber: #F59E0B;
  --amber-light: rgba(245, 158, 11, 0.1);
  --header-bg: rgba(240, 242, 248, 0.97);
  --nav-bg: rgba(248, 249, 253, 0.98);
  --card-radius: 20px;
  --btn-radius: 12px;
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.14);
  --t: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --content-max: 760px;
}

[data-theme="dark"] {
  --bg: #0D1120;
  --surface: #151E32;
  --surface2: #1A2440;
  --surface3: #223055;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text: #E8F0FE;
  --text2: #8B9EC8;
  --text3: #4A5F8E;
  --accent: #6868F8;
  --accent2: #8B5CF6;
  --accent-light: rgba(104, 104, 248, 0.15);
  --accent-glow: rgba(104, 104, 248, 0.35);
  --red: #F87171;
  --red-light: rgba(239, 68, 68, 0.16);
  --green: #34D399;
  --green-light: rgba(16, 185, 129, 0.16);
  --amber: #FBBF24;
  --amber-light: rgba(245, 158, 11, 0.16);
  --header-bg: rgba(13, 17, 32, 0.97);
  --nav-bg: rgba(13, 17, 32, 0.98);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.70);
}

/* ==========================================================================
   2. RESET, BASE TYPOGRAPHY & ICON PRESERVATION
   ========================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body, button, input, select, textarea {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Explicit Font Awesome icon font protection - never let Poppins override icons */
.fa, .fas, .far, .fal, .fad, .fab,
.fa-solid, .fa-regular, .fa-light, .fa-thin, .fa-duotone, .fa-brands,
[class*="fa-"], [class^="fa-"] {
  font-family: "Font Awesome 6 Free", "FontAwesome" !important;
  font-weight: 900;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  line-height: 1 !important;
  display: inline-block;
  vertical-align: -0.125em;
  speak: none;
}

.fa-regular, .far {
  font-weight: 400 !important;
}

.fa-brands, .fab {
  font-family: "Font Awesome 6 Brands", "FontAwesome" !important;
  font-weight: 400 !important;
}

.fa::before, .fas::before, .far::before, .fal::before, .fad::before,
.fa-solid::before, .fa-regular::before, .fa-light::before, .fa-thin::before, .fa-duotone::before,
[class*="fa-"]::before, [class^="fa-"]::before {
  font-family: inherit !important;
  font-style: inherit !important;
  font-weight: inherit !important;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 76px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
  animation: pageIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* Page Transition Overlay */
#pageTransition {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#pageTransition.leaving {
  opacity: 1;
  pointer-events: all;
}

input, textarea, select, [contenteditable="true"], pre, code, .code-header, .post-code-block, .post-title, .post-body, .reply-text {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* Hidden scrollbars while maintaining smooth touch gesture */
::-webkit-scrollbar {
  width: 0px;
  height: 0px;
  display: none;
}
* {
  scrollbar-width: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   3. INTRO ANIMATION (PERSONALIZED BUILDING COMMUNITY)
   ========================================================================== */
#introOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#introOverlay.fade-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.intro-skip-btn {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--t);
  z-index: 10;
}

.intro-skip-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface3);
}

.intro-node-network {
  width: 140px;
  height: 140px;
  position: relative;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(91, 91, 246, 0.4);
  animation: spinSlow 12s linear infinite;
}

.intro-pulse-ring-2 {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.35);
  animation: spinRev 7s linear infinite;
}

.intro-core-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 14px 32px var(--accent-glow);
  animation: glowPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.intro-floating-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.dot-1 {
  top: 8px;
  left: 18px;
  animation: floatDot 2.8s ease-in-out infinite;
}

.dot-2 {
  bottom: 14px;
  right: 14px;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: floatDot 3.2s ease-in-out infinite 0.5s;
}

.dot-3 {
  top: 40px;
  right: 4px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: floatDot 2.4s ease-in-out infinite 0.9s;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.intro-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.intro-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-sub {
  font-size: 13.5px;
  color: var(--text2);
  max-width: 360px;
  line-height: 1.55;
  margin-bottom: 22px;
  min-height: 42px;
}

.intro-progress-bar {
  width: 220px;
  height: 5px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.intro-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   4. HEADER (CONTENT-HUB STYLE GLASSMORPHISM)
   ========================================================================== */
header.hub-header {
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  transition: background var(--t), border-color var(--t);
}

.hub-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.hub-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, background var(--t), border-color var(--t);
}

.hub-back-btn i {
  color: var(--text) !important;
  font-size: 16px !important;
  display: inline-block;
}

.hub-back-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}

.hub-back-btn:hover i {
  color: var(--accent) !important;
}

.hub-back-btn:active {
  transform: scale(0.92);
}

.hub-title-wrap {
  flex: 1;
  min-width: 0;
}

.hub-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-subtitle {
  font-size: 11.5px;
  color: var(--text2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exam-chip {
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid rgba(91, 91, 246, 0.3);
  transition: all var(--t);
  flex-shrink: 0;
}

.exam-chip i {
  color: var(--accent);
}

.exam-chip:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.exam-chip:hover i {
  color: #FFFFFF !important;
}

.hub-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hub-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, color var(--t), background var(--t), border-color var(--t);
}

.hub-icon-btn i {
  color: var(--text) !important;
  font-size: 16px !important;
  display: inline-block;
}

.hub-icon-btn:hover {
  background: var(--surface2);
  color: var(--accent);
  border-color: var(--accent);
}

.hub-icon-btn:hover i {
  color: var(--accent) !important;
}

.hub-icon-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   PULL TO REFRESH COMPONENT
   ========================================================================== */
.pull-refresh-container {
  overflow: hidden;
  height: 0px;
  max-height: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 600;
  transition: height 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease, margin 0.2s ease;
  opacity: 0;
  pointer-events: none;
  margin-bottom: 0px;
  will-change: height, opacity;
}

.pull-refresh-container.pulling {
  transition: none;
  opacity: 1;
}

.pull-refresh-container.refreshing {
  height: 48px;
  max-height: 48px;
  opacity: 1;
  margin-bottom: 12px;
}

.pull-refresh-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
}

.pull-refresh-spinner i {
  color: var(--accent) !important;
  font-size: 14px !important;
  transition: transform 0.2s ease;
  display: inline-block;
}

.pull-refresh-spinner.flipped i {
  transform: rotate(180deg);
}

.feed-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}

.feed-refresh-btn:hover {
  background: var(--surface2);
  color: var(--accent);
  border-color: var(--accent);
}

.feed-refresh-btn i {
  font-size: 12px;
}

.notif-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  display: none;
}

.notif-badge.show {
  display: block;
  animation: pulseScale 2s infinite;
}

.time-limit-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text2);
  letter-spacing: -0.2px;
}

.time-limit-pill.warn {
  background: var(--amber-light);
  color: #D97706;
  border-color: rgba(245, 158, 11, 0.35);
}

.time-limit-pill.danger {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.35);
  animation: pulseScale 1.5s infinite;
}

/* ==========================================================================
   5. MAIN WRAPPER & RESPONSIVE LAYOUT
   ========================================================================== */
.main-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 16px 30px;
  width: 100%;
}

/* ==========================================================================
   6. CREATE POST CARD PROMPT (SOCIAL PLATFORM COMPOSER BAR)
   ========================================================================== */
.post-trigger-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--card-radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform 0.15s ease;
}

.post-trigger-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.post-trigger-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-light);
}

.post-trigger-input {
  flex: 1;
  font-size: 13.5px;
  color: var(--text3);
  font-weight: 500;
  user-select: none;
}

.post-trigger-btn {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform 0.15s ease, background var(--t);
}

.post-trigger-btn:hover {
  background: var(--accent2);
}

.post-trigger-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   7. CATEGORY FILTER STRIP (MOBILE HORIZONTAL SWIPE / DESKTOP SEGMENTED)
   ========================================================================== */
.filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  padding: 7px 15px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--t);
  user-select: none;
}

.filter-chip i {
  font-size: 11px;
}

.filter-chip:hover:not(.active) {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--accent);
}

.filter-chip.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.filter-chip.active i {
  color: #FFFFFF;
}

/* ==========================================================================
   8. SUBBAR: SEARCH & REAL-TIME STATS
   ========================================================================== */
.community-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.community-stat {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.community-stat i {
  color: var(--accent);
}

.community-search-box {
  flex: 1;
  max-width: 260px;
  position: relative;
}

.community-search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}

.community-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.community-search-box i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 12px;
  pointer-events: none;
}

/* ==========================================================================
   9. POST CARD (SOCIAL-PLATFORM FEED ARCHITECTURE)
   ========================================================================== */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: border-color var(--t), box-shadow var(--t), transform 0.18s ease;
}

.post-card:hover {
  border-color: rgba(91, 91, 246, 0.35);
  box-shadow: var(--shadow);
}

.post-card.highlight-pulse {
  animation: postHighlight 2.4s ease;
}

.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.post-author-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.post-meta {
  min-width: 0;
}

.post-author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--green-light);
  color: var(--green);
}

.post-time-exam {
  font-size: 11.5px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Category tag without static pill enclosure - clean, readable accent */
.cat-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cat-tag.doubt {
  background: var(--amber-light);
  color: #D97706;
}

.cat-tag.news {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
}

.cat-tag.strategy {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent2);
}

.cat-tag.general {
  background: var(--green-light);
  color: var(--green);
}

.post-reported-badge {
  background: var(--red-light);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 7px 12px;
  margin-bottom: 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.45;
  letter-spacing: -0.2px;
}

.post-body {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
}

/* Code Snippet Box (for B.Tech / Engg) */
.post-code-block {
  background: #0B101E;
  border: 1px solid #1E293B;
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #E2E8F0;
  overflow-x: auto;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid #1E293B;
  padding-bottom: 8px;
  font-size: 11px;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

.copy-code-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #CBD5E1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* ==========================================================================
   10. INTERACTION ACTION BAR (LIKES, DISLIKES, COMMENTS, VIEWS, SHARE)
   ========================================================================== */
.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.post-actions-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.action-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.action-btn.active-like {
  color: var(--red);
  background: var(--red-light);
}

.action-btn.active-dislike {
  color: var(--text);
  background: var(--surface2);
}

.action-btn i {
  font-size: 14px;
  transition: transform 0.15s var(--ease-spring);
}

.action-btn:active i {
  transform: scale(1.25);
}

.views-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--surface2);
}

/* ==========================================================================
   11. INSTAGRAM/THREADS-STYLE REPLIES & COMMENTS DRAWER
   ========================================================================== */
.replies-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: none;
}

.replies-wrap.open {
  display: block;
  animation: fadeIn 0.2s ease;
}

.reply-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.reply-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface2);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), #9333EA);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reply-content {
  flex: 1;
  min-width: 0;
}

.reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.reply-author {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.reply-time {
  font-size: 10.5px;
  color: var(--text3);
}

.reply-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  word-break: break-word;
}

.reply-tag {
  color: var(--accent);
  font-weight: 600;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
}

.reply-sub-btn {
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--t);
}

.reply-sub-btn:hover {
  color: var(--accent);
}

.reply-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px 6px 14px;
  transition: border-color var(--t), box-shadow var(--t);
}

.reply-input-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.reply-input-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
}

.reply-send-btn {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: transform 0.15s ease, background var(--t);
}

.reply-send-btn:hover {
  background: var(--accent2);
}

.reply-send-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   12. FLOATING ACTION BUTTON (QUICK ASK DOUBT / POST)
   ========================================================================== */
.fab-post {
  position: fixed;
  bottom: 86px;
  right: 20px;
  z-index: 400;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #FFFFFF;
  border: none;
  border-radius: 99px;
  padding: 13px 22px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 10px 28px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.fab-post:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 14px 34px var(--accent-glow);
}

.fab-post:active {
  transform: scale(0.95);
}

/* ==========================================================================
   13. COMPOSER MODAL (STRICT ANTI-LINK/ANTI-PHONE/ANTI-SPAM)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.22s ease;
}

.modal-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalSlideUp 0.28s var(--ease-spring);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--t);
}

.modal-close-btn:hover {
  background: var(--surface3);
  color: var(--text);
}

.composer-cat-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 480px) {
  .composer-cat-select {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-choice {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
  user-select: none;
}

.cat-choice:hover {
  border-color: var(--accent);
  color: var(--text);
}

.cat-choice.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.composer-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  font-size: 14px;
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--t), box-shadow var(--t);
}

.composer-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.composer-textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  font-size: 14px;
  color: var(--text);
  outline: none;
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
  margin-bottom: 12px;
  transition: border-color var(--t), box-shadow var(--t);
}

.composer-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.code-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.code-toggle-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.code-snippet-box {
  display: none;
  margin-bottom: 12px;
}

.code-snippet-box.show {
  display: block;
}

.code-lang-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  margin-bottom: 8px;
}

.code-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0B101E;
  border: 1px solid #1E293B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #E2E8F0;
  min-height: 100px;
  resize: vertical;
  outline: none;
}

.emoji-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding: 4px 0;
}

.emoji-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.emoji-btn:hover {
  transform: scale(1.18);
  background: var(--surface3);
}

.safety-notice {
  background: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #D97706;
  margin-bottom: 16px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ==========================================================================
   14. SECURITY WARNING POPUP & TIME RESTRICTION
   ========================================================================== */
.security-alert-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 2px solid var(--red);
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 360px;
  width: 90%;
  z-index: 100000;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  display: none;
  animation: popIn 0.25s var(--ease-spring);
}

.security-alert-box.show {
  display: block;
}

.sec-ico {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.sec-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.sec-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 20px;
}

.sec-btn {
  background: var(--red);
  color: #FFFFFF;
  border: none;
  padding: 11px 26px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transition: transform 0.15s ease;
}

.sec-btn:active {
  transform: scale(0.95);
}

/* 60-Minute Daily Study Rest Filter */
#timeLimitOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#timeLimitOverlay.open {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.time-limit-card {
  background: var(--surface);
  border: 2px solid var(--amber);
  border-radius: 28px;
  padding: 34px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: popIn 0.35s var(--ease-spring);
}

.tl-emoji {
  font-size: 54px;
  margin-bottom: 12px;
  display: block;
}

.tl-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.tl-sub {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 24px;
}

.tl-btn-primary {
  display: block;
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: transform 0.15s ease;
}

.tl-btn-primary:active {
  transform: scale(0.97);
}

.tl-btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.tl-btn-secondary:hover {
  background: var(--surface3);
  color: var(--text);
}

/* ==========================================================================
   15. REPORT ISSUE & SUCCESS SHIELD
   ========================================================================== */
.report-option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--t);
}

.report-option-label:hover {
  border-color: var(--red);
  background: var(--surface3);
}

.report-option-label input[type="radio"] {
  accent-color: var(--red);
  width: 17px;
  height: 17px;
}

.report-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.report-success-overlay.show {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.report-success-card {
  background: var(--surface);
  border: 2px solid var(--green);
  border-radius: 28px;
  padding: 36px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: popIn 0.35s var(--ease-spring);
}

.rep-success-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: pulseScale 1.8s ease-in-out infinite;
}

.rep-success-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.rep-success-sub {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 22px;
}

/* ==========================================================================
   16. NOTIFICATION DRAWER
   ========================================================================== */
.notif-drawer {
  position: fixed;
  top: 65px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  padding: 16px;
  display: none;
  animation: fadeIn 0.2s ease;
}

.notif-drawer.open {
  display: block;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface2);
  cursor: pointer;
  transition: background var(--t);
}

.notif-item:hover {
  background: var(--surface3);
}

.notif-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.notif-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
}

.notif-time {
  font-size: 10.5px;
  color: var(--text3);
  margin-top: 3px;
}

/* ==========================================================================
   17. PWA BOTTOM NAVIGATION BAR (IDENTICAL TO DASHBOARD-HOME EXACT)
   ========================================================================== */
.pwa-bottom-nav,
.comm-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg, rgba(248,249,253,0.98));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10002;
  border-top: 1px solid var(--border);
  box-shadow: none;
  border-radius: 0;
}

.pwa-bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 10px;
}

[data-theme="light"] .pwa-bottom-nav,
[data-theme="light"] .comm-bottom-nav {
  background: rgba(255, 255, 255, 0.99) !important;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.07);
}

[data-theme="dark"] .pwa-bottom-nav,
[data-theme="dark"] .comm-bottom-nav {
  background: rgba(13, 17, 32, 0.99) !important;
}

.nav-tab,
.comm-nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text3);
  font-size: 10px;
  font-weight: 500;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 14px;
  transition: color 0.15s ease, transform 0.12s ease;
  min-width: 54px;
  flex: 1;
  max-width: 110px;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.nav-tab i,
.comm-nav-tab i {
  font-size: 20px !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease;
  color: var(--text3) !important;
}

.nav-tab span,
.comm-nav-tab span {
  font-size: 10.5px;
  font-weight: 500;
  color: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .nav-tab:hover,
  .comm-nav-tab:hover {
    color: #5B5BF6;
  }
  .nav-tab:hover i,
  .comm-nav-tab:hover i {
    color: #5B5BF6 !important;
  }
}

.nav-tab:focus,
.nav-tab:focus-visible,
.comm-nav-tab:focus,
.comm-nav-tab:focus-visible {
  outline: none;
}

.nav-tab.active,
.comm-nav-tab.active {
  color: #5B5BF6 !important;
}

.nav-tab.active i,
.comm-nav-tab.active i {
  color: #5B5BF6 !important;
  transform: scale(1.18);
}

.nav-tab:active,
.comm-nav-tab:active {
  transform: scale(0.88);
}

/* Remove any legacy underline pill */
.nav-tab::after,
.comm-nav-tab::after {
  display: none !important;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pwa-bottom-nav,
  .comm-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(64px + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   18. ANIMATIONS KEYFRAMES
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

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

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes glowPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 14px 32px var(--accent-glow);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 18px 40px var(--accent-glow);
  }
}

@keyframes floatDot {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -6px); }
}

@keyframes postHighlight {
  0%, 100% {
    box-shadow: var(--shadow-xs);
    border-color: var(--border);
  }
  25%, 75% {
    box-shadow: 0 0 0 3px var(--accent), 0 10px 28px var(--accent-glow);
    border-color: var(--accent);
  }
}

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

/* ==========================================================================
   19. RESPONSIVE OPTIMIZATION ACROSS EVERY DEVICE:
       - Phones (< 480px)
       - Standard Phones & Phablets (480px - 767px)
       - Tablets (768px - 1024px)
       - Laptops & Desktops (> 1024px)
   ========================================================================== */

/* ── PHONE OPTIMIZATIONS (< 480px) ── */
@media (max-width: 479px) {
  .main-wrap {
    padding: 10px 12px 28px;
  }

  .hub-title {
    font-size: 15px;
  }

  .hub-back-btn,
  .hub-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .time-limit-pill {
    padding: 4px 7px;
    font-size: 10px;
  }

  .post-card {
    padding: 14px;
    border-radius: 16px;
  }

  .post-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .post-author-name {
    font-size: 13px;
  }

  .post-title {
    font-size: 15px;
  }

  .post-body {
    font-size: 13px;
  }

  .post-actions {
    gap: 4px;
  }

  .action-btn {
    padding: 5px 7px;
    font-size: 11.5px;
  }

  .views-pill {
    font-size: 10.5px;
    padding: 4px 7px;
  }

  .fab-post {
    bottom: 80px;
    right: 14px;
    padding: 11px 18px;
    font-size: 12.5px;
  }

  .modal-sheet {
    padding: 18px 14px;
    border-radius: 20px;
  }
}

/* ── TABLET OPTIMIZATIONS (768px - 1024px) ── */
@media (min-width: 768px) and (max-width: 1024px) {
  .main-wrap {
    max-width: 740px;
    padding: 20px 24px 34px;
  }

  .hub-header {
    padding: 14px 24px;
  }

  .hub-header-inner {
    max-width: 740px;
  }

  .hub-title {
    font-size: 18px;
  }

  .post-card {
    padding: 20px;
    border-radius: 22px;
  }

  .post-title {
    font-size: 17px;
  }

  .post-body {
    font-size: 14.5px;
  }

  .filter-strip {
    gap: 10px;
    padding-bottom: 12px;
  }

  .filter-chip {
    padding: 8px 18px;
    font-size: 13px;
  }

  .comm-bottom-nav {
    max-width: 580px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .fab-post {
    bottom: 96px;
    right: max(24px, calc((100vw - 740px) / 2));
  }
}

/* ── LAPTOP & DESKTOP OPTIMIZATIONS (> 1024px) ── */
@media (min-width: 1025px) {
  .main-wrap {
    max-width: 820px;
    padding: 24px 20px 40px;
  }

  header.hub-header {
    padding: 14px 32px;
  }

  .hub-header-inner {
    max-width: 820px;
  }

  .hub-title {
    font-size: 18px;
  }

  .post-trigger-card {
    padding: 16px 20px;
  }

  .post-card {
    padding: 22px 24px;
    border-radius: 22px;
  }

  .post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .post-title {
    font-size: 17px;
  }

  .post-body {
    font-size: 14.5px;
  }

  .filter-strip {
    gap: 10px;
    justify-content: flex-start;
  }

  .filter-chip {
    padding: 8px 18px;
    font-size: 13px;
  }

  .action-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  /* Docked modern bottom floating navigation bar on laptop */
  .comm-bottom-nav {
    max-width: 520px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    height: 60px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .comm-nav-tab:hover {
    color: var(--accent);
  }

  .fab-post {
    bottom: 100px;
    right: max(28px, calc((100vw - 820px) / 2 - 20px));
  }

  .modal-sheet {
    padding: 28px 32px;
  }

  .notif-drawer {
    width: 360px;
    right: max(24px, calc((100vw - 820px) / 2));
  }
}


/* ==========================================================================
   20. APP-LIKE CUSTOM POPUP DIALOGS & TOASTS (NATIVE APP FEEL)
   ========================================================================== */
.app-modal-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-modal-overlay.open {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

.app-modal-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 24px 22px 20px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  transform: scale(0.88) translateY(12px);
  transition: transform 0.25s var(--ease-spring);
}

.app-modal-overlay.open .app-modal-card {
  transform: scale(1) translateY(0);
}

.app-modal-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
}

.app-modal-icon-wrap.warn {
  background: var(--amber-light);
  color: var(--amber);
}

.app-modal-icon-wrap.danger {
  background: var(--red-light);
  color: var(--red);
}

.app-modal-icon-wrap.success {
  background: var(--green-light);
  color: var(--green);
}

.app-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.app-modal-message {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: 20px;
}

.app-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.app-modal-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  flex: 1;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.app-modal-btn:active {
  transform: scale(0.95);
}

.app-modal-btn-confirm {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #FFFFFF;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.app-modal-btn-cancel {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}

.app-modal-btn-danger {
  background: var(--red);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* ─── APP FLOATING TOAST ─── */
.app-toast {
  display: none !important;
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(40px) scale(0.9);
  background: rgba(15, 23, 42, 0.94);
  color: #FFFFFF;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  padding: 10px 18px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 100001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease-spring);
}

[data-theme="dark"] .app-toast {
  background: rgba(30, 41, 69, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

.app-toast.show {
  display: inline-flex !important;
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.app-toast i {
  color: #10B981;
  font-size: 15px;
}
