* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  color: #1e293b;
  transition: 0.3s ease;
  overflow-x: hidden;
}

/* ================= HEADER ================= */
header {
  background: linear-gradient(135deg, #f43f5e, #ec4899, #8b5cf6);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.header-desktop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo i {
  color: #f59e0b;
  font-size: 24px;
}

.logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.logo:hover .logo-img {
  transform: scale(1.05);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: white;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 40px;
  transition: 0.2s;
  font-size: 14px;
}

.nav-link:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  position: relative;
}

.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}

#searchBox {
  padding: 10px 16px 10px 38px;
  border: none;
  border-radius: 40px;
  width: 220px;
  background: white;
  outline: none;
  font-size: 14px;
  transition: 0.2s;
}

#searchBox:focus {
  width: 260px;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

#darkModeToggle {
  background: rgba(0,0,0,0.25);
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
  white-space: nowrap;
  font-size: 14px;
}

#darkModeToggle:hover {
  background: rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

/* ================= MOBILE HEADER ================= */
.header-mobile {
  display: none;
}

.mobile-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.mobile-menu-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-links {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin: 12px 0 8px 0;
  flex-wrap: wrap;
}

.mobile-nav-link {
  flex: 1;
  text-align: center;
  background: rgba(255,255,255,0.15);
  padding: 8px 10px;
  border-radius: 30px;
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.2s;
}

.mobile-nav-link:hover {
  background: rgba(255,255,255,0.3);
}

.mobile-search {
  margin-top: 8px;
}

.mobile-search input {
  width: 100%;
  padding: 10px 15px;
  border: none;
  border-radius: 30px;
  outline: none;
  font-size: 14px;
}

/* ================= SIDEBAR ================= */
.container {
  display: flex;
  min-height: calc(100vh - 200px);
}

aside {
  width: 260px;
  background: white;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar {
  list-style: none;
  padding: 20px 10px;
}

.sidebar li {
  margin-bottom: 4px;
}

.sidebar li a {
  text-decoration: none;
  color: #334155;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s;
}

.sidebar li a:hover {
  background: #f1f5f9;
  color: #f43f5e;
}

/* ================= SIDEBAR SUBMENU - DESKTOP HOVER ================= */
.submenu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.submenu-toggle::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  transition: 0.3s;
}

/* Desktop Hover Effect */
@media (min-width: 769px) {
  .sidebar li:hover > .submenu {
    display: block;
  }
  .sidebar li:hover .submenu-toggle::after {
    transform: rotate(180deg);
  }
}

.submenu {
  list-style: none;
  padding-left: 32px;
  display: none;
}

/* ================= MOBILE SIDEBAR - SIMPLIFIED ================= */
@media (max-width: 768px) {
  /* Sidebar positioning */
  aside {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1100;
    background: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }
  
  aside.mobile-open {
    transform: translateX(0);
  }
  
  /* Overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  /* Submenu - hidden by default, show with active class ONLY */
  .submenu {
    display: none !important;
  }
  
  .submenu.active {
    display: block !important;
  }
  
  /* Arrow rotation */
  .submenu-toggle.active::after {
    transform: rotate(180deg);
  }
  
  /* Completely remove hover on mobile */
  .sidebar li:hover > .submenu {
    display: none !important;
  }
  
  /* Dark mode */
  .dark-mode aside {
    background: #1e293b;
  }
}

/* ================= ICON COLORS in BODY ================= */

