/* ===============================
   GLOBAL STYLES & RESET
   =============================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: "Times New Roman", serif;
  background: url("images/webbg.jpg") no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===============================
   HEADER / TOP BAR
   =============================== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: #dfe3f4;
  border-bottom: 2px solid #aaa;
  height: 50px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.left {
  display: flex;
  align-items: center;
}

.site-icon {
  background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
  color: white;
  padding: 6px 12px;
  font-weight: bold;
  font-size: 16px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(255, 140, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.site-icon:hover {
  transform: scale(1.05);
}

/* ===============================
   DROPDOWN MENU
   =============================== */
.dropdown {
  position: relative;
}

.dropbtn {
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(44, 79, 163, 0.25);
}

.dropbtn:hover {
  background: linear-gradient(135deg, #1d357f 0%, #0f1f4f 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(44, 79, 163, 0.35);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-width: 160px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
  margin-top: 8px;
  overflow: hidden;
}

.dropdown-content a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  color: white;
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===============================
   MAIN CONTAINER
   =============================== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 30px auto;
  background: rgba(235, 238, 255, 0.97);
  padding: 30px;
  display: flex;
  gap: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(170, 170, 170, 0.3);
}

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

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* ===============================
   TYPOGRAPHY
   =============================== */
h1 {
  font-size: 36px;
  color: #2c4fa3;
  margin-bottom: 15px;
}

.intro {
  font-size: 16px;
  color: #444;
  margin-bottom: 25px;
  padding: 18px;
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  border-left: 5px solid #2c4fa3;
  border-radius: 8px;
  line-height: 1.7;
  box-shadow: 0 2px 8px rgba(44, 79, 163, 0.08);
}

.intro bold {
  color: #2c4fa3;
  font-weight: bold;
  font-size: 17px;
}

/* ===============================
   POSTS STYLING
   =============================== */
#postList {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.no-posts {
  text-align: center;
  padding: 50px 25px;
  color: #666;
  font-style: italic;
  background: #f8f9ff;
  border-radius: 12px;
  border: 2px dashed #d0d5e8;
  font-size: 16px;
}

.post {
  background: #fff;
  padding: 22px;
  border-radius: 12px;
  border: 1px solid #e0e4f5;
  box-shadow: 0 4px 12px rgba(44, 79, 163, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
}

.post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(44, 79, 163, 0.2);
  border-color: #2c4fa3;
}

.post h3 {
  color: #2c4fa3;
  margin: 0 0 10px 0;
  font-size: 22px;
  line-height: 1.3;
}

.post small {
  display: block;
  color: #666;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ===============================
   MEDIA PREVIEW (Images/Videos/Audio)
   =============================== */
.post-preview {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  border: 1px solid #e0e4f5;
  display: block;
}

/* Video Preview Wrapper */
.video-preview-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  margin-bottom: 15px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  border: 1px solid #e0e4f5;
  background: #000;
}

.video-preview-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
  transition: background 0.3s ease;
}

.video-preview-wrapper:hover::before {
  background: rgba(0, 0, 0, 0.5);
}

.video-preview-wrapper img,
.video-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(44, 79, 163, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.video-preview-wrapper:hover .video-play-icon {
  transform: translate(-50%, -50%) scale(1.15);
  background: rgba(44, 79, 163, 1);
}

.video-play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 20px solid white;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 5px;
}

.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 2;
}

/* Audio Preview */
.audio-preview-wrapper {
  width: 100%;
  margin-bottom: 15px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  border-radius: 10px;
  border: 1px solid #e0e4f5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.audio-preview-icon {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

.audio-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.audio-preview-wrapper audio {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  outline: none;
}

/* Embed Preview */
.embed-preview-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  margin-bottom: 15px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  border: 1px solid #e0e4f5;
}

.embed-preview-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===============================
   POST TEXT PREVIEW
   =============================== */
.post-preview-text {
  color: #555;
  font-size: 15px;
  line-height: 1.7;
  margin: 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-family: inherit;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(44, 79, 163, 0.25);
  width: 100%;
  margin-top: 10px;
}

.read-more-btn:hover {
  background: linear-gradient(135deg, #1d357f 0%, #0f1f4f 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(44, 79, 163, 0.35);
}

/* ===============================
   FULL POST VIEW
   =============================== */
#postView {
  background: #fff;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid #e0e4f5;
  box-shadow: 0 4px 18px rgba(44, 79, 163, 0.12);
}

#postView h2 {
  color: #2c4fa3;
  font-size: 28px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid #e0e4f5;
  line-height: 1.3;
}

#postView button {
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  color: white;
  border: none;
  padding: 13px 26px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-family: inherit;
  margin-top: 25px;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(44, 79, 163, 0.25);
}

#postView button:hover {
  background: linear-gradient(135deg, #1d357f 0%, #0f1f4f 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(44, 79, 163, 0.4);
}

/* Post Body Images */
.post-body-image {
  max-width: 100%;
  width: 85%;
  height: auto;
  border-radius: 12px;
  margin: 20px auto;
  display: block;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
}

/* Post Body Videos */
.post-body-video {
  max-width: 100%;
  width: 85%;
  height: auto;
  border-radius: 12px;
  margin: 20px auto;
  display: block;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  background: #000;
}

/* Post Body Audio */
.post-body-audio {
  width: 85%;
  margin: 20px auto;
  display: block;
  border-radius: 25px;
}

/* Post Body Embed */
.post-body-embed {
  position: relative;
  width: 85%;
  padding-bottom: 47.8125%; /* 16:9 of 85% */
  height: 0;
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.15);
}

.post-body-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#postView p {
  line-height: 1.8;
  color: #333;
  font-size: 16px;
  margin-bottom: 15px;
}

