/* ---------------- Reset ---------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------------- Global Styles ---------------- */
body {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  background-color: white;
  color: #333;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

html {
  overflow-y: scroll;
}

/* ---------------- Header ---------------- */
.header {
  background: white;
  color: #333;
  padding: 20px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo */
.logo img {
  height: 55px;
  width: auto;
  display: block;
  margin-left: -220px;
  margin-top: 25px;
}

/* Navigation */
.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 80px;
}

.nav a {
  position: relative;
  color: #333;
  text-decoration: none;
  font-weight: 550;
  font-size: 18px;
  padding-bottom: 5px;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #333;
  transition: all 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Search Icon (Header) */
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-right: -200px;
}

.search-btn svg {
  width: 35px;
  height: 35px;
  fill: #333;
  transition: fill 0.2s ease;
}

.search-btn:hover svg {
  fill: #007BFF;
}

.search-btn:active {
  background: rgba(0, 123, 255, 0.2);
  transform: scale(0.9);
}

/* ---------------- Footer ---------------- */
.footer {
  background: #222;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.footer-top {
  background: #6f51e5;
  text-align: center;
  padding: 15px;
}

.footer-top p {
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-top .social-icons a {
  color: white;
  margin: 0 10px;
  font-size: 18px;
  transition: color 0.3s;
}

.footer-top .social-icons a:hover {
  color: #ddd;
}

.footer-main {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  padding: 40px 20px;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-col {
  flex: 1 1 250px;
  max-width: 300px;
}

.footer-col h4 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #6f51e5;
  display: inline-block;
  padding-bottom: 5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  color: white;
}

.footer-bottom {
  background: #111;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

/* ---------------- Article Filters ---------------- */
.article-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 50px 0;
}

/* ---------------- Search Bar ---------------- */
:root {
  --search-width: 70%;       /* width of the whole search container */
  --search-max-width: 650px; /* max width of the search container */
  --search-height: 50px;     /* height of input and button */
  --search-padding: 15px;    /* vertical padding inside input */
  --search-font-size: 18px;  /* font size of input */
  --button-font-size: 16px;  /* font size of search button */
  
  /* Alphabet Bar Variables */
  --alphabet-gap: 7px;
  --alphabet-margin: 20px;
}

.search-container {
  position: relative;
  width: var(--search-width);
  max-width: var(--search-max-width);    
  margin-bottom: 40px;
  display: flex;
  align-items: center;
}

.search-container input {
  flex: 1;
  height: var(--search-height);
  padding: 0 20px 0 45px;
  border-radius: 12px 0 0 12px;
  border: 2px solid black;
  font-size: var(--search-font-size);
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.search-container input:focus {
  border-color: #0056b3;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Magnifying Glass Icon inside input */
.search-container i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: grey;
  font-size: 20px;
  pointer-events: none;
}

/* Search Button */
.search-container button {
  height: var(--search-height);
  padding: 0 25px;
  font-size: var(--button-font-size);
  background: #6f51e5;
  border: 2px solid #6f51e5;
  color: white;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-container button:hover {
  background: #0056b3;
}

/* ---------------- Alphabet Bar ---------------- */
.alphabet-bar {
  display: flex;
  justify-content: center;
  gap: var(--alphabet-gap);
  margin: 30px var(--alphabet-margin);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.alphabet-bar button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid black;
  background-color: white;
  color: black;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.alphabet-bar button:hover,
.alphabet-bar button.active {
  background-color: #6f51e5;
  color: white;
}

.alphabet-bar::-webkit-scrollbar {
  height: 6px;
}

.alphabet-bar::-webkit-scrollbar-thumb {
  background: #007BFF;
  border-radius: 3px;
}

/* ---------------- Articles List ---------------- */
#articles-list {
  list-style: none;
  padding: 0;
  max-width: 600px;
  margin: 0 auto 80px auto;
}

#articles-list li {
  margin: 8px 0;
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  border-radius: 6px;
  transition: background 0.3s ease;
}

#articles-list li:hover {
  background: rgba(0, 123, 255, 0.05);
}

#articles-list li a {
  text-decoration: none;
  color: #007BFF;
  font-weight: 600;
}

#articles-list li a:hover {
  text-decoration: underline;
}
