/* styles.css */
:root {
  /* Gradients */
  --primary-gradient: linear-gradient(135deg, #212121, #424242);
  --secondary-gradient: linear-gradient(135deg, #ff7e5f, #feb47b);
  --dark-gradient: linear-gradient(135deg, #232526, #414345);
  --light-gradient: linear-gradient(135deg, #e0eafc, #cfdef3);
  
  /* Core color variables - USED FOR THEME SWITCHING */
  --bg-color: #f8f9fa;
  --text-color: #212529;
  --card-bg: #ffffff;
  --border-color: #dee2e6;
  --header-bg: #1a1a2e;
  --hover-color: #f8f9fa;
  
  /* Additional colors */
  --text-light: #f0f0f0;
  --text-dark: #212529;
  --header-text: #ffffff;
  
  /* Shadows */
  --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);

  /* Light Theme (default) */
  --header-text-color: #ffffff;
  --button-bg: #007bff;
  --button-text-color: #ffffff;
  --link-color: #007bff;
  --icon-color: #212529;

  --header-gradient-light: linear-gradient(135deg, #1a1a2e, #16213e);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Logo Styles */
.logo {
  height: 120px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
  margin-right: 20px;
}

.logo-container {
  margin-left: 0;
  padding-left: 0;
  display: flex;
  align-items: center;
}

/* Enhanced Header */
.news-header {
  background-color: var(--header-bg);
  padding: 1rem 0;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.news-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.03)" d="M0,0 L100,0 L100,100 L0,100 Z" /></svg>');
  background-size: cover;
}

.news-header .container-fluid {
  padding-left: 0;
}

.header-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #a8edea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  padding-left: 15px;
  margin: 0;
  color: var(--header-text-color);
}

.header-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 70%;
  width: 4px;
  background: linear-gradient(to bottom, #00c6fb, #005bea);
  border-radius: 4px;
}

/* Search Bar in Header */
.search-container {
  width: 300px;
}

.search-container .input-group {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.search-container .input-group-text {
  background: transparent;
  border: none;
  color: var(--icon-color);
}

.search-container #searchInput {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--text-color);
  font-size: 0.95rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

.search-container #searchInput::placeholder {
  color: var(--text-color);
  opacity: 0.7;
}

/* Enhanced Category Buttons */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 5px;
  margin-top: 15px;
  padding-left: 10px;
}

.category-btn {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  color: var(--header-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1;
  background-color: var(--button-bg);
  color: var(--button-text-color);
  border: 1px solid var(--button-bg);
}

.category-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--header-text);
}

.category-btn:hover::before {
  transform: translateY(0);
}

.category-btn.active {
  background: linear-gradient(135deg, #00c6fb, #005bea);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 198, 251, 0.4);
  background-color: var(--link-color);
  color: var(--button-text-color);
  border-color: var(--link-color);
}

/* Enhanced News Cards */
.card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  background-color: var(--card-bg);
  color: var(--text-color);
}

.news-card {
  position: relative;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  background-color: var(--card-bg);
  animation: float 6s ease-in-out infinite;
  color: var(--text-color);
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.03));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.news-card:hover::before {
  opacity: 1;
}

.card-img-top {
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.source-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.source-date .badge {
  background: linear-gradient(135deg, rgba(37,104,239,0.1), rgba(37,104,239,0.2));
  color: #2568ef;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
}

.card-title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 12px;
}

.card-text {
  color: var(--text-color);
  opacity: 0.9;
  line-height: 1.6;
}

/* Enhanced Buttons */
.load-more-btn {
  background: linear-gradient(135deg, #00c6fb, #005bea);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 198, 251, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  background-color: var(--button-bg);
  color: var(--button-text-color);
  border: 1px solid var(--button-bg);
}

.load-more-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  color: white;
}

.load-more-btn:hover::after {
  transform: translateX(0);
}

.visit-btn {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  margin-top: auto;
  align-self: flex-start;
  background-color: var(--button-bg);
  color: var(--button-text-color);
  border: 1px solid var(--button-bg);
}

.visit-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.visit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: white;
}

.visit-btn:hover::after {
  transform: translateX(0);
}

/* Floating Animation for Cards */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* Different animation delays for each card */
.news-card:nth-child(1) { animation-delay: 0s; }
.news-card:nth-child(2) { animation-delay: 0.5s; }
.news-card:nth-child(3) { animation-delay: 1s; }
.news-card:nth-child(4) { animation-delay: 1.5s; }
.news-card:nth-child(5) { animation-delay: 2s; }
.news-card:nth-child(6) { animation-delay: 2.5s; }

/* Section Divider */
.section-divider {
  position: relative;
  text-align: center;
  margin: 30px 0 20px;
}

