/* Prevent theme transition/animations until initial theme is applied (avoids blink) */
html:not([data-theme-initialized]) *,
html:not([data-theme-initialized]) *::before,
html:not([data-theme-initialized]) *::after {
  transition: none !important;
  animation: none !important;
}

/* Reset & base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f8fb; /* light default */
  color: #003d66;
  transition: background-color 0.5s ease, color 0.5s ease;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* Header & Navbar */
header {
  background: #007ACC;
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  user-select: none;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
  user-select: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-left: auto;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a:focus {
  background-color: rgba(255 255 255 / 0.2);
  outline: none;
}

#darkModeToggle {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

#darkModeToggle:hover,
#darkModeToggle:focus {
  background-color: rgba(255 255 255 / 0.2);
  outline: none;
}

/* Main content */
main {
  flex: 1;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
}

/* Intro Section */
.intro-section {
  text-align: center;
  margin-bottom: 3rem;
  padding: 1rem;
  margin-top: 0; /* remove top margin */
  padding-top: 0;
}

.intro-section h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: #007ACC;
  user-select: none;
  text-shadow: 0 0 10px rgba(0,122,204,0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.intro-text {
  font-size: 1 rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeInColorShift 5s ease forwards;
  user-select: text;
  line-height: 1.5;
}

/* Categories */
.categories-section h2 {
  font-size: 2rem;
  color: #007ACC;
  margin-bottom: 1.5rem;
  user-select: none;
  text-align: center;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
  gap: 1.6rem;
}

.category-card {
  background: white;
  border-radius: 10px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: background-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: visible;
  outline-offset: 3px;
}

.category-card:focus {
  box-shadow: 0 0 0 3px #007ACC;
  outline: none;
}

.category-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #004a8a;
  user-select: none;
  transition: color 0.3s ease;
}

/* Tools list */
.tools-list {
  list-style-type: disc;
  margin-left: 1.2rem;
  margin-top: 0.4rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  color: #007ACC;
  user-select: text;
}

