:root {
  /* LIGHT THEME */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary-color: #1a56db;
  --primary-hover: #1e429f;
  --accent-tint: rgba(26, 86, 219, 0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] {
  /* DARK THEME */
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-header: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --accent-tint: rgba(59, 130, 246, 0.1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* HEADER & NAVBAR */
header.fixed-top {
  background-color: var(--bg-header) !important;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  z-index: 1050;
}

.navbar-brand img {
  filter: var(--logo-filter);
  transition: filter 0.3s;
}

[data-theme="dark"] .navbar-brand img {
  filter: brightness(0) invert(1);
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  background-color: var(--bg-body) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: 12px !important;
  padding: 0.75rem 1.25rem 0.75rem 3rem !important;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 4px var(--accent-tint) !important;
}

/* HERO SECTION */
.hero-gradient {
  background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
  padding: 4rem 0;
  color: white;
  margin-bottom: 3rem;
  border-radius: 0 0 2rem 2rem;
}

/* CATEGORY CARDS */
.module-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1.5rem;
  height: auto;
  min-height: 100%; /* Default for grids */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  color: inherit !important;
  display: flex !important;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.module-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background-color: var(--accent-tint);
  color: var(--primary-color);
}

.module-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.module-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* SECTION TITLES */
.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

/* DARK MODE TOGGLE */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background-color: var(--accent-tint);
  border-color: var(--primary-color);
}

/* GLASS EFFECT ELEMENTS */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* SIDEBAR WIDGETS */
.sidebar-widget {
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-tint);
  display: block;
}

.related-post-item {
  transition: all 0.2s ease;
}

.related-post-item:hover .text-main {
  color: var(--primary-color) !important;
}

/* SOCIAL SHARING */
.share-section .btn {
  padding: 0.5rem 1rem;
  font-weight: 500;
  border: none;
  transition: transform 0.2s, opacity 0.2s;
}

.share-section .btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* LIST VIEW */
.list-view-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-item-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.list-item-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: translateX(5px);
}

/* UTILITIES */
.bg-primary-soft {
  background-color: var(--accent-tint);
}

.text-main {
  color: var(--text-main);
}

.smaller {
  font-size: 0.8rem;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .hero-gradient {
    padding: 3rem 0;
    border-radius: 0 0 1.5rem 1.5rem;
  }
}

/* HOMEPAGE ERPLAIN STYLE */
.hero-erplain {
  background-color: var(--bg-body);
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .hero-erplain {
  background: var(--bg-body);
}

.search-container-erplain {
  max-width: 600px;
}

.search-container-erplain .form-control {
  height: 50px;
  border-radius: 0.5rem 0 0 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}

.search-container-erplain .btn {
  border-radius: 0 0.5rem 0.5rem 0;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 600;
}

.quick-link-item { color: var(--text-muted); }
.quick-link-icon {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  font-size: 1.75rem;
  color: var(--primary-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-link-item:hover .quick-link-icon { 
  transform: translateY(-5px); 
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.section-group-title {
  font-size: 1.5rem;
  color: var(--text-main);
  font-weight: 700;
}

.category-index-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.category-index-title a {
  color: var(--text-main);
  transition: color 0.2s;
}

.category-index-title a:hover {
  color: var(--primary-color);
}

.category-article-list li a {
  padding: 4px 0;
  transition: all 0.2s;
}

.category-article-list li a:hover {
  color: var(--primary-color) !important;
  padding-left: 5px;
}

.help-footer-box {
  background-color: var(--accent-tint);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
}

.hero-icons-bg i {
  position: absolute;
  opacity: 0.05;
  font-size: 6rem;
  color: var(--primary-color);
}

.smallest { font-size: 0.7rem; }
.ls-1 { letter-spacing: 1px; }