.section-title {
  display: inline-block;
  background: white;
  padding: 0 20px;
  position: relative;
  z-index: 2;
  color: #2568ef;
  font-weight: 600;
}

.section-divider:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: #e0e0e0;
  z-index: 1;
}

/* Theme Toggle */
#themeToggle, 
button#themeToggle, 
button#themeToggle.btn, 
button#themeToggle.btn-light {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer !important;
  background-color: var(--button-bg);
  color: var(--button-text-color);
  border: 1px solid var(--button-bg);
}

#themeToggle:hover, 
button#themeToggle:hover, 
button#themeToggle.btn:hover, 
button#themeToggle.btn-light:hover {
  cursor: pointer !important;
}

/* Universal override to ensure Bootstrap buttons have pointer cursor */
.btn, .btn:hover {
  cursor: pointer !important;
}

#themeToggle i,
.d-flex .btn {
  cursor: pointer !important;
}

/* Theme Toggle Button */
.theme-toggle-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #ffa41b;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.theme-toggle-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.theme-toggle-button:active {
  transform: translateY(0);
}

.theme-toggle-button i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.theme-toggle-button:hover i {
  transform: rotate(30deg);
}

/* Dark Theme Styles */
body.dark-theme {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --card-bg: #1e1e1e;
  --border-color: #333333;
  --header-bg: #0f0c29;
  --hover-color: #2a2a2a;
  --header-text-color: #e0e0e0;
  --button-bg: #0056b3;
  --button-text-color: #e0e0e0;
  --link-color: #4dabf7;
  --icon-color: #e0e0e0;
  --header-gradient: linear-gradient(135deg, #0f0c29, #302b63);
}

body.dark-theme {
  background-color: var(--bg-color);
  color: var(--text-color);
}

body.dark-theme .news-header {
  background: var(--header-gradient);
}

body.dark-theme .header-title {
  color: #ffffff;
}

body.dark-theme .theme-toggle-button {
  background-color: #272727;
  color: #ffffff;
}

body.dark-theme .card {
  background-color: #1e1e1e;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .card-title {
  color: #4285f4;
}

body.dark-theme .card-text {
  color: #b0b0b0;
}

body.dark-theme #searchInput,
body.dark-theme .input-group-text {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border-color: #3a3a3a;
}

body.dark-theme .section-title {
  background-color: #121212;
  color: #4285f4;
}

body.dark-theme .dropdown-menu {
  background-color: #2a2a2a;
  border-color: #3a3a3a;
}

body.dark-theme .dropdown-item {
  color: #e0e0e0;
}

body.dark-theme .dropdown-item:hover {
  background-color: #3a3a3a;
}

body.dark-theme .btn-light {
  background-color: #333;
  color: #fff;
  border-color: #444;
}

body.dark-theme .footer {
  background: var(--header-gradient);
}

body.dark-theme .ad-container {
  background-color: #1e1e1e;
  border: 1px solid #2a2a2a;
}

/* Enhanced Footer */
.footer {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--header-text);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  padding: 2rem 0;
  margin-top: 30px;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.03)" d="M0,0 L100,0 L100,100 L0,100 Z" /></svg>');
  background-size: cover;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: white;
  text-decoration: underline;
}

/* Ad Container Styles */
.ad-container {
  width: 100%;
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s;
}

.ad-banner {
  min-height: 100px;
  padding: 15px;
}

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 15px 0;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.cookie-content p {
  margin: 0;
  font-size: 0.9rem;
}

.cookie-content a {
  color: #4285f4;
  text-decoration: none;
}

.cookie-content button {
  padding: 8px 20px;
  font-weight: 500;
  white-space: nowrap;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .logo {
    height: 90px;
  }
  
  .header-title {
    font-size: 1.6rem;
  }
  
  .search-container {
    width: 250px;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .logo {
    height: 70px;
    margin-right: 10px;
  }
  
  .header-title {
    font-size: 1.4rem;
  }
  
  .news-header .container-fluid > .d-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .search-container {
    width: 100%;
    margin: 15px 0;
  }
  
  .category-buttons {
    justify-content: center;
    padding-left: 5px;
    margin-top: 10px;
  }
  
  .category-btn {
    font-size: 0.8rem;
    padding: 4px 10px;
  }
  
  .card-img-top {
    height: 180px;
  }

  .news-card {
    animation: none;
  }
}

@media (max-width: 576px) {
  .header-title {
    font-size: 1.25rem;
  }
  
  .logo {
    height: 60px;
  }
  
  .cookie-content {
    justify-content: center;
    text-align: center;
  }
  
  .cookie-content p {
    width: 100%;
    margin-bottom: 10px;
  }
}