/* Scrollbar styling */
.tools-list::-webkit-scrollbar { width: 6px; }
.tools-list::-webkit-scrollbar-track { background: transparent; }
.tools-list::-webkit-scrollbar-thumb {
  background: rgba(0, 122, 204, 0.6);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.tools-list:hover::-webkit-scrollbar-thumb { opacity: 1; }
.tools-list::-webkit-scrollbar-thumb:hover { background: rgba(0, 122, 204, 0.9); }
.tools-list { scrollbar-width: none; }
.tools-list:hover { scrollbar-width: thin; scrollbar-color: rgba(0,122,204,0.6) transparent; }

/* Hover reveal */
.category-card:not(.malware-card):hover,
.category-card:not(.malware-card):focus {
  background-color: #e0f0ff;
  transform: translateY(-6px) translateX(4px);
  box-shadow: 0 8px 16px rgba(0,122,204,0.2);
}

.category-card:not(.malware-card):hover h3,
.category-card:not(.malware-card):focus h3 {
  color: #005baf;
}

.category-card:not(.malware-card):hover .tools-list,
.category-card:not(.malware-card):focus .tools-list {
  max-height: 200px;
  opacity: 1;
  overflow: auto;
}

.category-card:hover,
.category-card:focus {
  transform: translateY(-6px) translateX(4px);
  box-shadow: 0 8px 16px rgba(0,122,204,0.2);
}
.category-card:hover .tools-list,
.category-card:focus .tools-list {
  max-height: 200px; /* enough to fit content */
  opacity: 1;
  overflow: auto;
}
.tools-list {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}
.tools-list li {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}
.tools-list a {
  position: relative;
  z-index: 10;
}


/* Malware-specific - updated to grid like other categories */
.malware-card {
  border: 2px solid rgba(255, 64, 64, 0.6);
  box-shadow: 0 0 12px rgba(255, 64, 64, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.malware-card:hover,
.malware-card:focus {
  background-color: #ffe0e0; /* light red */
  transform: translateY(-6px) translateX(4px);
  box-shadow: 0 8px 16px rgba(255,64,64,0.2);
  border-color: rgba(255,64,64,0.9);
}

.malware-card .tools-list {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.malware-card:hover .tools-list,
.malware-card:focus .tools-list {
  max-height: 200px; /* same as other categories */
  opacity: 1;
  overflow: auto;
}

/* Animations */
@keyframes fadeInColorShift {
  0% { opacity: 0; color: #007ACC; }
  50% { opacity: 0.7; color: #005B99; }
  100% { opacity: 1; color: #007ACC; }
}
@keyframes rotateShield {
  0% { transform: rotate(-20deg); }
  100% { transform: rotate(20deg); }
}
.shield-emoji {
  display: inline-block;
  animation: rotateShield 1.5s ease-in-out infinite alternate;
}

/* Responsive */
@media (max-width: 900px) { .malware-card { min-width: 100%; } }
@media (max-width: 600px) {
  .intro-section h1 { font-size: 2rem; }
  .categories-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 0.8rem; }
}

/* Apply dark background immediately if JS toggles dark-mode */
body.dark-mode {
  background-color: #1e232e; /* match dark mode background */
  color: #ffffff; /* optional: dark mode text color */
}
body.dark-mode header { background: #004a75; }
body.dark-mode .category-card {
  background: #1e1e1e;
  box-shadow: 0 2px 10px rgba(0,0,0,0.8);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
body.dark-mode footer { background: #004a75; }
body.dark-mode .category-card {
  background: #1e1e1e;
  box-shadow: 0 2px 10px rgba(0,0,0,0.8);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
body.dark-mode .category-card:hover,
body.dark-mode .category-card:focus {
  background-color: #0a2a33;
  transform: translateY(-6px) translateX(4px);
  box-shadow: 0 0 14px rgba(0, 188, 212, 0.6),
              0 0 24px rgba(0, 188, 212, 0.4);
}
body.dark-mode .category-card:hover h3,
body.dark-mode .category-card:focus h3 {
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.8);
}
body.dark-mode .nav-links li a,
body.dark-mode #darkModeToggle,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode p,
body.dark-mode li,
body.dark-mode a { color: #ffffff !important; }

/* Neon scrollbar dark mode */
body.dark-mode .tools-list::-webkit-scrollbar-thumb {
  background: rgba(0, 188, 212, 0.7);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.35s ease-in-out, box-shadow 0.35s ease-in-out;
  box-shadow: 0 0 6px rgba(0, 188, 212, 0.4);
}
body.dark-mode .tools-list:hover::-webkit-scrollbar-thumb {
  opacity: 1;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.8);
}
body.dark-mode .tools-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 188, 212, 1);
  box-shadow: 0 0 14px rgba(0, 188, 212, 1);
}
body.dark-mode .tools-list { scrollbar-width: none; }
body.dark-mode .tools-list:hover { scrollbar-width: thin; scrollbar-color: rgba(0,188,212,0.9) transparent; }

/* Neon logo dark mode */
body.dark-mode .logo {
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.8),
               0 0 12px rgba(0, 229, 255, 0.6);
  animation: neonPulse 2.5s ease-in-out infinite;
}
body.dark-mode .shield-emoji {
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.8),
               0 0 14px rgba(0, 229, 255, 0.7);
  animation: rotateShield 1.5s ease-in-out infinite alternate,
             neonPulse 2.5s ease-in-out infinite;
}
@keyframes neonPulse {
  0%,100% {
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.8),
                 0 0 12px rgba(0, 229, 255, 0.6);
  }
  50% {
    text-shadow: 0 0 10px rgba(0, 229, 255, 1),
                 0 0 20px rgba(0, 229, 255, 0.9),
                 0 0 30px rgba(0, 229, 255, 0.7);
  }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1rem 0;
  background: #007ACC;
  color: white;
  font-size: 0.9rem;
  margin-top: auto;
  width: 100%;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-inner .copyright {
  margin: 0;
  font-size: 0.9rem;
  color: white;
}

/* Floating contact icons - desktop and responsive */
.floating-contacts {
  position: fixed;
  right: 18px;
  bottom: 88px;
  display: flex;
  flex-direction: column; /* vertical stack on desktop */
  gap: 0.6rem;
  align-items: center;
  z-index: 9999;
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #007ACC;
  color: white;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.contact-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.contact-icon:hover,
.contact-icon:focus {
  color: rgb(109, 193, 242);
  background: rgba(255,255,255,0.12);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Dark mode adjustments */
body.dark-mode .contact-icon {
  color: #ffffff;
  background: #004a75;
}
body.dark-mode .contact-icon:hover,
body.dark-mode .contact-icon:focus {
  color: #00e5ff;
  background: rgba(0,229,255,0.1);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0,229,255,0.4);
}

/* Extra small screens - shrink contact icons */
@media (max-width: 400px) {
  .floating-contacts {
    gap: 0.3rem;
    bottom: 15px;
  }
  .contact-icon {
    width: 36px;
    height: 36px;
  }
  .contact-icon svg {
    width: 16px;
    height: 16px;
  }
}


.category {
  max-height: 300px; 
  overflow-y: auto;
}

/* Hamburger menu button - hidden on desktop */
#hamburger {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

/* Small screens - show hamburger and hide nav links */
@media (max-width: 900px) {
  #hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 1rem;
    background-color: #007ACC;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    padding: 1rem;
    border-radius: 0 0 8px 8px;
  }

  /* Show nav-links when active */
  .nav-links.show {
    display: flex;
  }
}
/* Dark mode hover for malware card */
body.dark-mode .malware-card:hover,
body.dark-mode .malware-card:focus {
  background-color: #330000; /* dark red shade for malware */
  transform: translateY(-6px) translateX(4px);
  box-shadow: 0 8px 16px rgba(255,64,64,0.4);
  border-color: rgba(255,64,64,0.9);
}

/* Dark mode animation */
@keyframes waveGlowDark {
  0%   { transform: scale(1); box-shadow: 0 0 2px rgba(0,229,255,0.3); }
  50%  { transform: scale(1.05); box-shadow: 0 0 8px rgba(0,229,255,0.6); }
  100% { transform: scale(1); box-shadow: 0 0 2px rgba(0,229,255,0.3); }
}

/* Responsive (phones & tablets) */
@media (max-width: 900px) {
  .announcement-inner { padding-right: 0.5rem; }
}

@media (max-width: 600px) {
  .announcement { justify-content: center; }
  .announcement-inner { justify-content: center; padding-right: 0; }
  .announcement-banner {
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
  }
}

/* Announcement Wrapper */
.announcement-wrapper {
  display: flex;
  justify-content: flex-end; /* Align right */
  padding: 20px; /* Same as header/footer section spacing */
  margin-bottom: 0; /* make sure the bottom margin is gone */
  padding-bottom: 0;
}

/* Announcement box */
.announcement {
  background: #007ACC; /* Match header light mode */
  color: white;
  padding: 5px 12px; /* Smaller padding */
  border-radius: 6px; /* Slightly smaller corners */
  font-weight: bold;
  font-size: 0.85rem; /* Smaller text */
  text-align: center;
  animation: gentleFloat 2.5s infinite ease-in-out; /* Faster bounce */
}

/* Dark mode */
body.dark-mode .announcement {
  background: #004a75; /* Match header dark mode */
}

/* Bouncing animation */
@keyframes gentleFloat {
  0%   { transform: translateY(0); }
  25%  { transform: translateY(-4px); }
  50%  { transform: translateY(0); }
  75%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

/* *************************************************** ABOUT ***************************************************  */
/* About Page Main Content */
.main-about {
  width: 100%;                     /* Fill the whole page width */
  margin: 0;                        /* Remove auto centering */
  padding: 2rem;                    /* Page padding */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-sizing: border-box;           /* Include padding in width */
}

/* About Content Box */
.about-content {
  width: 100%;                      /* Fill parent width */
  padding: 2rem;
  border: 2px solid #007ACC;        /* Blue border in light mode */
  border-radius: 10px;
  line-height: 1.8;
  font-size: 1rem;
  font-weight: 600;                 /* Bold text */
  color: #003d66;
  position: relative;
  animation: fadeInColorShift 4s ease forwards;
  transition: all 0.4s ease;
  box-sizing: border-box;
}

/* Headings */
.about-content h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #007ACC;
  font-weight: 700;                 /* Bold headings */
}

.about-content h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #004a8a;
  font-weight: 700;                 /* Bold subheadings */
}

/* Paragraph spacing */
.about-content p {
  margin-bottom: 1.5rem;
  font-weight: 600;                 /* Bold paragraph text */
}

/* Expertise & Experience list */
.about-content ul {
  list-style-type: disc;
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.about-content ul li {
  margin-bottom: 0.7rem;
  padding-left: 0.3rem;
  font-weight: 600;                 /* Bold list items */
}

/* Light mode border glow animation */
@keyframes fadeInColorShift {
  0% { opacity: 0; color: #007ACC; }
  50% { opacity: 0.7; color: #005B99; }
  100% { opacity: 1; color: #007ACC; }
}

/* Dark Mode */
body.dark-mode .about-content {
  background-color: #121212;
  color: #ffffff;                    /* Text readable */
  border: 2px solid #00e5ff;        /* Neon blue border */
  box-shadow: 0 6px 20px rgba(0,229,255,0.2);
  font-weight: 600;                  /* Bold text */
  animation: neonBorder 2.5s ease-in-out infinite alternate;
}

/* Dark mode headings */
body.dark-mode .about-content h2,
body.dark-mode .about-content h3 {
  color: #00e5ff;
}

/* Dark mode list items */
body.dark-mode .about-content ul li {
  color: #ffffff;
}

/* Animated neon border effect for dark mode */
@keyframes neonBorder {
  0%, 100% { box-shadow: 0 0 10px rgba(0,229,255,0.6), 0 0 20px rgba(0,229,255,0.4); }
  50%      { box-shadow: 0 0 20px rgba(0,229,255,0.9), 0 0 30px rgba(0,229,255,0.6); }
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.resource-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.resource-grid a:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.resource-grid img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}
.books-row {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: nowrap; /* keeps them in one row */
  overflow-x: auto;  /* allows scrolling if too many */
  padding-bottom: 10px;
}

.books-row a {
  flex: 0 0 auto;
}

.books-row img {
  width: 100px;   /* adjust size */
  height: 140px;  /* like a book cover */
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.books-row img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ============================================== Cheat sheet page ============================================== */

/* Unique classes prefixed with tg- */
.tg-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
}

.tg-resource-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.tg-resource-card:hover {
  transform: scale(1.05);
}

.tg-resource-img {
  width: 100%;
  height: 250px; /* increased height */
  object-fit: cover; /* ensures the image fills the area without distortion */
  display: block;
  border-radius: 12px;
}


.tg-resource-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-weight: bold;
  transition: opacity 0.3s ease;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.tg-resource-card:hover .tg-resource-caption {
  opacity: 1;
  visibility: visible;
}
.tg-hover-instruction {
  text-align: center;
  font-size: 2.1rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: #003d66; /* matches your theme */
}

/* Light mode */
.nav-link {
  text-decoration: none;
  color: rgb(43, 118, 217); /* classic link blue */
}

.nav-link:hover {
  color: #80b3ff; /* hover color in light mode */
  text-decoration: underline; /* underline on hover */
}

/* Dark mode */
body.dark-mode .nav-link,
body.dark-mode .tools-list .nav-link {
  text-decoration: none;
  color: white !important; /* default color in dark mode */
}

body.dark-mode .nav-link:hover,
body.dark-mode .tools-list .nav-link:hover {
  color: #80b3ff !important; /* hover color in dark mode */
  text-decoration: underline; /* underline on hover */
}

/* Mobile/touch fix: make lists always expanded on devices without hover */
@media (hover: none) {
  .category-card:hover,
  .category-card:focus {
    transform: none;
    box-shadow: none;
    background-color: inherit;
  }








