/* =============================
  GLOBAL
  ============================= */

/* =============================
  COMMENT INPUT & BUTTON
  ============================= */
.comment-input-container {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #ddd;
  outline: none;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.3s;
}

.comment-input:focus {
  border-color: #1876f2;
}

.comment-post-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: #1876f2;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.comment-post-btn:hover {
  background: #0f5bb5;
}

/* Dark theme for comment input and button */
body.dark-theme .comment-input {
  background: #222;
  color: #fff;
  border: 1px solid #444;
}

body.dark-theme .comment-input:focus {
  border-color: #4da6ff;
}

body.dark-theme .comment-post-btn {
  background: #4da6ff;
  color: #222;
}

body.dark-theme .comment-post-btn:hover {
  background: #99ccff;
}
* {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
}

:root {
  --body-color: #efefef;
  --nav-color: #1876f2;
  --bg-color: #fff;
}

.dark-theme {
  --body-color: #0a0a0a;
  --nav-color: #000;
  --bg-color: #000;
}

body {
  background: var(--body-color);
  transition: background 0.3s;
}

/* =============================
   NAVBAR
   ============================= */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-color);
  padding: 5px 5%;
  position: sticky;
  top: 0;
  z-index: 100;
}

h1 {
  color: white;
  font-size: 24px;
  font-weight: 600;
  margin-left: 20px;
  margin-right: 20px;
  text-transform: capitalize;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
}

