/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

:root {
  --primary: #073a6d;
  ;
  --secondary: #22b2a4;
  --heart: #e74c3c;
  --accent: #159594;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --gray: #95a5a6;
  --success: #00b38c;
  --ternary: #9C27B0;
}

body {
  background-color: #f9f9f9;
  color: var(--primary);
  line-height: 1.6;
}

html,
body {
  overflow-x: clip;
  width: 100%;
}

html {
  overflow-y: scroll;
}

a {
  text-decoration: none;
  color: var(--secondary);
}

ul {
  list-style: none;
}

pre,
code {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--secondary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--secondary);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 400;
  font-size: 12px;
}

.btn-outline:hover {
  background-color: var(--secondary);
  color: white;
}

.btn-accent {
  background-color: var(--accent);
  color: white;
  border: none;
}

.btn-accent:hover {
  background-color: #c0392b;
}

/* ===== HEADER BASE ===== */
header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  flex-wrap: wrap;
}

.logo img {
  width: 160px;
  height: auto;
}

/* === MENU === */
.menu-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-item {
  position: relative;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 10px;
  transition: color 0.2s;
}

.menu-btn:hover {
  color: var(--accent);
}

/* Dropdown fix (no flicker) */
.menu-dropdown {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 38px;
  left: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 10px 14px;
  z-index: 999;
  min-width: 200px;
  transition: all 0.2s ease;
}

.menu-item:hover .menu-dropdown {
  opacity: 1;
  visibility: visible;
}

.menu-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 15px;
  padding: 6px 0;
  transition: color 0.2s;
}

.menu-dropdown a:hover {
  color: var(--accent);
}

/* === SEARCH BAR === */
.search-bar {
  display: flex;
  max-width: 250px;
  flex: 1;
}

.search-bar input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
}