.icon-purple { color: #8b5cf6; }
.icon-blue { color: #3b82f6; }
.icon-orange { color: #f97316; }
.icon-green { color: #10b981; }
.icon-cyan { color: #06b6d4; }
.icon-red { color: #ef4444; }

/* Main Content */
main {
  flex: 1;
  padding: 25px;
}

h1 {
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
}

/* ================= HOME PAGE CARDS ================= */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.card .big-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 5px;
}

.card p {
  font-size: 12px;
  color: #64748b;
}

/* ================= PDF PAGE STYLES ================= */
.pdf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

.pdf-card {
  background: white;
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pdf-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.pdf-card .icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.pdf-card h3 {
  font-size: 16px;
}

.pdf-red { color: #ef4444; }
.pdf-blue { color: #3b82f6; }
.pdf-green { color: #10b981; }
.pdf-orange { color: #f97316; }
.pdf-purple { color: #a855f7; }
.pdf-pink { color: #ec4899; }

/* Viewer Styles */
.viewer-page {
  display: none;
}

.viewer-page.active {
  display: block;
}

.viewer-top {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-bottom: 20px;
}

.viewer-top button {
  padding: 8px 20px;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
}

#closeBtn { background: #dc2626; color: white; }
#downloadBtn { background: #16a34a; color: white; }

.viewer-content iframe {
  width: 100%;
  height: 75vh;
  border-radius: 15px;
  background: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.viewer-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.viewer-controls button {
  padding: 10px 25px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
}

.no-results {
  text-align: center;
  padding: 50px;
  font-size: 18px;
  color: #64748b;
  grid-column: 1/-1;
}

/* ================= CHEATSHEET PAGE STYLES ================= */
.cheatsheet-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.cheatsheet-card {
  background: white;
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cheatsheet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.cheatsheet-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  margin-bottom: 10px;
}

.cheatsheet-card p {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  color: #334155;
}

.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 20px;
}

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination button {
  background: white;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  padding: 8px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 14px;
}

.pagination button.active {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  border-color: transparent;
  color: white;
}

.pagination button:hover:not(.active) {
  background: #f1f5f9;
  transform: translateY(-2px);
}

.page-info {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}

.viewer-image {
  text-align: center;
}

.viewer-image img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 15px;
  transition: transform 0.2s ease;
  cursor: zoom-in;
}

/* ================= TERMINAL/BLOG PAGE STYLES ================= */
.tagline {
  color: #64748b;
  margin-bottom: 30px;
  font-size: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 15px;
}

.dark-mode .tagline {
  color: #94a3b8;
  border-bottom-color: #334155;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.blog-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: 0.3s;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.blog-image {
  height: 160px;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.blog-content {
  padding: 20px;
}

.blog-date {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.blog-content h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #1e293b;
}

.blog-content p {
  font-size: 14px;
  color: #475569;
  margin-bottom: 15px;
  line-height: 1.5;
}

.read-more {
  color: #f43f5e;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dark-mode .blog-card {
  background: #1e293b;
}

.dark-mode .blog-content h3 {
  color: #e2e8f0;
}

.dark-mode .blog-content p {
  color: #cbd5e1;
}

.dark-mode .blog-date {
  color: #94a3b8;
}

/* Newsletter Banner */
.newsletter-banner {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  margin-top: 20px;
}

.newsletter-banner h3 {
  color: #1e293b;
  margin-bottom: 10px;
}

.newsletter-banner p {
  margin-bottom: 15px;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.newsletter-form input {
  padding: 12px 18px;
  border: none;
  border-radius: 40px;
  width: 260px;
  outline: none;
}

.newsletter-form button {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  border: none;
  padding: 12px 24px;
  border-radius: 40px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

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

.dark-mode .newsletter-banner {
  background: #1e293b;
}

.dark-mode .newsletter-banner h3 {
  color: #e2e8f0;
}

/* ================= CONTENT PAGES ================= */
.content-page {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.content-page h2 {
  margin: 20px 0 10px 0;
  color: #f43f5e;
}

.content-page p, .content-page ul, .content-page ol {
  margin-bottom: 15px;
  line-height: 1.6;
}

.content-page li {
  margin-bottom: 8px;
}

.content-page pre {
  background: #f1f5f9;
  padding: 15px;
  border-radius: 8px;
  margin: 10px 0;
  overflow-x: auto;
}

/* ================= FOOTER ================= */
footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.footer-section h4 {
  color: white;
  font-size: 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-section p {
  font-size: 13px;
  line-height: 1.5;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #94a3b8;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition: 0.2s;
}

.footer-section a:hover {
  color: white;
  transform: translateX(3px);
}

.footer-section a i {
  width: 18px;
}

.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-icons a {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icons a:hover {
  background: #f43f5e;
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
}

.footer-bottom .fa-heart {
  color: #f43f5e;
}

/* ================= DROPDOWN MENU STYLES ================= */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-toggle i.fa-chevron-down {
  font-size: 10px;
  margin-left: 5px;
  transition: transform 0.2s;
}

.dropdown:hover .dropdown-toggle i.fa-chevron-down {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 180px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  margin-top: 8px;
  overflow: hidden;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  transition: 0.2s;
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #f43f5e;
}

/* Dark mode dropdown */
.dark-mode .dropdown-menu {
  background: #1e293b;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.dark-mode .dropdown-item {
  color: #cbd5e1;
  border-bottom-color: #334155;
}

.dark-mode .dropdown-item:hover {
  background: #334155;
  color: #f43f5e;
}

/* Mobile Dropdown Styles */
.mobile-dropdown {
  width: 100%;
}

.mobile-dropdown-toggle {
  justify-content: space-between;
}

.mobile-dropdown-menu {
  display: none;
  width: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  margin-top: 5px;
  overflow: hidden;
}

.mobile-dropdown-menu.show {
  display: block;
}

.mobile-dropdown-item {
  padding-left: 30px !important;
  font-size: 12px !important;
}

.dark-mode .mobile-dropdown-menu {
  background: rgba(0,0,0,0.3);
}

/* Desktop styles - hide mobile dropdown menu on desktop */
@media (min-width: 769px) {
  .mobile-dropdown .mobile-dropdown-menu {
    display: none !important;
  }
}

/* ================= BACK TO TOP ================= */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 28px;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#backToTop:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 25px rgba(244,63,94,0.5);
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ================= DARK MODE ================= */
.dark-mode {
  background: linear-gradient(135deg, #020617, #0f172a);
  color: #e2e8f0;
}

.dark-mode aside {
  background: #1e293b;
  border-right-color: #334155;
}

.dark-mode .sidebar li a,
.dark-mode .submenu-toggle {
  color: #cbd5e1;
}

.dark-mode .sidebar li a:hover {
  background: #334155;
}

.dark-mode .card,
.dark-mode .pdf-card,
.dark-mode .cheatsheet-card,
.dark-mode .content-page {
  background: #1e293b;
}

.dark-mode .card p,
.dark-mode .content-page p {
  color: #94a3b8;
}

.dark-mode .cheatsheet-card p {
  color: #cbd5e1;
}

.dark-mode .pagination button {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.dark-mode .pagination button.active {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: white;
}

.dark-mode .page-info {
  color: #94a3b8;
}

.dark-mode .content-page h2 {
  color: #f43f5e;
}

.dark-mode pre {
  background: #0f172a;
  color: #e2e8f0;
}

/* ================= NOTE, WARNING, SUCCESS BOXES ================= */
.note {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  color: #1e293b;
}

.note p, .note ul, .note li, .note strong, .note code, .note span, .note div {
  color: #1e293b;
}

.warning {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  color: #1e293b;
}

.warning p, .warning ul, .warning li, .warning strong, .warning code, .warning span, .warning div {
  color: #1e293b;
}

.success {
  background: #d1fae5;
  border-left: 4px solid #10b981;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  color: #1e293b;
}

.success p, .success ul, .success li, .success strong, .success code, .success span, .success div {
  color: #1e293b;
}

/* Code blocks inside note/warning/success */
.note pre, .warning pre, .success pre {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0 0 0;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.note code, .warning code, .success code {
  color: #1e293b;
  background: transparent;
}

/* Dark mode for note/warning/success */
.dark-mode .note {
  background: #1e293b;
  border-left-color: #f59e0b;
  color: #e2e8f0;
}

.dark-mode .note p, .dark-mode .note ul, .dark-mode .note li, .dark-mode .note strong, .dark-mode .note code {
  color: #e2e8f0;
}

.dark-mode .warning {
  background: #1e293b;
  border-left-color: #ef4444;
  color: #e2e8f0;
}

.dark-mode .warning p, .dark-mode .warning ul, .dark-mode .warning li, .dark-mode .warning strong, .dark-mode .warning code {
  color: #e2e8f0;
}

.dark-mode .success {
  background: #1e293b;
  border-left-color: #10b981;
  color: #e2e8f0;
}

.dark-mode .success p, .dark-mode .success ul, .dark-mode .success li, .dark-mode .success strong, .dark-mode .success code {
  color: #e2e8f0;
}

.dark-mode .note pre, .dark-mode .warning pre, .dark-mode .success pre {
  background: #0d1117;
  color: #e2e8f0;
  border-color: #334155;
}

.dark-mode .note code, .dark-mode .warning code, .dark-mode .success code {
  color: #e2e8f0;
}

/* ================= MOBILE RESPONSIVE (GLOBAL) ================= */
@media (max-width: 768px) {
  .header-desktop {
    display: none;
  }
  .header-mobile {
    display: block;
  }
  
  .logo-img {
    height: 22px !important;
    width: auto;
  }
  
  .logo {
    font-size: 18px;
    gap: 8px;
  }
  
  .logo:hover {
    transform: scale(1.02);
  }
  
  .container {
    flex-direction: column;
  }
  
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .pdf-cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .cheatsheet-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-section ul {
    align-items: center;
  }
  
  .footer-section a {
    justify-content: center;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  .viewer-content iframe {
    height: 60vh;
  }
  
  #backToTop {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  /* Command box mobile adjustments */
  .command-box pre {
    padding: 18px 14px;
    font-size: 13px;
  }
  
  .copy-btn {
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .comparison-table {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .cheatsheet-cards {
    grid-template-columns: 1fr;
  }
  .mobile-nav-link {
    font-size: 11px;
    padding: 6px 8px;
  }
  .pagination button {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn, .mobile-nav-links, .mobile-search {
    display: none !important;
  }
}

/* ================= GLOBAL FIXES FOR ALL PAGES ================= */

/* Prevent horizontal overflow globally */
html, body {
  width: 100%;
  overflow-x: hidden;
}

/* Main content safety */
.container,
main,
.content-page,
.section {
  width: 100%;
  max-width: 100%;
}

/* Command Box */
.command-box {
  position: relative;
  background: #1e1e1e;
  border-radius: 12px;
  margin: 20px 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.command-box pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #d4d4d4;
  background: #1e1e1e;
}

.command-box code {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.2);
}

.copy-btn.copied {
  background: #10b981;
  color: white;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  display: block;
  overflow-x: auto;
}

.dark-mode .command-box pre {
  background: #0d1117;
  color: #e2e8f0;
}

.dark-mode .command-box {
  background: #0d1117;
}

/* ================= COLORED SIDEBAR ICONS ================= */

/* Parent menu icons */
.sidebar .submenu-toggle i {
  width: 28px;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.sidebar .submenu-toggle i.fa-linux { color: #3b82f6 !important; }
.sidebar .submenu-toggle i.fa-network-wired { color: #10b981 !important; }
.sidebar .submenu-toggle i.fa-wordpress { color: #0ea5e9 !important; }
.sidebar .submenu-toggle i.fa-redhat { color: #cc0000 !important; }
.sidebar .submenu-toggle i.fa-terminal { color: #10b981 !important; }

/* Home icon */
.sidebar li a i.fa-house { color: #8b5cf6 !important; }

/* Submenu icons */
.submenu li a i {
  width: 24px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  color: #64748b !important;
}

.submenu li a i.fa-centos { color: #262577 !important; }
.submenu li a i.fa-layer-group { color: #1793d1 !important; }
.submenu li a i.fa-ubuntu { color: #e95420 !important; }
.submenu li a i.fa-satellite-dish { color: #ef4444 !important; }
.submenu li a i.fa-cloud { color: #06b6d4 !important; }
.submenu li a i.fa-cloud-arrow-up { color: #0ea5e9 !important; }
.submenu li a i.fa-tower-broadcast { color: #8b5cf6 !important; }
.submenu li a i.fa-building { color: #6b7280 !important; }

/* Hover effects */
.submenu li a:hover i {
  color: #f43f5e !important;
  transform: translateX(2px);
}

.sidebar .submenu-toggle:hover i {
  transform: translateX(2px);
}

.sidebar li a:hover i {
  transform: translateX(3px);
}

/* Dark mode adjustments */
.dark-mode .submenu li a i {
  color: #94a3b8 !important;
}

.dark-mode .submenu li a:hover i {
  color: #f43f5e !important;
}
