:root {
  --primary-color: #4facfe;
  --primary-dark: #1a73e8;
  --dark-bg: #0f0f1a;
  --dark-card: #1a1a2e;
  --text-color: #2d3436;
  --text-light: #636e72;
  --bg-light: #f8f9fa;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

[data-bs-theme="dark"] {
  --text-color: #e0e0e0;
  --text-light: #a0a0a0;
  --bg-light: #1a1a2e;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

* {
  font-family: "Inter", "Poppins", sans-serif;
}

body {
  background: var(--bg-light);
  color: var(--text-color);
  overflow-x: hidden;
}

.main-content {
  padding-top: 76px;
}

/* Navbar */
.main-navbar {
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 0;
}
.main-navbar .nav-link {
  color: rgba(255, 255, 255, 0.75) !important;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px !important;
  transition: var(--transition);
  border-radius: 8px;
}
.main-navbar .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}
.brand-text {
  font-weight: 800;
  font-size: 22px;
  color: #fff;
}
.brand-highlight {
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Reading Progress */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  z-index: 9999;
  width: 0;
  transition: width 0.1s;
}

/* Hero / Featured */
.featured-card {
  height: 500px;
  cursor: pointer;
  overflow: hidden;
}
.featured-img {
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
}
.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
}
.featured-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
}
.featured-card:hover .featured-img {
  transform: scale(1.05);
  transition: transform 0.6s ease;
}
.featured-img {
  transition: transform 0.6s ease;
}

/* Trending */
.trending-item {
  background: rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}
.trending-item:hover {
  background: rgba(79, 172, 254, 0.08);
  transform: translateX(5px);
}
.trending-number {
  font-size: 24px;
  color: var(--primary-color);
  opacity: 0.5;
  min-width: 35px;
}

/* Category Filter */
.category-filter {
  background: #fff;
  color: var(--text-color);
  border: 1px solid #e0e0e0;
  font-size: 13px;
  padding: 6px 18px;
  transition: var(--transition);
}
.category-filter:hover,
.category-filter.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* Article Card */
.article-card {
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  overflow: hidden;
}
.article-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-5px);
}
.article-thumb {
  height: 200px;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}
.article-card:hover .article-thumb {
  transform: scale(1.1);
}
.category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-color);
  font-weight: 500;
  font-size: 11px;
  padding: 4px 12px;
}
.article-card .card-title {
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.4;
  transition: var(--transition);
}
.article-card:hover .card-title {
  color: var(--primary-color);
}

/* Detail Article */
.detail-article .article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-color);
}
.detail-article .article-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 30px;
  margin-bottom: 15px;
}
.detail-article .article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 25px;
  margin-bottom: 12px;
}
.detail-article .article-content p {
  margin-bottom: 16px;
}
.detail-article .article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 15px 20px;
  margin: 20px 0;
  background: rgba(79, 172, 254, 0.06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #555;
}
.detail-article .article-content ul,
.detail-article .article-content ol {
  margin-bottom: 16px;
  padding-left: 25px;
}
.detail-article .article-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 20px 0;
}

/* Comments */
.comment-avatar .avatar-placeholder {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.comment-item {
  background: #f8f9fa;
  transition: var(--transition);
}
.comment-item:hover {
  background: #f0f2f5;
}

/* Sidebar */
.sidebar-sticky {
  position: sticky;
  top: 90px;
}
.trending-thumb-sm {
  width: 65px;
  height: 65px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.trending-item-sm {
  background: rgba(0, 0, 0, 0.02);
  transition: var(--transition);
}
.trending-item-sm:hover {
  background: rgba(79, 172, 254, 0.06);
  transform: translateX(3px);
}

/* Newsletter */
.newsletter-card {
  background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
  color: #fff;
}
.newsletter-card .form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.newsletter-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Footer */
.footer {
  background: #0f0f1a;
  color: #fff;
  padding: 60px 0 30px;
  margin-top: 60px;
}
.footer h5,
.footer h6,
.footer p,
.footer ul li,
.footer .brand-text,
.footer .brand-highlight {
  color: #fff;
}
.footer .text-muted {
  color: rgba(255, 255, 255, 0.75) !important;
}
.footer a {
  color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
}
.footer a:hover {
  color: var(--primary-color) !important;
}
.footer .social-links .social-link,
.footer .newsletter-card {
  transition: var(--transition);
}
.social-links .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  margin-right: 8px;
  transition: var(--transition);
}
.social-links .social-link:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-3px);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0;
}
.breadcrumb-item a {
  color: var(--text-light);
}
.breadcrumb-item.active {
  color: var(--primary-color);
}

/* Pagination */
.pagination .page-link {
  border: none;
  color: var(--text-color);
  padding: 8px 18px;
  margin: 0 3px;
  border-radius: 8px !important;
  transition: var(--transition);
}
.pagination .page-item.active .page-link {
  background: var(--primary-color);
  color: #fff;
}
.pagination .page-link:hover {
  background: rgba(79, 172, 254, 0.1);
  color: var(--primary-color);
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] .article-card,
[data-bs-theme="dark"] .category-filter,
[data-bs-theme="dark"] .comment-item {
  background: var(--dark-card);
  color: #e0e0e0;
}
[data-bs-theme="dark"] .comment-form {
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .card-text,
[data-bs-theme="dark"] .text-muted {
  color: #a0a0a0 !important;
}
[data-bs-theme="dark"] .trending-item {
  background: rgba(255, 255, 255, 0.03);
}
[data-bs-theme="dark"] .trending-item h6 {
  color: #e0e0e0 !important;
}
[data-bs-theme="dark"] .breadcrumb-item a {
  color: #a0a0a0;
}
[data-bs-theme="dark"] .category-filter {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 991px) {
  .featured-card {
    height: 350px;
  }
  .featured-content {
    padding: 20px;
  }
  .featured-content h2 {
    font-size: 20px;
  }
}
@media (max-width: 767px) {
  .main-content {
    padding-top: 66px;
  }
  .featured-card {
    height: 280px;
  }
  .featured-content h2 {
    font-size: 18px;
  }
  .article-thumb {
    height: 180px;
  }
  .brand-text,
  .brand-highlight {
    font-size: 18px;
  }
}
