/* Base Styles */
:root {
  --primary: #8e2de2;
  --primary-gradient: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
  --secondary: #14f195;
  --accent: #FFFF00;
  --dark: #1a1a2e;
  --light: #f8f9fa;
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--dark);
  color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* Flowing background gradient & particles - USED */
.cinematic-bg,
.floating-particles {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  background-color: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled {
  padding: 0.4rem 5%;
  min-height: 44px;
  background-color: rgba(26, 26, 46, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--light);
  text-decoration: none;
}

.logo span {
  color: var(--secondary);
}

.logo-icon {
  margin-right: 10px;
  font-size: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 2.5rem;
  position: relative;
}

.nav-links a {
  text-decoration: none;
  color: var(--light);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s;
  position: relative;
}

.nav-links a:hover {
  color: var(--secondary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--secondary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(26, 26, 46, 0.95);
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  top: 100%;
  left: 0;
  margin-top: 10px;
  transition: opacity 0.3s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dropdown-content a {
  color: var(--light);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content a:hover {
  background-color: rgba(142, 45, 226, 0.3);
  color: var(--secondary);
  padding-left: 20px;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--light);
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background-color: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1001;
  transition: left 0.3s ease;
  overflow-y: auto;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-menu {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--light);
}

.mobile-nav-links {
  list-style: none;
  padding: 1rem 0;
}

.mobile-nav-links li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-links a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--light);
  text-decoration: none;
  transition: all 0.3s ease;
}

.mobile-nav-links a:hover {
  color: var(--secondary);
  background-color: rgba(142, 45, 226, 0.1);
}

.mobile-dropdown-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem 1.5rem;
  color: var(--light);
  background: none;
  border: none;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-dropdown-btn:hover {
  color: var(--secondary);
  background-color: rgba(142, 45, 226, 0.1);
}

.mobile-dropdown-content {
  display: none;
  background-color: rgba(0, 0, 0, 0.2);
  padding-left: 1rem;
}

.mobile-dropdown-content.active {
  display: block;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: none;
}

        /* Background Animation */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at 20% 50%, rgba(142, 45, 226, 0.1) 0%, transparent 50%),
                        radial-gradient(circle at 80% 80%, rgba(20, 241, 149, 0.05) 0%, transparent 50%);
            pointer-events: none;
            z-index: -1;
        }

        /* Hero Section */
        .hero {
            padding: 10rem 2rem;
            text-align: center;
            margin-bottom: 3rem;
        }

        .hero-content {
            max-width: 900px;
            margin: 0 auto;
        }

        .hero h1 {
            font-size: 4rem;
            font-weight: 900;
            margin-bottom: 1rem;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1.1;
            letter-spacing: -1px;
        }

        .hero-subtitle {
            font-size: 1.2rem;
            color: rgba(248, 249, 250, 0.7);
            margin-bottom: 3rem;
            font-weight: 300;
            letter-spacing: 0.5px;
        }

         /* Topic Introduction */
        .topic-intro {
            max-width: 900px;
            margin: 0 auto 3rem;
            padding: 3rem;
            background: linear-gradient(135deg, rgba(142, 45, 226, 0.15) 0%, rgba(20, 241, 149, 0.08) 100%);
            border: 2px solid var(--secondary);
            border-radius: 20px;
            backdrop-filter: blur(20px);
            box-shadow: 0 8px 32px rgba(142, 45, 226, 0.15);
        }

        .intro-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .intro-icon {
            font-size: 2.5rem;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .intro-title {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--secondary);
        }

        .intro-content {
            color: rgba(248, 249, 250, 0.8);
            line-height: 1.8;
            font-size: 0.95rem;
        }

        .intro-content p {
            margin-bottom: 1rem;
        }

        .intro-content p:last-child {
            margin-bottom: 0;
        }

        .intro-highlights {
            display: flex;
            gap: 1rem;
            margin-top: 1.5rem;
            flex-wrap: wrap;
        }

        .highlight-badge {
            padding: 0.5rem 1rem;
            background: rgba(20, 241, 149, 0.2);
            border: 1px solid var(--secondary);
            border-radius: 20px;
            font-size: 0.85rem;
            color: var(--secondary);
            font-weight: 600;
        }

        /* Search & Sort Section */
        .controls-wrapper {
            max-width: 1000px;
            margin: 0 auto 3rem;
            padding: 0 2rem;
        }

        .search-bar {
            position: relative;
            margin-bottom: 2rem;
        }

        .search-input {
            width: 100%;
            padding: 1rem 1.5rem 1rem 3.5rem;
            border: 2px solid var(--card-border);
            border-radius: 15px;
            background: var(--card-bg);
            color: var(--light);
            font-size: 1rem;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--secondary);
            background: rgba(255, 255, 255, 0.12);
            box-shadow: 0 0 30px rgba(20, 241, 149, 0.3);
        }

        .search-input::placeholder {
            color: rgba(248, 249, 250, 0.4);
        }

        .search-icon {
            position: absolute;
            left: 1.2rem;
            top: 50%;
            transform: translateY(-50%);
            font-size: 1.3rem;
            color: var(--secondary);
        }

        .clear-search {
            position: absolute;
            right: 1.2rem;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: rgba(248, 249, 250, 0.5);
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.3s ease;
            display: none;
        }

        .clear-search:hover {
            color: var(--secondary);
        }

        .clear-search.active {
            display: block;
        }

        /* Controls Row */
        .controls-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .sort-container {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            background: var(--card-bg);
            padding: 0.8rem 1.2rem;
            border-radius: 10px;
            border: 2px solid var(--card-border);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .sort-container:hover {
            border-color: var(--secondary);
        }

        .sort-label {
            font-size: 0.9rem;
            color: rgba(248, 249, 250, 0.7);
            font-weight: 500;
        }

        .sort-select {
            background: none;
            border: none;
            color: var(--secondary);
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            outline: none;
        }

        .sort-select option {
            background: var(--dark);
            color: var(--light);
        }

        .results-info {
            font-size: 0.9rem;
            color: rgba(248, 249, 250, 0.6);
            font-weight: 500;
        }

        /* Articles Section */
        .articles-section {
            max-width: 1000px;
            margin: 0 auto;
            padding: 0 2rem;
        }

        .articles-container {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            margin-bottom: 3rem;
        }

        .article-item {
            background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
            border: 2px solid var(--card-border);
            border-radius: 12px;
            padding: 2rem;
            backdrop-filter: blur(10px);
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .article-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(20,241,149,0.1), transparent);
            transition: left 0.6s ease;
        }

        .article-item:hover::before {
            left: 100%;
        }

        .article-item:hover {
            border-color: var(--secondary);
            transform: translateX(8px);
            box-shadow: 0 20px 60px rgba(142, 45, 226, 0.2);
        }

        .article-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 2rem;
            margin-bottom: 1rem;
        }

        .article-title {
            font-size: 1.4rem;
            font-weight: 700;
            line-height: 1.3;
            color: var(--light);
            flex: 1;
            background: var(--primary-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .article-badge {
            padding: 0.5rem 1.2rem;
            background: rgba(20, 241, 149, 0.15);
            color: var(--secondary);
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            flex-shrink: 0;
            white-space: nowrap;
        }

        .article-description {
            color: rgba(248, 249, 250, 0.75);
            margin-bottom: 1.2rem;
            line-height: 1.7;
            font-size: 0.95rem;
        }

        .article-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 1.2rem;
            border-top: 1px solid var(--card-border);
            flex-wrap: wrap;
            gap: 1rem;
        }

        .article-meta {
            display: flex;
            gap: 2rem;
            font-size: 0.85rem;
            color: rgba(248, 249, 250, 0.5);
        }

        .meta-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .read-btn {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 0.7rem 1.5rem;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .read-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(142, 45, 226, 0.4);
        }

        /* === THUMBNAIL STYLES === */
.article-item {
    display: flex;
    gap: 1.8rem;
    align-items: flex-start;
    padding: 1.8rem !important;
}

.article-thumbnail {
    flex: 0 0 260px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.article-item:hover .article-thumbnail img {
    transform: scale(1.1);
}

.article-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(26,26,46,0.5));
    border-radius: 12px;
    pointer-events: none;
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

/* Remove underline from the "Read Article" link */
.read-btn {
    text-decoration: none !important;
}

/* Optional: make sure it still looks like a button when hovered/focused */
.read-btn:hover,
.read-btn:focus {
    text-decoration: none;
    outline: none;
}

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: rgba(248, 249, 250, 0.5);
        }

        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        .empty-state-text {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
        }

        .empty-state-subtext {
            font-size: 0.95rem;
            color: rgba(248, 249, 250, 0.4);
        }

        /* Pagination */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            margin-top: 3rem;
            margin-bottom: 3rem;
        }

        .page-btn {
            background: var(--card-bg);
            border: 2px solid var(--card-border);
            color: var(--light);
            padding: 0.7rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .page-btn:hover:not(:disabled) {
            border-color: var(--secondary);
            background: rgba(20, 241, 149, 0.1);
        }

        .page-btn.active {
            background: var(--primary-gradient);
            border-color: var(--secondary);
            color: white;
        }

        .page-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .page-info {
            color: rgba(248, 249, 250, 0.6);
            font-size: 0.9rem;
        }

        /* Footer */
.footer {
  background-color: #14142b;
  padding: 5rem 5% 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-column h4 {
  font-size: 1.2rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-column h4::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 2px;
  bottom: 0;
  left: 0;
  background: var(--primary-gradient);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--secondary);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--light);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-link:hover {
  background: var(--primary-gradient);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(142, 45, 226, 0.3);
}

.copyright {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Suggested Section in Mobile Nav */
.suggested-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.suggested-section h4 {
  color: var(--secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.suggested-section a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--light);
  text-decoration: none;
  transition: all 0.3s ease;
  background: rgba(142, 45, 226, 0.1);
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--secondary);
}

.suggested-section a:hover {
  background: rgba(142, 45, 226, 0.2);
  color: var(--secondary);
  padding-left: 2rem;
}

/* Animations */
@keyframes floatAnimation {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-15px);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-content {
    width: 55%;
  }
  
  .hero-image {
    width: 45%;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 1rem 5%;
  }
  
  .nav-links {
    display: none;
  }
  
  .mobile-menu {
    display: block;
  }
  
  .hero {
    flex-direction: column;
    height: auto;
    padding: 120px 5% 5rem;
  }
  
  .hero-content {
    width: 100%;
    padding-right: 0;
    text-align: center;
    margin-bottom: 3rem;
  }
  
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-image {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }

  /* Topic intro mobile spacing */
  .topic-intro {
    margin: 0 1.5rem 3rem;
    padding: 1.5rem;
  }

  .intro-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .intro-icon {
    font-size: 2rem;
  }

  .intro-title {
    font-size: 1.1rem;
  }

  .intro-content {
    font-size: 0.9rem;
  }

  /* Article thumbnail mobile – stack image on top */
  .article-item {
    flex-direction: column;
    padding: 2rem !important;
  }
  
  .article-thumbnail {
    width: 100%;
    height: 200px;
    flex: none;
    margin-bottom: 1rem;
  }

  .controls-row {
    flex-direction: column;
  }

  .article-header {
    flex-direction: column;
    gap: 1rem;
  }

  .article-title {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .section-title {
    font-size: 2rem;
  }

  /* Extra small mobile - even tighter spacing */
  .topic-intro {
    margin: 0 1rem 2rem;
    padding: 1.2rem;
    border-radius: 15px;
  }

  .intro-icon {
    font-size: 1.8rem;
  }

  .intro-title {
    font-size: 1rem;
  }

  .intro-content {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .highlight-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}