/* =============================================
   Forum PN Jakarta Selatan - Main Stylesheet
   ============================================= */

/* Google Font loaded in HTML */

:root {
  --bg-base: #0d1117;
  --bg-surface: #161b27;
  --bg-card: #1c2333;
  --bg-hover: #222d42;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(108, 156, 255, 0.3);

  --accent-blue: #6b9cff;
  --accent-purple: #a78bfa;
  --accent-cyan: #34d6d9;
  --accent-pink: #f472b6;
  --accent-green: #34d399;

  --text-primary: #e8edf5;
  --text-muted: #8892a4;
  --text-subtle: #4e5a6e;

  --nav-height: 60px;
  --sidebar-w: 240px;
  --right-w: 280px;
  --feed-max: 600px;
  --radius: 16px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* -------- NAVBAR -------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.nav-logo-icon {
  font-size: 1.4rem;
}
.nav-logo-accent {
  color: var(--accent-blue);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-btn:hover,
.nav-btn.active {
  color: var(--accent-blue);
  background: rgba(107, 156, 255, 0.1);
  border-color: rgba(107, 156, 255, 0.2);
}

.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.4rem;
  margin-left: 0.5rem;
}

/* Mobile Menu Overlay & Drawer */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-menu-overlay.show { display: block; opacity: 1; }

.mobile-menu-drawer {
  position: fixed;
  top: 0; right: -320px; width: 280px; height: 100vh;
  background: var(--bg-card);
  z-index: 1001;
  overflow-y: auto;
  padding: 1.5rem 1rem 3rem 1rem;
  box-shadow: -5px 0 25px rgba(0,0,0,0.6);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.mobile-menu-drawer.open { right: 0; }

.mobile-menu-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  align-self: flex-end;
  margin-bottom: -0.5rem;
  transition: color 0.2s;
}
.mobile-menu-close:hover {
  color: var(--text-primary);
}

/* -------- LAYOUT -------- */
.app-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  gap: 1.25rem;
  padding: 1.25rem 1rem;
  align-items: start;
}

/* -------- SIDEBARS -------- */
.sidebar-left,
.sidebar-right {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
}
.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.18s;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.sidebar-link.active {
  color: var(--accent-blue);
  background: rgba(107, 156, 255, 0.1);
}
.sidebar-info p.sidebar-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.trending-mini-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.83rem;
  line-height: 1.4;
  transition: color 0.15s;
}
.trending-mini-item:last-child {
  border-bottom: none;
}
.trending-mini-item:hover {
  color: var(--accent-blue);
}
.trend-rank {
  font-weight: 800;
  color: var(--accent-blue);
  font-size: 0.72rem;
  min-width: 14px;
  padding-top: 1px;
}
.trend-text {
  flex: 1;
}
.no-trend {
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.stats-grid-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.stat-mini-item {
  text-align: center;
}
.stat-mini-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-blue);
  line-height: 1;
}
.stat-mini-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* -------- MAIN FEED -------- */
.feed-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* -------- POST CARD -------- */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: border-color 0.2s;
}
.post-card:focus-within {
  border-color: var(--border-hover);
}
.post-form-header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.post-avatar-wrap {
  flex-shrink: 0;
}
.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.post-form-content {
  flex: 1;
  min-width: 0;
}
.input-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.name-input-row {
  display: flex;
  gap: 0.5rem;
}
.input-field {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.input-field:focus {
  border-color: var(--accent-blue);
}
.input-field::placeholder {
  color: var(--text-subtle);
}
.textarea-field {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  resize: none;
  line-height: 1.6;
  transition: border-color 0.2s;
  min-height: 50px;
}
.textarea-field:focus {
  border-bottom-color: var(--accent-blue);
}
.textarea-field::placeholder {
  color: var(--text-subtle);
}

.btn-next {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-next:hover {
  background: #4f87ff;
  transform: translateY(-1px);
}

.name-display-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.name-tag {
  background: rgba(107, 156, 255, 0.12);
  color: var(--accent-blue);
  border-radius: 100px;
  padding: 0.2rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}
.btn-change-name {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  transition: color 0.15s;
}
.btn-change-name:hover {
  color: var(--text-muted);
}

.post-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.char-counter {
  font-size: 0.8rem;
  color: var(--text-subtle);
}
.btn-post {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.55rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(107, 156, 255, 0.25);
}
.btn-post:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(107, 156, 255, 0.4);
}
.btn-post:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -------- TABS -------- */
.tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.tab-btn {
  flex: 1;
  padding: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  position: relative;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.tab-btn.active {
  color: var(--accent-blue);
  background: rgba(107, 156, 255, 0.06);
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 100px;
}

/* -------- TWEET CARD -------- */
.tweet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    border-top: none;
    padding: 1rem 1.15rem;
    transition: background 0.18s;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}
.tweet-card:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.tweet-card:first-child:last-child { border-radius: var(--radius); border-top: 1px solid var(--border); }
.tweet-card:hover { background: var(--bg-hover); }

.tweet-detail-card {
    display: block; /* Override flex for main detail card */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    width: 100%;
    max-width: none;
}

.tweet-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tweet-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.65rem; }
.tweet-detail-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); }