h1 span {
  background-color: #ffffff;
  color: #1876f2;
  font-size: 30px;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left ul li {
  list-style: none;
  display: inline-block;
  margin: 0 15px;
}

.nav-left ul li i,
.nav-right i {
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-right {
  margin-right: 20px;
}

.search {
  background: #ffffff;
  width: 280px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.nav-right input {
  padding: 8px;
  border-radius: 20px;
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
}

.nav-right input::placeholder {
  color: #999;
}

.nav-right .search i {
  color: #999;
  font-size: 18px;
  margin-right: 5px;
}

/* =============================
   SETTINGS MENU
   ============================= */
.settings-menu {
  position: absolute;
  width: 90%;
  max-width: 350px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  overflow: hidden;
  top: 108%;
  right: 5%;
  max-height: 0;
  transition: max-height 0.3s;
}

.settings-menu.active {
  max-height: 450px;
}

.settings-menu-inner {
  padding: 20px;
}

.settings-menu hr {
  border: 0;
  height: 1px;
  background: #9a9a9a;
  margin: 15px 0;
}

.settings-link {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.settings-link a {
  text-decoration: none;
  color: #1876f2;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

#dark-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #ccc;
  width: 45px;
  border-radius: 15px;
  padding: 2px 3px;
  cursor: pointer;
  display: flex;
}

#dark-btn span {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}

#dark-btn.active {
  padding-left: 23px;
  background: #0a0a0a;
}

/* =============================
   MAIN LAYOUT
   ============================= */
main {
  display: flex;
  justify-content: space-between;
  padding: 13px 5%;
  margin-bottom: 50px;
  min-height: 90vh;
  background: var(--body-color);
}

.left-sidebar,
.right-sidebar {
  flex-basis: 25%;
  position: sticky;
  top: 70px;
  height: fit-content;
}

.main-content {
  flex-basis: 47%;
}

/* =============================
   ADD POST
   ============================= */
.add-post {
  background: var(--bg-color);
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.add-post input,
.add-post textarea {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
}

.add-post button {
  margin-top: 8px;
  padding: 10px;
  border: none;
  background: var(--nav-color);
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
}

/* Preview */
#preview-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.preview-item {
  max-width: 100px;
  max-height: 100px;
  border-radius: 4px;
}

/* =============================
   POSTS
   ============================= */
.post {
  background: var(--bg-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
.post h2 {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 700;
  color: #000;
}

.post h3 {
  margin-bottom: 8px;
}

.post .post-media{
  margin-top: 10px;
  border-radius: 6px;
  max-width: 100%;
}

.post .preview-container{
  max-width: 100%;

}
.post .preview-container .preview{
  border-radius: 6px;
  max-width: 100%;
  max-height: 100px;
  object-fit: cover;
  margin-top: 10px;
  
}

.post .small {
  font-size: 20px;
  font-weight: bolder;
}
.post .post-author-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.date {
  font-size: 12px;
  color: #777;
}

.attachments img,
.attachments video {
  display: block;
  max-width: 90%;       /* scale to 90% of container/screen width */
  max-height: 60vh;     /* prevent from taking full screen height */
  width: auto;          /* maintain aspect ratio */
  height: auto;         /* maintain aspect ratio */
  margin: 10px auto;    /* center the media */
  border-radius: 6px;
  object-fit: contain;  /* ensures videos/images fit nicely inside box */
}


.post-actions {
  margin-top: 10px;
}

.post-actions button {
  margin-right: 10px;
  padding: 6px 12px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.like-button { background: #007BFF; color: #fff; }
.comment-toggle { background: #28a745; color: #fff; }
.delete-post { background: crimson; color: #fff; }

.like-button:hover { background: #0056b3; }
.comment-toggle:hover { background: #1c7c31; }
.delete-post:hover { background: darkred; }

/* =============================
   COMMENTS
   ============================= */
.comments-section {
  margin-top: 10px;
}
.comments-list {
  list-style: none;
  margin-top: 5px;
}
.comment {
  background: #f4f4f4;
  margin: 3px 0;
  padding: 5px;
  border-radius: 3px;
  font-size: 14px;
}

/* =============================
   CLEAR POSTS
   ============================= */
.clear-posts {
  text-align: center;
  margin: 20px 0;
}
.clear-posts button {
  padding: 10px 20px;
  border: none;
  background: crimson;
  color: white;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
}
.clear-posts button:hover {
  background: darkred;
}

/* =============================
   FOOTER
   ============================= */
footer {
  text-align: center;
  padding: 10px 0;
  background: var(--nav-color);
  color: white;
  position: fixed;
  bottom: 0;
  width: 100%;
  font-size: 14px;
}

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 992px) {
  main { flex-direction: column; }
  .left-sidebar, .right-sidebar { flex-basis: 100%; margin-bottom: 20px; }
  .main-content { flex-basis: 100%; }
}

@media (max-width: 600px) {
  nav ul { display: none; }
  .left-sidebar, .right-sidebar { display: none; }
  .search { width: 150px; }
  .nav-right input { width: 120px; }
}
/* =============================
   RIGHT SIDEBAR
   ============================= */
.right-sidebar .event {
    position: relative;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: var(--bg-color);
    padding: 10px;
}
.right-sidebar h3 {
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
}
.right-sidebar h3 i {
    margin-right: 10px;
    color: #1876f2;
    font-size: 20px;
}
.right-sidebar p {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;

    font-weight: 400;
}
.right-sidebar a {
    text-decoration: none;
    color: #1876f2;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    margin-top: 5px;
    transition: color 0.3s;
}
.right-sidebar a:hover {
    color: #0f5bb5;
    text-decoration: underline;
}
.right-sidebar h4 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.right-sidebar h4 i {
    margin-left: 10px;
    color: #1876f2;
    font-size: 18px;    
    transition: transform 0.3s;
}
.right-sidebar h4 i.rotate {
    transform: rotate(180deg);
}
.right-sidebar p span {
    color: #1876f2;
    font-size: 14px;
    font-weight: 500;
    margin-right: 5px;
}
.right-sidebar p strong {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-right: 5px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

/* left sidebar*/
/* =============================
   LEFT SIDEBAR
   ============================= */
.left-sidebar {
  flex-basis: 25%;
  position: sticky;
  top: 70px;
  height: fit-content;
  background: var(--bg-color);
  border-radius: 6px;
  padding: 15px;
}

.left-sidebar ul {
  list-style: none;
  padding: 0;
}

.left-sidebar ul li {
  display: flex;
  align-items: center;
  margin: 12px 0;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: #333;
  transition: 0.3s;
  padding: 6px 8px;
  border-radius: 4px;
}

.left-sidebar ul li i {
  margin-right: 10px;
  font-size: 18px;
  color: #1876f2;
  min-width: 25px;
  text-align: center;
}

.left-sidebar ul li:hover {
  background: rgba(24, 118, 242, 0.1);
  padding-left: 12px;
}

/* Divider in sidebar */
.left-sidebar hr {
  margin: 12px 0;
  border: none;
  border-top: 1px solid #ddd;
}

/* =============================
   DARK THEME LEFT SIDEBAR
   ============================= */
body.dark-theme .left-sidebar {
  background: #111;
}

body.dark-theme .left-sidebar ul li {
  color: #fff;
}

body.dark-theme .left-sidebar ul li i {
  color: #fff;
}

body.dark-theme .left-sidebar ul li:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 12px;
}

body.dark-theme .left-sidebar hr {
  border-top: 1px solid #444;
}
/* =============================
   DARK THEME RIGHT SIDEBAR
   ============================= */
   /* =============================
   RIGHT SIDEBAR
   ============================= */
.right-sidebar {
  flex-basis: 25%;
  position: sticky;
  top: 70px;
  align-self: flex-start;
  background: var(--bg-color);
  padding: 20px;
  border-radius: 6px;
  color: #333;
  transition: 0.3s;
}

.right-sidebar h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 1px;
  font-size: 18px;
  color: #222;
}

.right-sidebar .event,
.right-sidebar .advertisement,
.right-sidebar .about {
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 6px;
  background: #f9f9f9;
  transition: 0.3s;
}

.right-sidebar .event:hover,
.right-sidebar .advertisement:hover,
.right-sidebar .about:hover {
  background: rgba(24, 118, 242, 0.1);
}

.right-sidebar .advertisement img {
  width: 100%;
  border-radius: 4px;
}

.right-sidebar .about p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* =============================
   DARK THEME RIGHT SIDEBAR
   ============================= */
body.dark-theme .right-sidebar {
  background: #111;
  color: #fff;
}

body.dark-theme .right-sidebar h3 {
  color: #fff;
}

body.dark-theme .right-sidebar .event,
body.dark-theme .right-sidebar .advertisement,
body.dark-theme .right-sidebar .about {
  background: #222;
  color: #fff;
}

body.dark-theme .right-sidebar .event:hover,
body.dark-theme .right-sidebar .advertisement:hover,
body.dark-theme .right-sidebar .about:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .right-sidebar .about a {
  color: #4da6ff;
}
body.dark-theme .right-sidebar .about a:hover {
  color: #99ccff;
  text-decoration: underline;
}
body.dark-theme .right-sidebar .event a {
  color: #4da6ff;
}
body.dark-theme .main-content .post h3,
body.dark-theme .main-content .post p {
  color: #fff;
}
body.dark-theme .main-content .post .date {
  color: #aaa;
}
body.dark-theme .main-content .post .attachments img,
body.dark-theme .main-content .post .attachments video {
  border: 1px solid #444;
}

body.dark-theme  .settings-menu {
  background: #222;
  color: #fff;
}

/* Mobile Right Sidebar Button */
.mobile-right-btn {
  position: fixed;
  bottom: 20px;
  right: 70px;
  background: #007bff;
  color: #fff;
  font-size: 22px;
  padding: 12px 15px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  z-index: 200;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: background 0.3s;
}

.mobile-right-btn:hover {
  background: #0056b3;
}

/* === POST STYLING === */
.post {
  background: var(--light, #fff);
  color: var(--primary, #222);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.3s ease, color 0.3s ease;
}

.post h3 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.post .date {
  font-size: 0.85rem;
  color: var(--secondary, #666);
}

/* === ATTACHMENTS === */
.attachments img,
.attachments video {
  display: block;
  margin-top: 10px;
  border-radius: 10px;
  max-width: 100%;
}

/* === DELETE BUTTON === */
.post-actions {
  margin-top: 10px;
}
.delete-post {
  background: #e63946;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.delete-post:hover {
  background: #c71c2c;
}

/* === COMMENTS SECTION === */
.comments-section {
  margin-top: 15px;
  border-top: 1px solid #ddd;
  padding-top: 10px;
}
.comments-section h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.comment {
  font-size: 0.9rem;
  margin: 4px 0;
  padding: 6px 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 6px;
}
.comment-input-container {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.comment-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
}
.comment-input:focus {
  border-color: var(--accent, #0077ff);
}
.comment-post-btn {
  background: var(--accent, #0077ff);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.comment-post-btn:hover {
  background: #0056cc;
}

/* === PREVIEW ITEMS === */
.preview-item {
  max-width: 150px;
  max-height: 120px;
  border-radius: 8px;
  margin: 8px 5px 0 0;
  object-fit: cover;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* === DARK MODE === */
body.dark-theme .post {
  background: var(--secondary, #2a2a2a);
  color: var(--light, #f2f2f2);
}
body.dark-theme .post .date {
  color: #aaa;
}
body.dark-theme .comment {
  background: rgba(255,255,255,0.1);
}
body.dark-theme .comment-input {
  background: #333;
  color: #fff;
  border: 1px solid #555;
}
body.dark-theme .comment-post-btn {
  background: #4a90e2;
}
body.dark-theme .comment-post-btn:hover {
  background: #357abd;
}

/* ---------- Like button ---------- */
.like-btn {
  background: rgba(24,118,242,0.08);
  border: 1px solid rgba(24,118,242,0.14);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.like-btn .like-count {
  font-weight: 700;
}
.like-btn:active { transform: scale(0.98); }

/* pop animation when liked */
.like-btn.liked {
  animation: pop 0.45s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 6px 18px rgba(24,118,242,0.18);
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* ---------- Delete comment styling & animation ---------- */
.comment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  margin: 6px 0;
  border-radius: 8px;
  background: rgba(0,0,0,0.03);
  transition: transform 0.25s ease, opacity 0.25s ease, height 0.25s ease;
  overflow: hidden;
}
.comment-item .comment-text-wrap {
  max-width: calc(100% - 40px);
}
.delete-comment {
  background: transparent;
  border: none;
  color: #b22828;
  cursor: pointer;
  font-size: 14px;
  padding: 6px;
  border-radius: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.delete-comment:hover { transform: scale(1.06); background: rgba(178,40,40,0.06); }

/* fade-out (when deleted) */
.comment-item.comment-deleted {
  opacity: 0;
  transform: translateX(12px) scale(0.98);
  height: 0;
  padding: 0;
  margin: 0;
}

/* smaller meta under comment */
.comment-meta { display: block; font-size: 11px; color: #666; margin-top: 4px; }

/* ---------- Preview item animation ---------- */
.preview-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.preview-item:hover { transform: translateY(-4px); box-shadow: 0 6px 18px rgba(0,0,0,0.12); }

#previewContainer {
  width: 100%;
  text-align: center;
  overflow-x: hidden;
}

.preview {
  display: block;
  max-width: 90%;       /* scale down more aggressively */
  width: auto;          /* keep natural width until max-width */
  max-height: 60vh;     /* cap height to 60% of viewport height */
  height: auto;         /* maintain aspect ratio */
  margin: 10px auto;
  object-fit: contain;  /* ensures video/image scales inside box */
}



@media (max-width: 600px) {
  .preview-item { max-width: 100px; max-height: 80px; } 
  .preview {
  max-width: 100%; /* ensures it never exceeds container width */
  height: auto;    /* maintains aspect ratio */
  display: block;
  margin: 10px auto; /* optional: centers the image/video */
}

#previewContainer {
  width: 100%;      /* container takes full width of mobile screen */
  overflow-x: hidden; /* prevents horizontal scroll */
}

}

/* ---------- Small polish for post-actions alignment ---------- */
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.post-actions-inline { display: flex; gap: 10px; align-items: center; }

/* ---------- Dark mode adjustments ---------- */
body.dark-theme .like-btn {
  background: rgba(77,166,255,0.06);
  border-color: rgba(77,166,255,0.12);
}
body.dark-theme .comment-item {
  background: rgba(255,255,255,0.03);
}
body.dark-theme .delete-comment {
  color: #ff6b6b;
}

.like-btn {
  transition: transform 0.2s ease, color 0.3s ease;
}
.like-btn.liked {
  transform: scale(1.3);
  color: #e63946;
}

.comment {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.comment.removed {
  opacity: 0;
  transform: translateX(-50px);
}


/* Right Sidebar Drawer (Mobile) */
@media(max-width: 768px) {
  .right-sidebar {
  transform: translateY(100%);
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: 60%;
  background: #fff;
  z-index: 150;
  overflow-y: auto;
  padding: 20px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
}

.right-sidebar.active {
  transform: translateY(0);
  transition: transform 0.3s ease-in-out;
}
}


/* Dark Theme for Drawer */
body.dark-theme .right-sidebar {
  background: #242424;
  color: #eee;
}

/* Show buttons only on mobile */
@media screen and (max-width: 768px) {
  .mobile-right-btn {
    display: block;
  }
  .right-sidebar {
    display: none; /* Hide by default on mobile */
  }
  .right-sidebar.active {
    display: block;
  }
}


/* ---------- Global ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
:root {
  --body-color: #efefef;
  --nav-color: #1876f2;
  --bg-color: #fff;
  --primary: #1876f2;
  --accent: #4da6ff;
}
body { background: var(--body-color); color: #222; transition: background 0.3s; }

/* ---------- NAV ---------- */
nav { display:flex; align-items:center; justify-content:space-between; background:var(--nav-color); padding:8px 5%; position:sticky; top:0; z-index:100;}
h1 { color:#fff; font-size:22px; margin-left:10px; user-select:none; }
h1 span { background:#fff; color:var(--nav-color); padding:0 6px; border-radius:4px; margin-right:6px; font-weight:700; }
.nav-left, .nav-right { display:flex; align-items:center; }
nav ul { display:flex; gap:10px; margin-left:10px; }
nav ul li i, .nav-right i { color:#fff; font-size:18px; cursor:pointer; }

/* search */
.search { background:#fff; width:280px; border-radius:20px; display:flex; align-items:center; padding:6px 12px; margin-right:12px;}
.search input { border:0; outline:none; width:100%; background:transparent; padding-left:6px; }

/* settings menu */
.settings-menu { position:absolute; width:320px; right:5%; top:108%; max-height:0; overflow:hidden; transition:max-height .28s; background:#fff; box-shadow:0 8px 30px rgba(0,0,0,0.15); border-radius:10px;}
.settings-menu.active { max-height:420px; }
.settings-menu-inner { padding:18px; }
#dark-btn { position:absolute; top:12px; right:12px; width:46px; background:#ddd; border-radius:12px; padding:4px; cursor:pointer; }
#dark-btn span { display:inline-block; width:18px; height:18px; background:#fff; border-radius:50%; transition:all .18s; }
#dark-btn.active { background:#111; }
#dark-btn.active span { transform: translateX(22px); }

/* ---------- LAYOUT ---------- */
main { display:flex; justify-content:space-between; gap:20px; padding:14px 5%; min-height:80vh; }
.left-sidebar, .right-sidebar { flex-basis:25%; position:sticky; top:70px; background:var(--bg-color); border-radius:8px; padding:14px; }
.main-content { flex-basis:47%; }

/* add post */
.add-post { background:var(--bg-color); padding:16px; border-radius:8px; margin-bottom:18px; box-shadow:0 2px 8px rgba(0,0,0,0.04); }
.add-post input, .add-post textarea { width:100%; margin:8px 0; padding:10px; border-radius:8px; border:1px solid #ddd; }
.add-post button { padding:10px 14px; background:var(--nav-color); border:none; color:#fff; border-radius:8px; cursor:pointer; }

/* preview */
#preview-container { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.preview-item { max-width:120px; max-height:100px; border-radius:6px; object-fit:cover; }

/* posts */
.post { background:var(--bg-color); padding:14px; margin-bottom:18px; border-radius:10px; box-shadow:0 2px 6px rgba(0,0,0,0.04); transition:transform .12s; }
.post h3 { margin-bottom:8px; }
.post .date { font-size:12px; color:#777; }
.attachments img, .attachments video { max-width:100%; margin-top:10px; border-radius:8px; }

/* actions */
.post-actions-inline { display:flex; gap:10px; align-items:center; }
.like-btn { background: rgba(24,118,242,0.08); border: 1px solid rgba(24,118,242,0.14); padding:6px 10px; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
.like-btn.liked { animation: pop .45s cubic-bezier(.2,.8,.2,1); box-shadow:0 6px 18px rgba(24,118,242,0.18) }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.18)} 70%{transform:scale(0.96)} 100%{transform:scale(1)} }
.delete-post { background:#e63946; color:#fff; border:none; padding:6px 10px; border-radius:8px; cursor:pointer; }

/* comments */
.comments-section { margin-top:12px; border-top:1px solid #eee; padding-top:10px; }
.comment-item { display:flex; justify-content:space-between; align-items:center; padding:8px; background:rgba(0,0,0,0.03); border-radius:8px; margin:6px 0; }
.comment-input { flex:1; padding:8px 10px; border-radius:20px; border:1px solid #ddd; }
.comment-post-btn { padding:8px 14px; border-radius:20px; border:none; background:var(--primary); color:#fff; cursor:pointer; margin-left:8px; }

/* clear */
.clear-posts { text-align:center; margin:18px 0; }
.clear-posts button { padding:10px 18px; background:#e63946; color:#fff; border:none; border-radius:8px; cursor:pointer; }

/* right sidebar small */
.right-sidebar .event, .right-sidebar .advertisement, .right-sidebar .about { margin-bottom:14px; background:#f9f9f9; padding:10px; border-radius:6px; }

/* footer */
footer { text-align:center; padding:10px 0; background:var(--nav-color); color:#fff; position:fixed; bottom:0; width:100%; }

/* responsive */
/* ==============================
   RESPONSIVENESS
   ============================== */

/* Tablets (768px - 992px) */
@media (max-width: 992px) {
  main {
    flex-direction: column;
    padding-bottom: 90px; /* for footer spacing */
  }

  .left-sidebar,
  .right-sidebar {
    display: none; /* hide sidebars on smaller screens */
  }

  .main-content {
    flex-basis: 100%;
  }
}

/* Mobile phones (<= 768px) */
@media (max-width: 768px) {
  .right-sidebar {
    transform: translateY(100%);
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    height: 60%;
    background: #fff;
    z-index: 150;
    overflow-y: auto;
    padding: 20px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s ease-in-out;
    display: none;
  }

  .right-sidebar.active {
    transform: translateY(0);
    display: block;
  }

  /* Mobile right sidebar button */
  .mobile-right-btn {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 70px;
    background: #007bff;
    color: #fff;
    font-size: 22px;
    padding: 12px 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background 0.3s;
  }

  .mobile-right-btn:hover {
    background: #0056b3;
  }

  /* Preview items on mobile */
  .preview-item {
    max-width: 100px;
    max-height: 80px;
  }

  #previewContainer {
    width: 100%;
    overflow-x: hidden;
  }

  .preview {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
  }

  /* Adjust search input */
  .search {
    width: 150px;
  }

  .nav-right input {
    width: 120px;
  }
}


/* Small phones (<= 600px) */
@media (max-width: 600px) {
  nav ul {
    display: none; /* hide nav links */
  }

  .preview-item {
    max-width: 90px;
    max-height: 70px;
  }

  .comment-input,
  .comment-post-btn {
    font-size: 0.9rem;
    padding: 6px 10px;
  }
}

/* Base layout: flex container */
main {
  display: flex;
  justify-content: space-between;
  padding: 14px 5%;
  min-height: 80vh;
  transition: all 0.3s ease;
}

.mobile-left-btn,
.mobile-right-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 160;
}

@media (max-width: 1023px) {
  .mobile-left-btn,
  .mobile-right-btn {
    display: block;
  }
}

/* Sidebars default */
.left-sidebar,
.right-sidebar {
  flex-shrink: 0;
  width: 250px;
  background: var(--bg-color);
  border-radius: 8px;
  padding: 14px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide sidebars on mobile */
@media (max-width: 1023px) {
  .left-sidebar,
  .right-sidebar {
    position: fixed;
    top: 70px;
    height: calc(100% - 70px);
    z-index: 150;
    transform: translateX(-110%); /* hidden by default */
    opacity: 0;
  }
  .right-sidebar {
    transform: translateX(110%);
  }
  .left-sidebar.active,
  .right-sidebar.active {
    transform: translateX(0);
    opacity: 1;
  }

  /* Overlay for mobile */
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 140;
    pointer-events: none;
  }
  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Desktop: always visible */
@media (min-width: 1024px) {
  .left-sidebar,
  .right-sidebar {
    position: relative;
    transform: translateX(0);
    opacity: 1;
  }
  main {
    margin: 0 auto;
    max-width: 1200px; /* optional: centers content */
  }
  .sidebar-overlay,
  .mobile-left-btn,
  .mobile-right-btn {
    display: none;
  }
}



/* Optional slide-in animation */
@keyframes slideInLeft {
  from { transform: translateX(-110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.left-sidebar.active { animation: slideInLeft 0.3s ease forwards; }
.right-sidebar.active { animation: slideInRight 0.3s ease forwards; }

/* ---------- DARK THEME ---------- */
body.dark-theme { --body-color:#0a0a0a; background:#0a0a0a; color:#eee; }
body.dark-theme nav { background:#111; }
body.dark-theme .settings-menu { background:#222; color:#fff; }
body.dark-theme .left-sidebar, body.dark-theme .right-sidebar, body.dark-theme .add-post, body.dark-theme .post { background:#15151b; color:#eee; }
body.dark-theme .comment-item { background: rgba(255,255,255,0.03); }
body.dark-theme .comment-input { background:#222; color:#fff; border:1px solid #444; }
