/* === GLOBAL RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #f0f2f5;
  color: #222;
}

/* === FIXED HEADER === */
.header-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #a796e8;
  padding: 6px 20px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
  position: relative;
}

/* PROFILE INFO */
.profile-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 600;
  align-self: flex-end;
  padding-bottom: 4px;
}
.profile-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  font-size: 14px;
}
#profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}

/* NAV BAR */
.nav-bar {
  display: flex;
  gap: 6px;
  margin-left: auto;
  margin-top: -8px;
}
.nav-bar button {
  background-color: rgba(255,255,255,0.22);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  font-size: 17px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.nav-bar button:hover {
  background-color: rgba(255,255,255,0.45);
  transform: scale(1.08);
}
.nav-bar button.active {
  background-color: white;
  color: #a796e8;
  box-shadow: 0 0 12px rgba(255,255,255,0.7);
}

/* === UPLOAD BAR UNDER HEADER === */
.new-container {
  position: fixed;
  top: 48px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #ffffff;
  z-index: 999;
}
.upload-container {
  display: flex;
  gap: 10px;
}
.logo-text {
  font-size: 14px;
  font-weight: bold;
  color: #a796e8;
}

/* UPLOAD BUTTONS */
.upload-container .nav-button {
  background-color: #ffffff;
  color: #ffffff;
  border: none;
  width: 30px;
  height: 30px;
  font-size: 17px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.upload-container .nav-button:hover {
  background-color: rgba(255,255,255,0.45);
  transform: scale(1.08);
}

/* === FEED === */
.page-wrapper {
  display: flex;
  justify-content: center;
  padding-top: 130px;
  padding-bottom: 100px;
  min-height: 100vh;
}

.container {
  max-width: 500px;
  width: 100%;
  padding: 0 12px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  background: #f0f2f5;
}

/* POSTS */
.post {
  background-color: white;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}
.post:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-profile-pic { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.post-info strong { font-size: 15px; color: #111; }
.post-date { font-size: 12px; color: #666; }

.post-body { display: flex; flex-direction: column; gap: 14px; }
.post-description { font-size: 14px; line-height: 1.55; }
.description-text.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-media {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}
.watch-count {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #65676b;
  border-top: 1px solid #e4e6eb;
}

/* FIXED FOOTER */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 12px;
  font-size: 13px;
  border-top: 1px solid #ddd;
  z-index: 999;
  overflow-x: auto;
  white-space: nowrap;
}
.fixed-footer a { color: #a796e8; text-decoration: none; font-weight: 500; }
.fixed-footer a:hover { color: #9984ec; text-decoration: underline; }
.fixed-footer span { color: #777; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-container { padding: 6px 16px; }
  .header-wrapper { height: 46px; }
  .new-container { top: 46px; padding: 8px 16px; }
  .container { margin-top: 100px; }
  .profile-info span { font-size: 13px; max-width: 120px; }
  #profile-pic { width: 30px; height: 30px; }
  .nav-bar button { width: 34px; height: 34px; font-size: 16px; }
  .post-media { max-height: 400px; }
}

@media (max-width: 480px) {
  .header-wrapper { height: 44px; }
  .new-container { top: 44px; }
  .container { margin-top: 40px; padding: 0 8px; }
  .post { padding: 12px; }
  .post-media { max-height: 350px; }
  .page-wrapper {
    padding-top: 60px; /* dating 80px, binawasan para mas dikit pa */
  }
}



@media (max-width: 360px) {
  .post {
    height: auto;
  }
  .post-media {
    height: 160px;
  }
  .profile-info span {
    max-width: 100px;
  }
}
/* === FIXED 300x250 AD === */
.sidebar-ad {
  position: fixed;
  right: 20px;
  top: 140px; /* para nasa ilalim ng header at upload bar */
  width: 300px;
  height: 250px;
  background-color: #eaeaea; /* placeholder bg */
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #555;
  z-index: 10; /* mas mababa sa header (999), pero visible sa content */
}

.ad-loading {
  font-style: italic;
  color: #888;
}

/* Hide ad on mobile for clean layout */
@media (max-width: 768px) {
  .sidebar-ad {
    display: none;
  }
}