.tweet-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem; color: #fff; flex-shrink: 0;
}
.tweet-avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }
.tweet-avatar-sm { width: 34px; height: 34px; font-size: 0.85rem; flex-shrink: 0; }

.tweet-meta { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.2rem; }
.tweet-detail-card .tweet-meta { flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 0; }

.tweet-name {
    font-weight: 700; font-size: 0.95rem; color: var(--text-primary);
    text-decoration: none; line-height: 1.2;
}
.tweet-name:hover { color: var(--accent-blue); }
.tweet-time { font-size: 0.8rem; color: var(--text-subtle); }

.tweet-body-link { text-decoration: none; display: block; margin-top: 0.15rem; }
.tweet-content { color: var(--text-primary); font-size: 0.96rem; line-height: 1.5; margin-bottom: 0.75rem; word-wrap: break-word; overflow-wrap: break-word; }
.tweet-content-lg { font-size: 1.15rem; line-height: 1.6; margin-bottom: 1rem; }

.tweet-detail-stats {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.tweet-detail-stats strong {
  color: var(--text-primary);
}

.tweet-footer {
  display: flex;
  gap: 0.25rem;
}
.tweet-detail-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0;
}

.tweet-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.18s;
}
.tweet-action:hover {
  color: var(--accent-blue);
  background: rgba(107, 156, 255, 0.1);
}

/* Like button */
.like-btn .like-icon {
  fill: currentColor;
  transition: transform 0.2s;
}
.like-btn.liked {
  color: #f472b6 !important;
}
.like-btn.liked .like-icon {
  fill: #f472b6;
}
.like-btn:hover .like-icon {
  transform: scale(1.2);
}
@keyframes likePop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.4);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}
.like-pop .like-icon {
  animation: likePop 0.4s ease forwards;
}
.liking {
  opacity: 0.6;
  pointer-events: none;
}

/* -------- REPLIES SECTION -------- */
.replies-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.replies-header {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
}
.reply-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  transition: background 0.15s;
}
.reply-card:hover {
  background: var(--bg-hover);
}
.reply-body {
  flex: 1;
  min-width: 0;
}
.reply-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.reply-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.reply-time {
  font-size: 0.75rem;
  color: var(--text-subtle);
}
.reply-content {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.55;
}
.reply-form-card {
  margin-top: 1rem;
  border-radius: var(--radius) !important;
}

/* -------- LOAD MORE -------- */
.btn-load-more {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--accent-blue);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-load-more:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

/* -------- EMPTY STATE -------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* -------- SKELETON -------- */
.skeleton-loader {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-hover) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  border-radius: 100px;
  animation: shimmer 1.4s infinite;
}
.sk-line {
  height: 12px;
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* -------- TOAST -------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 1.4rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.23, 0.82, 0.31, 1);
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -------- ANIMATIONS -------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}
.shake {
  animation: shake 0.45s ease both;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 1050px) {
    .app-layout { grid-template-columns: 200px 1fr; }
    .sidebar-right { display: none; }
    .hamburger-btn { display: inline-flex; } /* Show hamburger when right sidebar hides */
}
@media (max-width: 750px) {
    body { padding-bottom: 3.5rem; } /* Padded at bottom for mobile interactions */
    .app-layout { grid-template-columns: 1fr; padding: 0.5rem 0; gap: 0; max-width: 600px; margin: 0 auto; }
    .sidebar-left { display: none; }
    .feed-main { gap: 0; }
    .tabs-bar { border-radius: 0; margin-top: auto; }
    .tweet-card { border-radius: 0; border-left: none; border-right: none; padding: 1rem; }
    .tweet-card:first-child:last-child { border-radius: 0; border-left: none; border-right: none; }
    .post-card { border-radius: 0; border-left: none; border-right: none; padding: 1.25rem 1rem; border-top: none;}
    .reply-form-card { border-radius: 0 !important; border-left: none; border-right: none; }
    .empty-state { border-radius: 0; border-left: none; border-right: none; }
    .tweet-detail-card { border-radius: 0; border-left: none; border-right: none; }
    .replies-header { border-left: none; border-right: none; }
    .reply-card { border-left: none; border-right: none; padding: 1rem; }
    .nav-inner { padding: 0 1rem; }
}
@media (max-width: 480px) {
    .app-layout { padding: 0; }
    .nav-logo-text { font-size: 0.95rem; }
    .nav-btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
    .post-form-header { gap: 0.6rem; }
    .avatar-circle { width: 44px; height: 44px; font-size: 1.1rem; }
    .tweet-content { font-size: 0.92rem; }
    .btn-post { padding: 0.5rem 1rem; font-size: 0.85rem; }
}