#postView a {
  color: #2c4fa3;
  text-decoration: underline;
  font-weight: bold;
  transition: color 0.2s ease;
}

#postView a:hover {
  color: #1d357f;
  text-decoration: none;
}

/* ===============================
   VIDEO MODAL
   =============================== */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

.video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  z-index: 10000;
  animation: modalSlideIn 0.3s ease;
}

.video-modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: bold;
  line-height: 1;
  padding: 0;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.video-modal-player {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.video-modal-player video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 80vh;
}

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

@keyframes modalSlideIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===============================
   SIDEBAR STYLING
   =============================== */
.sidebar h3 {
  color: #2c4fa3;
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 3px solid #2c4fa3;
}

.sidebar input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #e0e4f5;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
  margin-bottom: 25px;
}

.sidebar input[type="text"]:focus {
  outline: none;
  border-color: #2c4fa3;
  box-shadow: 0 0 0 4px rgba(44, 79, 163, 0.18);
}

.sidebar p {
  color: #444;
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 15px;
}

.sidebar a {
  color: #2c4fa3;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  padding: 12px 20px;
  background: linear-gradient(135deg, #e8ecff 0%, #dfe3f4 100%);
  border-radius: 8px;
  margin-top: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(44, 79, 163, 0.12);
}

.sidebar a:hover {
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 79, 163, 0.3);
}

/* ===============================
   UTILITY CLASSES
   =============================== */
.hidden {
  display: none !important;
}

/* ===============================
   RESPONSIVE - TABLET (768px - 1024px)
   =============================== */
@media (max-width: 1024px) {
  .container {
    width: 95%;
    padding: 25px;
    gap: 25px;
  }

  .sidebar {
    width: 250px;
  }

  h1 {
    font-size: 32px;
  }

  .post h3 {
    font-size: 20px;
  }
}

/* ===============================
   RESPONSIVE - MOBILE (MAX 768px)
   =============================== */
@media (max-width: 768px) {
  .top-bar {
    padding: 8px 15px;
    height: 55px;
  }

  .site-icon {
    font-size: 14px;
    padding: 5px 10px;
  }

  .dropbtn {
    font-size: 14px;
    padding: 8px 14px;
  }

  .dropdown-content {
    min-width: 140px;
  }

  .dropdown-content a {
    padding: 10px 14px;
    font-size: 13px;
  }

  .container {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    flex-direction: column;
    gap: 25px;
  }

  .content {
    width: 100%;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  h1 {
    font-size: 28px;
    margin-bottom: 12px;
  }

  .intro {
    font-size: 15px;
    padding: 15px;
  }

  .intro bold {
    font-size: 16px;
  }

  .post {
    padding: 18px;
  }

  .post h3 {
    font-size: 20px;
  }

  .post small {
    font-size: 12px;
  }

  .post-preview {
    height: 180px;
  }

  .video-preview-wrapper {
    height: 180px;
  }

  .video-play-icon {
    width: 60px;
    height: 60px;
  }

  .video-play-icon::after {
    border-left: 16px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
  }

  .post-preview-text {
    font-size: 14px;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .read-more-btn {
    padding: 13px 20px;
    font-size: 15px;
  }

  #postView {
    padding: 20px;
  }

  #postView h2 {
    font-size: 24px;
  }

  #postView button {
    width: 100%;
    padding: 14px 22px;
  }

  .post-body-image,
  .post-body-video {
    width: 100%;
  }

  .post-body-audio {
    width: 100%;
  }

  .post-body-embed {
    width: 100%;
    padding-bottom: 56.25%;
  }

  .video-modal-content {
    width: 95%;
  }

  .video-modal-close {
    top: -50px;
    width: 45px;
    height: 45px;
    font-size: 30px;
  }

  .sidebar h3 {
    font-size: 18px;
  }

  .sidebar input[type="text"] {
    padding: 12px 14px;
  }

  .sidebar a {
    display: block;
    text-align: center;
  }
}

/* ===============================
   RESPONSIVE - SMALL MOBILE (MAX 480px)
   =============================== */
@media (max-width: 480px) {
  .top-bar {
    padding: 6px 10px;
    height: 50px;
  }

  .site-icon {
    font-size: 13px;
    padding: 4px 8px;
  }

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

  .container {
    width: 98%;
    margin: 15px auto;
    padding: 15px;
    border-radius: 8px;
  }

  h1 {
    font-size: 24px;
  }

  .intro {
    font-size: 14px;
    padding: 12px;
  }

  .post {
    padding: 15px;
  }

  .post h3 {
    font-size: 18px;
  }

  .post-preview {
    height: 160px;
  }

  .video-preview-wrapper {
    height: 160px;
  }

  .video-play-icon {
    width: 50px;
    height: 50px;
  }

  .video-play-icon::after {
    border-left: 14px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
  }

  .read-more-btn {
    font-size: 14px;
  }

  #postView {
    padding: 15px;
  }

  #postView h2 {
    font-size: 22px;
  }

  #postView p {
    font-size: 14px;
  }

  .video-modal-content {
    width: 98%;
  }

  .video-modal-close {
    top: -45px;
    width: 40px;
    height: 40px;
  }
}

/* ===============================
   SCROLLBAR STYLING
   =============================== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #2c4fa3 0%, #1d357f 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1d357f 0%, #0f1f4f 100%);
}

/* ===============================
   PRINT STYLES
   =============================== */
@media print {
  .top-bar,
  .sidebar,
  button,
  .video-modal {
    display: none;
  }

  .container {
    width: 100%;
    box-shadow: none;
    border: none;
  }

  .content {
    width: 100%;
  }
}