.search-bar button {
  background-color: var(--secondary);
  color: white;
  border: none;
  padding: 0 12px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

/* === BUTTONS === */
.post-btn {
  background-color: var(--secondary);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* === MOBILE === */
.mobile-icons {
  display: none;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--primary);
  cursor: pointer;
}

.mobile-post {
  background: var(--secondary);
  color: white;
  border-radius: 4px;
  padding: 6px 8px;
}

.menu-login {
  display: none;
  margin: 10px 0;
  text-align: center;
}

/* === MOBILE SLIDE MENU === */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.mobile-menu.active {
  right: 0;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
}

.overlay.active {
  display: block;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.mobile-menu-list li {
  border-bottom: 1px solid #f5f5f5;
}

.mobile-menu-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 15px;
  font-size: 15px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.mobile-menu-list button:hover {
  color: var(--accent);
}

.submenu {
  display: none;
  flex-direction: column;
  padding-left: 25px;
  background: #fafafa;
}

.submenu.active {
  display: flex;
}

.submenu a {
  display: block;
  padding: 12px 15px;
  font-size: 15px;
  color: var(--primary);
  text-decoration: none;
}

.submenu a:hover {
  color: var(--accent);
}

.back-btn {
  visibility: hidden;
}

.login-link {
  text-align: center;
  padding: 4px;
}


@media (max-width: 992px) {
  .menu-wrapper {
    display: none;
    flex-direction: column;
    width: 100%;
    background: white;
    border-top: 1px solid #eee;
    padding: 10px 0;
  }

  .menu-wrapper.active {
    display: flex;
  }

  .menu-item {
    width: 100%;
    border-bottom: 1px solid #f2f2f2;
  }

  .menu-btn {
    width: 100%;
    justify-content: space-between;
  }

  .menu-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    display: none;
    box-shadow: none;
    padding-left: 20px;
  }

  .menu-item.active .menu-dropdown {
    display: block;
  }

  .menu-login {
    display: block;
  }

  .search-bar {
    display: none;
    width: 100%;
    margin-top: 10px;
    max-width: 420px;
  }

  .search-bar.active {
    display: flex;
    flex: 0 0 100%;
  }

  .mobile-icons {
    display: flex;
  }

  .header-actions {
    display: none;
  }

  .header-top {
    padding: 18px 0;
  }
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.login-btn i {
  font-size: 16px;
  color: var(--secondary);
  transition: color 0.3s ease;
}

.login-btn:hover {
  background: var(--secondary);
  color: #fff;
}

.login-btn:hover i {
  color: #fff;
}

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

/* Navigation Styles */
nav {
  background-color: var(--primary);
  color: white;
  position: fixed;
  top: var(--header-height, 84px);
  left: 0;
  width: 100%;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

nav a {
  background-color: var(--primary);
  color: white;
}

.nav-container {
  display: flex;
  gap: 8px;
  min-width: 0;
  justify-content: space-between;
  align-items: center;
}

.categories {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  padding: 5px 0;
  gap: 5px;
  font-size: 16px;
}

.categories::-webkit-scrollbar {
  height: 5px;
}

.categories::-webkit-scrollbar-thumb {
  background-color: var(--secondary);
  border-radius: 10px;
}

.category {
  flex-shrink: 0;
  padding: 5px 10px;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.category:hover,
.category.active {
  background-color: var(--secondary);
}

.more-categories {
  position: relative;
  flex-shrink: 0;
}

.hamburger-menu {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 5px 12px;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  width: 430px;
  display: none;
  z-index: 100;
  overflow-y: auto;
  /* Enable scrolling */
  max-height: 300px;
  /* Limit height */
  padding: 10px;
}

/* Show dropdown */
.dropdown-menu.show {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* Two items per row */
  gap: 8px;
}

/* Dropdown items */
.dropdown-menu .category {
  color: var(--dark);
  display: block;
  background: #f9f9f9;
  padding: 8px 10px;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-menu .category:hover {
  background: var(--primary);
  color: #757474;
}

/* Scrollbar style */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}


.dropdown-menu .category:hover {
  background-color: var(--light);
}

/* Default desktop: hide after 10 categories (+1 for Home) */


/* Main Content Layout */
.main-content {
  display: flex;
  margin: 30px 0;
  gap: 20px;
  padding-top: 68px;
}

.sidebar {
  flex: 0 0 250px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 15px;
  height: fit-content;
}

.sidebar-section {
  margin-bottom: 15px;
}

.sidebar-section h3 {
  font-size: 16px;
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
  color: var(--primary);
  padding-left: 5px;
}

.sidebar-links a {
  display: block;
  padding: 5px 0;
  color: var(--primary);
  transition: color 0.3s;
  border-left: 3px solid transparent;
  padding-left: 5px;
  font-size: 15px;
}

.sidebar-links a:hover,
.sidebar-links a.active {
  color: var(--ternary);
  border-left-color: var(--ternary);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 115px;
  /* below header */
  left: 4px;
  background: #547b8f;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 22px;
  padding: 8px 10px;
  z-index: 1100;
  cursor: pointer;
  transition: opacity 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Hide toggle when sidebar is active */
.sidebar-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Sidebar Close Button */
.sidebar-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--primary);
  cursor: pointer;
  z-index: 10;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.sidebar-overlay.active {
  display: block;
}

/* Sidebar Default */
.sidebar {
  flex: 0 0 250px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  height: fit-content;
  transition: transform 0.3s ease-in-out;
  position: relative;
}

/* Mobile Sidebar */
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    top: 112px;
    /* under navbar */
    left: 0;
    height: calc(100% - 112px);
    width: 260px;
    transform: translateX(-100%);
    z-index: 1050;
    overflow-y: auto;
    border-radius: 0;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .main-content {
    display: block;
  }

  .content {
    width: 100%;
    padding: 20px;
  }

  nav {
    top: 70px;
  }

  .home-hero h1 {
    font-size: 31px !important;
    padding-top: 29px !important;
  }
}

/* Hide close button on desktop */
@media (min-width: 992px) {
  .sidebar-close {
    display: none;
  }
}

.content {
  flex: 1;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 25px;
}

.content-header {
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.content-header h2 {
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 10px;
}

.content-meta {
  display: flex;
  gap: 15px;
  color: var(--gray);
  font-size: 8px;
  justify-content: left;
}

.content-body {
  line-height: 1.8;
}

.content-body h2,
h3 {
  margin: 20px 0 10px;
  color: var(--primary);
  margin-bottom: 10px;
}

.content-body h2 {
  font-size: 22px;
}

.content-body h3 {
  font-size: 20px;
}

.content-body p {
  margin-bottom: 15px;
  font-size: 15px;
}

.content-body ul {
  list-style-type: disc;
  /* default bullets */
  margin-left: 1.5rem;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.content-body ol {
  list-style-type: decimal;
  /* numbered lists */
  margin-left: 1.5rem;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.content-body li {
  margin-bottom: 18px;
  line-height: 1.6;
  font-size: 15px;
}

/* Scroll wrapper for large images */
.content-body .img-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}

/* Images inside content */
.content-body .img-wrapper img {
  display: inline-block;
  max-width: 780px;
  width: 100%;
  height: auto;
}


.content-body pre {
  background-color: #f4f4f4;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 15px 0;
  border-left: 4px solid #2ecc71 !important;
  color: #6f6565 !important;
}

.content-body code {
  background-color: #f4f4f4;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 14px !important;
}

pre code {
  display: block;
  white-space: pre;
  margin: 0;
  padding: 0;
}

/* Custom Prism styling */
pre[class*="language-"] {
  background: #f4f4f4 !important;
  border: 1px solid #e1e1e8 !important;
  border-radius: 6px !important;
  padding: 15px !important;
  margin: 15px 0 !important;
  overflow: auto !important;
  border-left: 4px solid #2ecc71 !important;
  max-width: 750px;
  font-size: 14px !important;
  line-height: 1.5;
}

code[class*="language-"] {
  background: #f4f4f4 !important;
  color: #333 !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px !important;
}

.token.comment {
  color: #6a737d !important;
}

.token.keyword {
  color: #a426a2 !important;
}

.token.class-name {
  color: #bd6f02 !important;
}

.token.namespace {
  color: #373941 !important;
}

.token.punctuation {
  color: #373941 !important;
}


.token.string {
  color: #4ea04c !important;
}

.token.number {
  color: #005cc5 !important;
}

.token.function {
  color: #3b74ef !important;
}

.token.operator {
  color: #cb4f5b !important;
}


/* Base table styling */
.content-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 1px solid rgba(180, 180, 200, 0.4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  min-width: 600px;
  /* Keep layout readable for scrolling */
}

.content-body .table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

/* Header styling */
.content-body table thead {
  background-color: #f0f0f0;
  color: #2e2d2d;
  text-align: left;
  font-weight: 600;
}

.content-body table thead th {
  padding: 0.9rem 1.2rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Table body styling */
.content-body table tbody tr {
  transition: background 0.25s ease;
}

.content-body table tbody tr:nth-child(even) {
  background-color: rgba(99, 102, 241, 0.05);
}

.content-body table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.12);
}

/* Cells */
.content-body table td {
  padding: 0.85rem 1.2rem;
  border-top: 1px solid rgba(180, 180, 200, 0.3);
  vertical-align: middle;
}

/* Headings inside content */
.content-body h4 {
  margin: 20px 0 10px;
  font-size: 20px;
}

.content-body::-webkit-scrollbar {
  height: 8px;
}

.content-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 4px;
}

.content-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

/* ✨ Optional: shadow hint when scrollable */
.content-body {
  position: relative;
}

.content-body::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.3s;
}

.content-actions {
  display: flex;
  gap: 10px;
  margin: 25px 0;
  margin-top: 100px;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid #ddd;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.like-btn:hover {
  background-color: #f9f9f9;
}

.like-btn.liked {
  background-color: #ffeaea;
  border-color: var(--heart);
  color: var(--heart);
}

/* Save button */
#saveBtn.bookmarked i {
  color: #f1c40f;
}

/* Share popup */
.share-popup {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  gap: 5px;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-popup .share-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: bold;
  padding: 5px;
  transition: background 0.2s;
}

.share-popup .share-link:hover {
  background-color: var(--secondary);
  color: white;
  border-radius: 4px;
}

.title-nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* keep buttons aligned to the top */
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 0px;
  position: relative;
}

