/* Global Styles */
:root {
  --primary-color: #1e88e5;
  --primary-hover: #1565c0;
  --secondary-color: #f5f5f5;
  --text-color: #333333;
  --text-light: #757575;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f9f9f9;
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

/* Navigation */
nav {
  width: 100%;
  height: 70px;
  background-color: #ffffff;
  color: var(--text-color);
  position: fixed;
  top: 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav_container {
  width: 92%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  height: 100%;
}

.logo h3 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary-color);
}

ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-item {
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--primary-color);
  background-color: rgba(30, 136, 229, 0.08);
}

.active {
  color: var(--primary-color);
  background-color: rgba(30, 136, 229, 0.12);
  font-weight: 600;
}

.divbtn {
  display: flex;
  gap: 10px;
}

#search-input {
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 10px 16px;
  width: 220px;
  outline: none;
  font-size: 15px;
  transition: var(--transition);
}

#search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

.divbtn button {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
}

.divbtn button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* News Cards */
#card_container {
  width: 92%;
  max-width: 1400px;
  margin: 90px auto 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  height: 100%;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

#news-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover #news-img {
  transform: scale(1.05);
}

.card-content {
  padding: 20px;
}

#news-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--text-color);
}

.news-source {
  font-size: 14px;
  color: var(--text-light);
  margin: 10px 0;
  font-weight: 500;
}

.news-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-top: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1200px) {
  #card_container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 992px) {
  .nav_container {
    width: 95%;
  }
  
  #card_container {
    width: 95%;
  }
}

@media (max-width: 768px) {
  nav {
    height: auto;
    padding: 16px 0;
  }
  
  .nav_container {
    flex-direction: column;
    gap: 14px;
  }
  
  .logo {
    margin-bottom: 5px;
  }
  
  .nav_item ul {
    display: flex;
    gap: 10px;
    margin: 5px 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .divbtn {
    width: 100%;
    justify-content: center;
    margin-top: 5px;
  }
  
  #search-input {
    width: 65%;
  }
  
  #card_container {
    margin-top: 160px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 576px) {
  .nav-item {
    font-size: 14px;
    padding: 6px 10px;
  }
  
  #search-input {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .divbtn button {
    padding: 8px 14px;
    font-size: 14px;
  }
  
  #card_container {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  
  .card {
    max-width: 100%;
  }
  
  #news-img {
    height: 200px;
  }
}
