/* style.css */
body {
  margin: 0;
  font-family: sans-serif;
  background-color: white;
  color: black;
}

header {
  background-color: #1f1f1f;
  padding: 20px;
  text-align: center;
}

.logo {
  margin: 0;
  background: linear-gradient(to right, #00ffff, #e0218a, #ffff00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 2.3rem;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
}

header p {
  margin: 5px 0 10px;
  color: #ccc;
}

.search-box {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.search-box input {
  padding: 12px 20px 12px 20px;
  border-radius: 30px;
  border: none;
  outline: none;
  font-size: 15px;
  background-color: #333;
  color: white;
  width: 80%;
  max-width: 400px;
  transition: 0.3s;
  box-shadow: 0 0 5px lightgray;
}

.search-box i {
  display: none;
}

nav {
  background-color: #2d2d2d;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

nav::-webkit-scrollbar {
  display: none;
}

nav a {
  color: white;
  text-decoration: none;
  margin: 0 5px;
  padding: 9px 17px;
  border-radius: 8px;
  transition: all 0.3s;
  display: inline-block;
  flex-shrink: 0;
  font-weight: bold;
}

nav a:hover {
  background-color: #444;
}

nav a.active {
  background: linear-gradient(to right, #00ffff, #e0218a, #ffff00);
  color: black;
  font-weight: bold;
}

.articles-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
  padding: 10px;
}

.article-card {
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.article-card:hover {
  transform: scale(1.03);
}

.thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 10px;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  transition: opacity 0.3s;
}

.article-card h2 {
  color: black;
  margin-top: 10px;
  font-size: 18px;
}

.search-results {
  max-width: 1200px;
  margin: 20px auto;
  padding: 5px;
}

.result-count {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.search-result-card {
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.search-result-card:hover {
  transform: scale(1.03);
}

.search-result-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 10px;
}

.search-result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: opacity 0.3s;
}

/* ADDED: Search result title size fixed to 18px */
.search-result-card h2 {
  color: black;
  margin-top: 10px;
  font-size: 18px;
}

.no-results {
  text-align: center;
  color: #666;
  padding: 30px;
  grid-column: 1 / -1;
}

.search-loading {
  text-align: center;
  color: #666;
  padding: 20px;
  grid-column: 1 / -1;
}

footer {
  background-color: #1f1f1f;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 30px;
}

footer a {
  color: white;
  text-decoration: none;
  margin: 0 5px;
}

footer a:hover {
  text-decoration: underline;
}

.connection-status {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  z-index: 1000;
  display: none;
}

.online {
  background-color: #00ffff;
  color: black;
}

.offline {
  background-color: #e0218a;
  color: white;
}

ul {
  padding: 0 15px;
}

li {
  margin-left: 20px;
}

ol {
  padding-left: 10px;
}

ol li::marker {
  font-weight: bold;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol {
  margin-top: 0;
  margin-bottom: 10px;
  padding-left: 10px;
  padding-right: 10px;
}

h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child,
p:first-child,
ul:first-child,
ol:first-child {
  margin-top: 0;
}

ul,
ol {
  padding-left: 10px;
  padding-right: 10px;
}

li {
  margin-bottom: 10px;
}

li:last-child {
  margin-bottom: 0;
}

/* NEW PAGINATION STYLES */
.pagination-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 10px;
}

.page-numbers-top {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 15px;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-bottom: 10px;
}

.page-numbers-top::-webkit-scrollbar {
  display: none;
}

.page-counter-middle {
  text-align: center;
  margin: 15px 0;
  color: #666;
  font-weight: bold;
  font-size: 16px;
}

.navigation-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

/* CHANGED: Next/Previous buttons width smaller */
.prev-btn, .next-btn {
  background: linear-gradient(to right, #00ffff, #e0218a, #ffff00);
  color: black;
  border: none;
  padding: 10px 10px; /* CHANGED: Reduced padding */
  border-radius: 3px;
  font-weight: bold;
  cursor: pointer;
  transition: all 1.3s;
  font-size: 16px; /* SAME: Text size same */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  display: inline-block;
  min-width: 8px; /* CHANGED: Smaller width */
  text-align: center;
}

.prev-btn:hover, .next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.prev-btn:active, .next-btn:active {
  transform: translateY(0);
}

.page-link {
  background: #f0f0f0;
  color: #333;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.page-link:hover {
  background: linear-gradient(to right, #00ffff, #e0218a, #ffff00);
  color: black;
  transform: translateY(-2px);
}

.page-link.active {
  background: linear-gradient(to right, #00ffff, #e0218a, #ffff00);
  color: black;
}

@media (max-width: 768px) {
  .articles-container,
  .search-results-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .search-box i {
    display: block;
    position: absolute;
    right: 40px;
    background: linear-gradient(to right, #00ffff, #e0218a, #ffff00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 18px;
    pointer-events: none;
  }
  
  .search-box input {
    padding: 12px 45px 12px 20px;
  }
  
  footer div {
    margin-top: 10px;
  }
  
  footer a {
    display: inline-block;
    margin: 5px;
  }
  
  .articles-container,
  .search-results {
    padding: 5px 15px;
  }
  
  .page-numbers-top {
    gap: 5px;
  }
  
  .page-link {
    padding: 8px 12px;
    font-size: 14px;
    min-width: 35px;
  }
  
  /* FIXED: Navigation bottom for mobile */
  .navigation-bottom {
    flex-direction: row; /* Changed from column to row */
    justify-content: space-between; /* Ensure buttons stay on left and right */
    gap: 15px;
  }
  
  .prev-btn, .next-btn {
    width: auto; /* Changed from 30% to auto */
    padding: 10px 15px; /* Adjusted padding for better appearance */
    text-align: center;
    min-width: auto; /* CHANGED: Remove min-width on mobile */
  }
}