body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: 70px;
  padding-bottom: 50px;
  background: #f9f9f9;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid #ccc;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.site-header .logo img {
  height: 40px;
}

.header-right {
  display: flex;
  gap: 20px;
  align-items: center;
}

.icon-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 18px;
}

.icon-link:hover {
  color: #007BFF;
}

/* Phân trang */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 30px 0;
  gap: 8px;
}

.pagination a {
  padding: 8px 14px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

.pagination a.active {
  background-color: #0066cc;
  color: #fff;
  border-color: #0056b3;
  font-weight: bold;
  pointer-events: none;
}

/* Dấu ... */
.pagination .dots {
  display: inline-block;
  padding: 8px 14px;
  color: #666;
  font-size: 16px;
}

/* Màu sắc cho trang đang active */
.pagination a.active {
  background-color: #0066cc;  /* Nền xanh đậm hơn */
  color: #ffffff;             /* Chữ trắng để tương phản */
  border-color: #0056b3;      /* Viền xanh đậm */
  font-weight: bold;
  pointer-events: none;       /* Không cho click lại trang đang active */
}

/* Footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background-color: #f7f7f7;
  border-top: 1px solid #ccc;
  z-index: 1000;
}

.footer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 12px;
  color: #777;
}

/* Problems Grid (index page) */
.problems {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .problems {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .problems {
    grid-template-columns: repeat(3, 1fr);
  }
}

.problem {
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 15px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.problem h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
  /* height: 60px; */
  line-height: 1.4em;
  overflow: hidden;
}

.problem h3 a {
  color: #0066cc;
  text-decoration: none;
  display: block;
  height: 100%;
  overflow: hidden;
}

.problem h3 a:hover {
  color: #007BFF;
}

.problem img {
  max-height: 180px;
  object-fit: contain;
  display: block;
  margin: auto;
  margin-bottom: 10px;
  max-width: 100%;
}

.info {
  font-size: 0.95em;
  color: #555;
  margin-top: 10px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
  text-align: center;
}

/* Buy Coffee */
.buy-coffee {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1px;
}

.buy-coffee .free {
  color: #28a745;
  font-weight: bold;
}

.coffee-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.coffee-btn img {
  height: 30px;
  display: block;
}

/* Problem Header (Detail Page) */
.problem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.problem-header h1 {
  margin: 0;
}

.price-purchase, .buy-coffee-form {
  text-align: right;
}

.price-purchase p {
  margin: 0;
  font-weight: bold;
}

.price-purchase button, .buy-coffee-btn {
  padding: 6px 12px;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.buy-coffee-btn {
  background-color: #28a745;
}

.buy-coffee-btn:hover, .price-purchase button:hover {
  background-color: #005bb5;
}

.problem-image {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 20px auto;
}

.problem-content {
  margin-top: 20px;
  line-height: 1.6;
}

/* Responsive adjustments for images/videos in problem content */
.problem-content img,
.problem-content video {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}
.problem-content iframe {
  max-width: 100% !important;
  height: auto;
  display: block;
  margin: 0 auto;
  aspect-ratio: 16/9;
  width: 600px;
}

/* Alert box styles */
.alert {
    position: relative;
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb
}

/* Media Queries for smaller screens */
@media (max-width: 768px) {
  .problem-header h1 {
    font-size: 1.5em;  /* Make the title more readable on small screens */
  }
  
  .price-purchase, .buy-coffee-form {
    text-align: center;  /* Center align price/purchase button */
  }

  .problem-image {
    max-height: 300px;  /* Reduce image size on smaller screens */
  }

  .problem-content {
    font-size: 1em;  /* Adjust font size for better readability */
  }

  .site-footer {
    height: auto;  /* Allow footer to adjust dynamically */
    font-size: 14px;  /* Make footer text more readable */
  }
}
