
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Arial", sans-serif;
}

body {
  background-color: burlywood;
  color: black;
  line-height: 1.6;
  padding: 10px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background-color: #121212;
  color: white;
}

header,
footer {
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

header h1 {
  margin-bottom: 10px;
}

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.9rem;
  color: #888;
}

body.dark-mode header,
body.dark-mode footer {
  background-color: #1e1e1e;
  color: white;
}

header input,
header button {
  margin: 6px 4px;
}

#searchInput {
  padding: 10px;
  width: 80%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 10px;
}

.searchsource {
  display: flex;
  justify-content: center;
  gap: 10px;
}

button {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s ease, background-color 0.3s ease;
}

#searchBtn {
  padding: 10px 14px;
  background-color: #28a745;
  color: white;
}
#searchBtn:hover {
  filter: brightness(0.95);
}

#sourcesBtn {
  padding: 10px 14px;
  background-color: #6c63ff;
  color: white;
}
#sourcesBtn:hover {
  filter: brightness(0.95);
}

#theme {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  position: absolute;
  top: 50px;
  right: 20px;
}
#theme:hover {
  background-color: #0056b3;
}

#sourcesList {
  width: 100%;
  max-width: 520px;
  color: #222;
  border-radius: 8px;
  padding: 8px 12px;
}

#sourcesList ul {
  margin: 8px 0;
  padding-left: 18px;
}

#sourcesList li {
  margin: 4px 0;
  cursor: pointer;
}
#sourcesList li:hover {
  text-decoration: underline;
}

body.dark-mode #sourcesList {
  background: #1e1e1e;
  color: #eee;
  border-color: #333;
}

nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.category-btn {
  padding: 8px 15px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.08s ease;
}
.category-btn:hover {
  background-color: #0056b3;
}
.category-btn:active {
  transform: translateY(1px);
}

main,
aside {
  margin-bottom: 20px;
}

main {
  flex: 3;
}

aside {
  flex: 1;
  min-width: 250px;
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 600px;
  overflow: auto;
}
body.dark-mode aside {
  background-color: #1e1e1e;
  color: white;
}

.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.news-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}
.news-item:hover {
  transform: translateY(-5px);
}

.news-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
}

.news-item h3 {
  margin: 10px 0 5px;
}
.news-item p {
  font-size: 0.95rem;
}

.bookmark-btn {
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.bookmark-btn:hover {
  background-color: #218838;
}

/* Bookmark extras */
.badge {
  display: inline-block;
  min-width: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ffc107;
  color: #222;
  font-size: 0.85rem;
  text-align: center;
}
.clear-btn {
  margin: 8px 0 12px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.clear-btn:hover {
  filter: brightness(0.95);
}
body.dark-mode .badge {
  background: #ffda6a;
  color: #111;
}
body.dark-mode .clear-btn {
  background: #c82333;
}

.empty {
  text-align: center;
  padding: 16px;
  opacity: 0.8;
}

@media (min-width: 768px) {
  body > div {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
