/* General Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f6f6f6;
  color: #050310;
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
  background-color: #1a1a1a;
  color: #f4f4f4;
}

.container {
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Categories */
.categories {
	display: flex;
    justify-content: center; /* Center items horizontally */
    flex-wrap: wrap; /* Allows items to wrap to the next line if needed */
    padding: 0;
}

.categories h2 {
  color: #007bff;
  margin-bottom: 15px;
}

#category-list {
  list-style: none;
  padding: 0;
  display: flex; 
  justify-content: center; /* Center items */
  flex-wrap: wrap; /* Allows items to go to the next line if needed */
  gap: 10px; /* Adds spacing between items */
}

#category-list li {
  cursor: pointer;
  padding: 10px 15px; /* Adds spacing inside the items */
  border-radius: 20px;
  transition: background-color 0.3s;
  background-color: #ffffff;
  display: flex; /* Ensures content is properly aligned */
  align-items: center; 
  text-align: center;
  white-space: nowrap; /* Prevents text from breaking */
  border: 1px solid #d7d7d7;
}

#category-list li:hover {
  background-color: #efefef;
}

body.dark-mode #category-list li:hover {
  background-color: #2d2d2d;
}

/* Active filter button */
#category-list li.active {
  border: 1px solid #626262;
}

/* Main Content */
.main-content {
  flex: 1;
}

h1 {
  text-align: center;
  color: #050310;
  margin-bottom: 20px;
}

h4 {
  text-align: center;
  color: #050310;
  margin-bottom: 20px;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  }


/*Dark mode toggle settings*/

#dark-mode-group {
	position: absolute;
    top: 10px;
    right: 10px;
}

label {
    position: relative;
    display: block;
    width: 45px;  /* 180px / 4 */
    height: 25px;  /* 100px / 4 */
    border-radius: 25px;  /* 100px / 4 */
    background-color: #444444;
    overflow: hidden;
    cursor: pointer;
}

label:before,
label:after {
    display: block;
    position: absolute;
    content: "";        
    width: 18px;  /* 72px / 4 */
    height: 18px;  /* 72px / 4 */
    border-radius: 50%;
    top: 3.5px;  /* 14px / 4 */
    left: 3.5px;  /* 14px / 4 */
    transition: 0.5s ease;
}

label:before {
    background-color: #ffffff;
}

label:after {
    background-color: #444444;
    left: -14.5px;  /* -58px / 4 */
    transform: scale(0.00001);
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + label:before {
    background-color: #FFF;
    transform: translateX(20px);  /* 80px / 4 */
}

input[type="checkbox"]:checked + label:after {
    transform: translateX(30px) scale(1);  /* 120px / 4 */
}
/*END Dark mode toggle settings*/


#search {
  padding: 10px;
  width: 70%;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#search:focus {
  border-color: #007bff;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
}


/* News List */
#news-list {
  margin-bottom: 20px;
}

.news-item {
  background-color: #f1f1f1;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.news-item h2 {
  margin: 0 0 10px;
  font-size: 1.4em;
}

.news-item h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.news-item h2 a:hover {
  text-decoration: underline;
}

.news-item p {
  margin: 5px 0;
  color: #666;
}

.news-item p strong {
  color: #007bff;
}

/* Dark Mode Styles */
body.dark-mode .news-item {
  background-color: #2d2d2d;
}

body.dark-mode .news-item p {
  color: #ccc;
}

body.dark-mode .news-item p strong {
  color: #1e90ff;
}

body.dark-mode h1 {
  color: #fff;
}

body.dark-mode h4 {
  color: #fff;
}

body.dark-mode #category-list li {
  background-color: #2d2d2d;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

button {
  padding: 10px 20px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #0056b3;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}