/* Ensure the title can wrap but buttons stay fixed */
.title-nav-wrapper h2 {
  flex: 1;
  /* take available width */
  margin: 0;
  word-break: break-word;
  line-height: 1.4;
  text-align: center;
}

/* Keep the buttons in one row at the top right */
.topic-navigation {
  flex-shrink: 0;
  /* prevent shrinking */
  display: flex;
  align-items: center;
  justify-content: right;
}

/* Navigation buttons */
.topic-navigation .nav-btn {
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  margin-left: 5px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.topic-navigation .nav-btn:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.topic-navigation .nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 75px;
  right: 30px;
  width: 45px;
  height: 45px;
  background-color: #1ac1be;
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.back-to-top:hover {
  background-color: #12d3cf;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top i {
  font-size: 20px;
}

/* Footer Styles */
.site-footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
  padding: 60px 0 0;
  margin-top: 80px;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--secondary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 0px;
}

.footer-links a:hover {
  color: var(--secondary);
  transform: translateX(5px);
}

.footer-links a::before {
  content: '▸';
  font-size: 12px;
  margin-left: -7px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.footer-links a:hover::before {
  opacity: 1;
}

/* Improved Categories Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0px;
}

.category-grid a {
  /* Improved Categories Grid */
  padding: 10px 0px;
  border-radius: 6px;
  /* border: 1px solid rgba(255, 255, 255, 0.1); justify-content: center;   align-items: center;*/
  transition: all 0.3s ease;
  text-align: center;
  display: flex;
  min-height: 44px;
}

