:root {
  --primary: #4a89dc;
  --primary-light: #5d9cec;
  --secondary: #f5f7fa;
  --accent: #e6e9ed;
  --text: #434a54;
  --text-light: #aab2bd;
  --white: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
    sans-serif;
  color: var(--text);
  line-height: 1.6;
  background-color: var(--white);
  overflow-x: hidden;
}

/* Header Styles */
header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  width: 100%;
  top: 0;
  transition: var(--transition);
  z-index: 1000;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo span {
  color: var(--text);
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 5px 10px;
  border-radius: var(--radius);
}

nav a:hover {
  color: var(--primary);
  background: var(--secondary);
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.search-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  color: var(--primary);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text);
  cursor: pointer;
}

/* Hero Section */
.hero {
  height: 60vh;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-top: 70px;
  position: relative;
  padding: 0 5%;
}

.hero-content {
  max-width: 800px;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

/* Category Sections */
.category-section {
  padding: 3rem 5%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.section-title {
  font-size: 1.8rem;
  color: var(--primary);
}

.view-all {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.view-all:hover {
  text-decoration: underline;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.post-content {
  padding: 1.2rem;
}

.post-title {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.post-title a:hover {
  color: var(--primary);
}

.read-more {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.read-more:hover {
  text-decoration: underline;
}

/* Newsletter */
.newsletter {
  background: var(--primary);
  color: var(--white);
  padding: 3rem 5%;
  text-align: center;
  margin: 2rem 0;
}

.newsletter h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.newsletter p {
  margin-bottom: 1.5rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem;
}

.newsletter-form button {
  background: var(--text);
  color: var(--white);
  border: none;
  padding: 0 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: var(--transition);
}

.newsletter-form button:hover {
  background: #333;
}

/* Sidebar/Featured Section */
.featured-section {
  padding: 0 5% 3rem;
}

.featured-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.featured-post {
  display: flex;
  gap: 15px;
  align-items: center;
}

.featured-post img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
}

.featured-post h3 {
  font-size: 1rem;
}

.featured-post a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.featured-post a:hover {
  color: var(--primary);
}

/* Ad Units */
.ad-unit {
  background: var(--secondary);
  border-radius: var(--radius);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  overflow: hidden;
  color: var(--text-light);
}

.ad-leaderboard {
  width: 100%;
  height: 90px;
  max-width: 1200px;
}

/* Footer */
footer {
  background: var(--text);
  color: var(--white);
  padding: 4rem 5% 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 2rem;
}

.footer-col h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 10px;
}
footer h3,
.footer-col h3 {
  color: white !important;
}

.footer-col h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-light);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 1rem;
}

.social-links a {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.copyright {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Mobile Menu */
@media (max-width: 768px) {
  nav {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 999;
  }

  nav.active {
    transform: translateY(0);
  }

  .menu-btn {
    display: block;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

/* Loading Animation Styles */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #4a89dc; /* Match your primary color */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Hide after loading */
body.loaded #loading-overlay {
  opacity: 0;
  pointer-events: none;
}
