/* style.css - Tema Horor */

/* Reset Dasar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Courier New', Courier, monospace;
}

/* BODY */
body {
  background: #1a1a1a;
  color: #eee;
  line-height: 1.6;
  margin-top: 70px; /* Untuk menghindari tertutup navbar */
}

/* Base navbar styles (mobile first) */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111;
  padding: 15px 20px;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 100;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: #f44336;
  text-transform: uppercase;
}

/* Mobile menu toggle button */
.menu-toggle {
  display: block;
  cursor: pointer;
  font-size: 24px;
  color: #eee;
}

/* Navigation menu container */
.nav-menu {
  display: none; /* Hidden by default on mobile */
  width: 100%;
  position: absolute;
  top: 100%;
  left: 0;
  background: #111;
}

/* Show menu when active class is added */
.nav-menu.active {
  display: block;
}

.navbar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

.navbar ul li {
  width: 100%;
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.navbar ul li:last-child {
  border-bottom: none;
}

.navbar ul li a {
  text-decoration: none;
  color: #eee;
  font-size: 14px;
  transition: color 0.3s;
  display: block;
  padding: 5px 0;
}

.navbar ul li a:hover {
  color: #f44336;
}

/* Desktop styles - IMPORTANT: This needs to override the mobile styles */
@media screen and (min-width: 768px) {
  body {
    margin-top: 60px;
  }
  
  .navbar {
    flex-wrap: nowrap;
    padding: 15px 30px;
  }
  
  .logo {
    font-size: 26px;
  }
  
  /* Hide menu toggle on desktop */
  .menu-toggle {
    display: none !important;
  }
  
  /* Always show nav menu on desktop */
  .nav-menu {
    display: block !important;
    position: static;
    width: auto;
    background: transparent;
  }
  
  .navbar ul {
    flex-direction: row;
    gap: 20px;
    margin: 0;
  }
  
  .navbar ul li {
    width: auto;
    border-bottom: none;
    padding: 0;
  }
  
  .navbar ul li a {
    font-size: 16px;
    padding: 0;
  }
}

/* HERO SECTION */
.hero {
  width: 100%;
  height: 30vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}

.hero h1 {
  font-size: 42px;
  color: #f44336;
  text-shadow: 2px 2px 4px #000;
}

.hero p {
  font-size: 20px;
  color: #ddd;
  text-shadow: 1px 1px 2px #000;
}

/* BAGIAN BARU UNTUK KIRI-KANAN */
.comment-wrapper {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 40px auto; /* tengah */
  padding: 0 20px;   /* sedikit padding kiri-kanan */
}

.comment-left, .comment-right {
  flex: 1;
  background: #222;
  padding: 20px;
  border-radius: 8px;
}

/* BAGIAN KIRI: .comment-left menampung .comment-container */
.comment-left h2 {
  color: #f44336;
  text-align: center;
  margin-bottom: 20px;
}

/* Mungkin Anda menempatkan .comment-container di dalam .comment-left */
.comments-list {
  /* Hilangkan margin & max-width agar diatur oleh .comment-left */
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 300px; /* Untuk menjaga layout konsisten saat pemuat komentar kosong */
}

/* Status pesan */
.message {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
}

.success {
  background: rgba(0, 128, 0, 0.2);
  border: 1px solid green;
  color: #90ee90;
}

.error {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid red;
  color: #ff6666;
}

/* Daftar item komentar */
.comment-item {
  background: #333;
  padding: 15px;
  border-radius: 5px;
  transition: transform 0.2s;
}

.comment-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  color: #f44336;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.comment-name {
  font-size: 16px;
}

.comment-date {
  font-size: 12px;
  color: #aaa;
}

.comment-body {
  font-size: 16px;
  line-height: 1.5;
  margin-top: 5px;
  word-wrap: break-word;     
  overflow-wrap: break-word; 
  white-space: pre-wrap;     
}

.no-comment {
  color: red;
  text-align: center;
  padding: 20px 0;
}

/* Pagination */
.pagination {
  margin-top: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.page-btn {
  background: #f44336;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;
}

.page-btn:hover {
  background: #b71c1c;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#page-number {
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  min-width: 30px;
  display: inline-block;
}

/* BAGIAN KANAN: .comment-right menampung .comment-form */
.comment-right h2 {
  color: #f44336;
  text-align: center;
  margin-bottom: 20px;
}

.comment-form {
  /* Hilangkan margin auto & max-width agar menyesuaikan kolom */
  background: #222;
  padding: 0;
  border-radius: 0;
}

.comment-form .form-group {
  margin-bottom: 15px;
}

.comment-form label {
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
}

.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #333;
  color: #eee;
  font-size: 16px;
  transition: border-color 0.3s;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
  border-color: #f44336;
  outline: none;
}

.comment-form button {
  width: 100%;
  background: #f44336;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.comment-form button:hover {
  background: #b71c1c;
}

/* RESPONSIVE */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 36px;
  }
  
  .hero p {
    font-size: 18px;
  }
}

/* Tablet & Mobile */
@media (max-width: 768px) {
  body {
    margin-top: 60px;
  }
  
  .logo {
    font-size: 22px;
  }
  
  .hero {
    height: auto;
    padding: 40px 15px;
  }
  
  .hero h1 {
    font-size: 28px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  /* Comment Layout becomes vertical */
  .comment-wrapper {
    flex-direction: column;
    margin: 20px auto;
  }
  
  .comment-left, .comment-right {
    width: 100%;
  }
  
  /* Make Comments section appear first on mobile */
  .comment-wrapper {
    display: flex;
    flex-direction: column-reverse;
  }
  
}

/* Smaller Mobile Devices */
@media (max-width: 480px) {
  .logo {
    font-size: 18px;
  }
  
  .hero h1 {
    font-size: 24px;
  }
  
  .hero p {
    font-size: 14px;
  }
  
  .comment-left h2, .comment-right h2 {
    font-size: 20px;
  }
  
  .comment-item {
    padding: 10px;
  }
  
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .comment-date {
    margin-left: 0;
  }
  
  .pagination {
    gap: 5px;
  }
  
  .page-btn {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  
}