.category-grid a:hover {
  border-color: var(--secondary);
  transform: translateY(-2px);
  /*  background: rgba(231, 76, 60, 0.1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);*/
}

.category-grid a::before {
  display: none;
  /* Remove the arrow for categories */
}

/* Newsletter Column */
.newsletter-column {
  grid-column: span 2;
}

.newsletter-column p {
  color: #bdc3c7;
  margin-bottom: 20px;
  font-size: 15px;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  max-width: 400px;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #34495e;
  border-radius: 6px;
  background: #2c3e50;
  color: #ecf0f1;
  font-size: 15px;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--secondary);
}

.newsletter-form button {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.newsletter-form button:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #ecf0f1;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 16px;
}

.social-icons a:hover {
  background: var(--secondary);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid #34495e;
  padding: 25px 0;
  background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom p {
  color: #bdc3c7;
  font-size: 15px;
  margin: 0;
}

.footer-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

/* Responsive Design - Improved */
@media (max-width: 1200px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }

  .newsletter-column {
    grid-column: span 3;
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .newsletter-column {
    grid-column: span 2;
  }

  .footer-links a {
    justify-content: center;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0px;
  }

  .category-grid a {
    padding: 8px 10px;
    font-size: 13px;
    min-height: 40px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-badges {
    justify-content: center;
  }

}

@media (max-width: 480px) {
  .site-footer {
    padding: 40px 0 0;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .newsletter-column {
    grid-column: span 1;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .social-icons {
    justify-content: center;
  }

  .footer-column h3 {
    text-align: center;
  }

  .footer-column h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  /* Even smaller screens */
  @media (max-width: 360px) {
    .category-grid {
      grid-template-columns: 1fr;
    }

    .category-grid a {
      text-align: left;
      justify-content: flex-start;
      padding-left: 15px;
    }
  }
}

.right-side-imp {
  margin: 0px 0 0px !important;
}

.ads {
  flex: 0 0 250px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 15px;
  height: fit-content;
}

.ad-placeholder {
  background-color: #f9f9f9;
  border: 2px dashed #ddd;
  border-radius: 8px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

/* Add hover animation for all ad boxes */
.ad-placeholder:hover {
  border-color: #bbb;
  background-color: #fefefe;
  transform: translateY(-2px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Style specifically for the contact box */
.ad-contact {
  background: linear-gradient(135deg, #e8f0fe, #ffffff);
}

/* Style for the link itself */
.contact-ad-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  color: #673AB7;
  padding: 12px 18px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hover effect for the link */
.contact-ad-link:hover {
  color: #673AB7;
  box-shadow: 0 4px 10px rgba(30, 136, 229, 0.3);
}

.ad-text-links {
  text-align: center;
}

.ad-text-link {
  display: inline-block;
  margin: 5px 0;
  padding: 6px 10px;
  color: #673AB7;
  font-size: 14px;
  text-decoration: none;
  background-color: #ece6f8;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.ad-text-link:hover {
  background-color: #673AB7;
  color: white;
}

.ads-top-text {
  text-align: center;
  text-align: center;
  color: var(--primary);
  font-size: 16px;
  margin-bottom: 3px;
}

.ads-image {
  max-width: 100%;
  height: 290px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Comments Section */
.comments-section {
  margin-top: 40px;
}

.comments-section h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--primary);
}

.comment-form {
  margin-bottom: 30px;
}

.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 10px;
  font-family: inherit;
}

.comment {
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  color: var(--primary);
}

.comment-date {
  color: var(--gray);
  font-size: 15px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  color: var(--primary);
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.home-hero {
  text-align: center;
}

.home-hero h1 {
  color: #3F51B5;
  font-size: 44px;
  padding-top: 70px;
}

.home-hero p {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  margin-top: 14px;
}

.started-div {
  margin-top: 1px;
}

.started-div a {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 70px;
}

.started-div .get-started-btn {
  background-color: #4591a0;
  color: #ffffff;
  font-size: 15px;
}

.started-div .gen-ai-btn {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--secondary);
  margin-left: 20px;
  font-size: 15px;
}

.started-div a:hover {
  transform: translateY(-5px);
}

.started-div a:active {
  transform: translateY(0);
}

.started-div .get-started-btn:hover {
  background-color: #17b4d3;
}

.started-div .gen-ai-btn:hover {
  background-color: var(--secondary);
  color: #ffffff;
}

.section-title {
  margin-top: 60px;
  margin-bottom: 20px;
  font-size: 24px;
  text-align: center;
  color: var(--dark);
}

.latest-posts,
.our-services {
  margin-top: 60px;
  padding: 0 20px;
}

/* Latest Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.post-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--dark);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.post-card h3 {
  font-size: 16px;
  color: #3F51B5;
  margin-bottom: 10px;
}

.post-card p {
  font-size: 14px;
  color: var(--primary);
  line-height: 1.5;
}

/* Our Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.service-card {
  background-color: var(--light);
  border-radius: 12px;
  text-align: center;
  padding: 25px 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.service-card i {
  font-size: 28px;
  color: var(--secondary);
  margin-bottom: 10px;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.quiz-question {
  background: #fff;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quiz-question ul {
  list-style-type: none;
  padding: 0;
}

.quiz-question li {
  margin: 6px 0;
}


#quizResult {
  margin-top: 20px;
  margin-bottom: 40px;
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
}

.quiz-actions {
  margin-top: 20px;
  text-align: center;
  margin-bottom: 40px;
}

/* Interview Questions Styling */
.interview-questions-container {
  margin: 2rem 0;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  overflow: hidden;
}

.programming-question {
  border-bottom: 1px solid #e1e5e9;
  padding: 1.5rem;
}

.programming-question:last-child {
  border-bottom: none;
}

.question-header h4 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 1rem;
}


/* Language Tabs */
.language-tabs {
  display: flex;
  border-bottom: 1px solid #e1e5e9;
  margin-bottom: 0;
  /* Remove margin since code-header will handle spacing */
  flex-wrap: wrap;
  gap: 0.5rem;
  /* Use gap instead of margin-right for better spacing */
}

.language-tab {
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-bottom: none;
  padding: 0.5rem 1rem;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.language-tab:hover {
  background: #e9ecef;
}

.language-tab.active {
  background: #3bb1a6;
  color: white;
  border-color: #3bb1a6;
}

/* Code Display */
.code-displays {
  position: relative;
}

.code-display {
  display: none;
}

.code-display.active {
  display: block;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e6e6e6;
  /* Match the pre tag background */
  border: 1px solid #e6e6e6;
  border-bottom: none;
  color: #2d3748;
  /* Dark text color for better contrast */
  padding: 0.1rem 1rem;
  border-radius: 4px 4px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: -15px;
}

.code-header span {
  /* This will center the language text */
  flex: 1;
  font-size: 12px;
}

.copy-code-btn {
  background: #eeeeee;
  border: 1px solid #eeeeee;
  color: #555454;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.copy-code-btn:hover {
  background: #eeeeee;
  border-color: #eeeeee;
  transform: translateY(-1px);
}

.code-display pre {
  margin: 0;
  border-radius: 0 0 4px 4px;
}

.code-display code {
  display: block;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-top: none;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

.solution-explanation {
  margin-top: 1rem;
  padding: 1rem;
  background: #e8f4fd;
  border-left: 4px solid #007bff;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
}

/* Syntax Highlighting (basic) */
.language-java .keyword {
  color: #0000ff;
}

.language-python .keyword {
  color: #0000ff;
}

.language-javascript .keyword {
  color: #0000ff;
}

.language-csharp .keyword {
  color: #0000ff;
}

.language-cpp .keyword {
  color: #0000ff;
}

/* Responsive */
@media (max-width: 768px) {
  .title-nav-wrapper {
    margin-bottom: 5px;
  }
  .main-content {
    padding-top: 55px;
  }
  .language-tabs {
    flex-direction: row;
    /* Keep tabs in row even on mobile */
    overflow-x: auto;
    /* Allow horizontal scrolling if needed */
    padding-bottom: 0.5rem;
    gap: 0.3rem;
  }

  .language-tab {
    margin-bottom: 0;
    border-radius: 4px;
    white-space: nowrap;
    /* Prevent text wrapping */
    flex-shrink: 0;
    /* Prevent tabs from shrinking */
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .programming-question {
    padding: 1rem;
  }

  .code-header {
    padding: 0.6rem 0.8rem;
    flex-direction: row;
    /* Keep header items in row */
  }

  .code-header span {
    font-size: 0.75rem;
  }

  .copy-code-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .code-display code {
    padding: 0.8rem;
    font-size: 0.85rem;
  }
}

/* Additional mobile optimization for very small screens */
@media (max-width: 480px) {
  .language-tabs {
    gap: 0.2rem;
  }

  .language-tab {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .code-header {
    padding: 0.1rem 1rem;
  }

  .code-header span {
    font-size: 11px;
  }

  .copy-code-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* === Preloader === */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 9999999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: relative;
}

#loader-1:before,
#loader-1:after {
  content: "";
  position: absolute;
  top: -6px;
  left: -6px;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--accent);
}

#loader-1:before {
  z-index: 100;
  animation: spin 1.5s linear infinite;
}

#loader-1:after {
  border: 4px solid #f3f3f3;
}

/* === Animation === */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


/* Responsive Styles */
@media (max-width: 992px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar,
  .ads {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
  }

  .logo {
    margin-bottom: 0px;
  }

  .header-actions {
    margin-left: auto;
  }



  .categories {
    font-size: 15px;
    gap: 0px;
  }

  .category {
    padding: 5px 10px;
  }

  .content-header h2 {
    font-size: 22px;
  }

  .content-body h2,
  h3 {
    font-size: 20px;
  }

  .content-body h4 {
    margin: 20px 0 10px;
    font-size: 18px;
  }

  .content-body p {
    font-size: 15px;
  }

  .content-body li {
    font-size: 15px;
  }

  .content-meta {
    font-size: 8px;
  }

  .dropdown-menu {
    width: 80vw;
    right: 2vw;
    max-height: 50vh;
  }

  .dropdown-menu.show {
    grid-template-columns: 1fr 1fr;
  }

  .back-to-top {
    bottom: 60px;
  }

}

@media (max-width: 391px) {
  .home-hero h1 {
    font-size: 28px !important;
    padding-top: 27px !important;
  }

  .home-hero p {
    font-size: 15px !important;
  }

  .header-top {
    padding: 10px 0;
  }

  nav {
    top: 53px;
  }

  .back-to-top {
    bottom: 53px;
  }

  .started-div a {
    margin-top: 44px !important;
  }

  .started-div .get-started-btn {
    font-size: 13px !important;
  }

  .started-div .gen-ai-btn {
    font-size: 13px !important;
    margin-left: 0px;
  }

  .latest-posts,
  .our-services {
    padding: 0 0px !important;
  }

  .section-title {
    font-size: 24px !important;
  }

  .post-card h3 {
    font-size: 16px !important;
  }

  .post-card p {
    font-size: 14px !important;
  }

  .content-header h2 {
    font-size: 22px;
  }

  .content-body h2,
  h3 {
    font-size: 20px;
  }

  .content-body p {
    font-size: 15px;
  }

  .content-body li {
    font-size: 15px;
  }

  .content-body code {
    font-size: 15px !important;
  }

  .comments-section h3 {
    font-size: 18px;
  }

  .comment-author {
    font-size: 13px;
  }

  .content-meta {
    font-size: 8px;
  }

  .sidebar-toggle {
    top: 98px;
  }

  .sidebar {
    top: 98px;
  }


  .topic-navigation .nav-btn {
    padding: 3px 8px;
    font-size: 12px;
    margin-left: 2px;
  }
}
/* Keep both header rows in flow so navigation needs no post-load offsets. */
.skip-link {
  position: absolute;
  top: 0;
  left: 15px;
  transform: translateY(-120%);
  z-index: 1100;
  padding: 8px 12px;
  background: white;
}
.skip-link:focus {
  transform: translateY(0);
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}
.site-header > header,
.site-header > nav {
  position: relative;
  top: auto;
  left: auto;
}
.site-header .logo img {
  display: block;
  aspect-ratio: 334 / 88;
}
.site-header .categories {
  height: 46px;
  align-items: center;
}
.main-content {
  padding-top: 0;
}
#dropdownMenu .category { white-space: normal; overflow-wrap: anywhere; }
