/* OpenSecurityWiki Style System - Cyber Theme */
@font-face {
  font-family: "Kimberley";
  src: url("../fonts/Kimberley Bl.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg-color: #050505;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;

  /* Default Theme (Green) */
  --accent-primary: #20fa36;
  --accent-secondary: #02651a;

  --accent-alert: #ff0055;
  --glass-bg: rgba(20, 20, 20, 0.7);
  --glass-border: rgba(32, 250, 54, 0.2); /* Using Green Primary */
  --font-mono: "Consolas", "Monaco", "Courier New", monospace;
  --font-sans: "Kimberley", "Inter", system-ui, -apple-system, sans-serif; /* Applied here */

  --header-height: 200px; /* Fallback, updated by JS */
}

/* Blue Theme */
body.theme-blue {
    --accent-primary: #1fbaff;
    --accent-secondary: #003f74;
    --glass-border: rgba(31, 186, 255, 0.3);
}

/* Red Theme */
body.theme-red {
    --accent-primary: #fa2420;
    --accent-secondary: #651202;
    --glass-border: rgba(250, 36, 32, 0.3);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: Arial, sans-serif; /* Global font updated to Arial */
  line-height: 1.6;
  overflow-x: hidden;
  background-image: linear-gradient(color-mix(in srgb, var(--accent-primary) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent-primary) 8%, transparent) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: grid-scroll 20s linear infinite;
}

/* Animations */
@keyframes grid-scroll {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 30px 30px;
  }
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--accent-primary);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height); /* Adjusted for dynamic header */
}

/* Top Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto; /* Allow content to define height */
  background: var(--bg-color); /* Solid background to hide grid */
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left align */
  justify-content: center;
  padding: 1rem 2rem 0 2rem; /* Remove bottom padding */
}

/* Language Selector */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1001;
}

.lang-flag {
  width: 30px;
  height: auto;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  border-radius: 4px; /* Optional rounded corners */
  filter: grayscale(0.5); /* Dim inactive */
}

.lang-flag:hover,
.lang-flag.active {
  transform: scale(1.1);
  filter: grayscale(0);
}

/* Branding & Menu */
.brand-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brand-isologo {
  width: 90px; /* Increased size further */
  height: auto;
  transition: transform 0.3s ease;
}

/* Hover effect removed as requested */

.brand-logotype {
  width: 280px; /* Increased size further */
  height: auto;
  opacity: 0.9;
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1100;
  transition: all 0.3s ease;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--accent-primary);
  margin: 5px 0;
  box-shadow: 0 0 5px var(--accent-primary);
}

.menu-toggle:hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

/* Text Menu */
.main-nav {
  display: flex;
  justify-content: center; /* Centered menu */
  gap: 2.5rem;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
  position: relative;
  font-weight: bold;
}

.nav-link:hover {
  color: var(--accent-primary);
  text-shadow: 0 0 8px color-mix(in srgb, var(--accent-primary) 40%, transparent);
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-primary);
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-color);
  border-right: 1px solid var(--glass-border);
  padding: 2rem 1.5rem;
  position: fixed;
  top: var(--header-height); /* Matches new header height */
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  z-index: 100;
}

.sidebar nav ul {
  list-style: none;
  padding-left: 0;
}

.sidebar nav ul li {
  margin-bottom: 0.5rem;
  position: relative;
}

/* Accordion Logic Styles */
li.has-submenu > ul {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease;
  opacity: 0;
  padding-left: 1rem; /* Indent sub items */
}

li.has-submenu.expanded > ul {
  max-height: 500px; /* Arbitrary large height */
  opacity: 1;
  margin-top: 0.5rem;
}

.category-header {
  cursor: pointer;
  display: block;
  padding: 0.5rem;
  color: var(--text-secondary);
  font-weight: bold;
  transition: color 0.2s;
  user-select: none;
  position: relative;
}

.category-header:hover,
li.has-submenu.expanded > .category-header {
  color: var(--accent-primary);
}

.category-header::after {
  content: "+";
  position: absolute;
  right: 10px;
  font-size: 0.8em;
  transition: transform 0.3s;
}

li.has-submenu.expanded > .category-header::after {
  transform: rotate(45deg); /* Turns to x roughly, or just indicates open */
  content: "-";
}

/* Regular Links */
.sidebar nav ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 5%, transparent);
  border-left-color: var(--accent-primary);
  padding-left: 1rem;
  text-shadow: 0 0 5px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

/* Main Content */
.main-content {
  margin-left: 280px; /* Sidebar width */
  flex: 1;
  padding: 3rem 4rem;
  /* max-width removed to allow flex centering */
  animation: fade-in 0.5s ease-out;
}

/* Typography styles inside markdown */
.markdown-body {
  color: var(--text-primary);
  max-width: 1000px;
  margin: 0 auto; /* Center the content block */
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  /* font-family: var(--font-mono); Removed to inherit or override */
  position: relative;
  display: inline-block;
  font-weight: normal; /* Force thinner weight */
}

.markdown-body h1 {
  font-family: "Kimberley", sans-serif; /* Title font */
}

.markdown-body h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

.markdown-body h1::after {
  content: "_";
  color: var(--accent-primary);
  animation: blink-caret 1s step-end infinite;
  margin-left: 5px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.markdown-body pre {
  background: #000;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
}

.markdown-body pre::before {
  content: "root@wiki:~#";
  position: absolute;
  top: 5px;
  right: 10px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  opacity: 0.5;
}

.markdown-body code {
  font-family: "Fira Code", var(--font-mono);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-primary);
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.95rem;
}

.markdown-body a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-primary);
  transition: all 0.2s;
}

.markdown-body a:hover {
  background: var(--accent-primary);
  color: #000;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.markdown-body blockquote {
  border: 1px solid var(--accent-primary);
  border-left: 4px solid var(--accent-primary);
  background: rgba(0, 20, 0, 0.8); /* Darker, more opaque */
  padding: 1rem 1.5rem;
  border-radius: 4px;
  color: var(--text-primary);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-primary) 10%, transparent);
  margin: 1.5rem 0;
  font-style: normal; /* Remove italic */
  position: relative;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body blockquote::before {
  content: "!";
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent-primary);
  color: #000;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-weight: bold;
  font-size: 0.8rem;
  box-shadow: 0 0 5px var(--accent-primary);
}

/* Glass Cards */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent-primary) 30%, transparent);
  border-color: var(--accent-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #050505;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-primary) 30%, transparent);
  border: 1px solid var(--bg-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .app-header {
    align-items: center;
    padding-top: 1rem;
  }

  .brand-container {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 2rem; /* Clear toggle */
  }

  .brand-logotype {
    width: 200px;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 85%;
    max-width: 320px;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.8);
  }

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

  .main-content {
    margin-left: 0;
    padding: 2rem 1rem;
    width: 100%;
  }
}

/* Team Portfolio Styles */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.profile-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 2px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
}

.profile-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.profile-content {
  padding: 1.5rem;
  text-align: center;
}

.profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: #111;
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent-primary);
  overflow: hidden;
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  color: var(--accent-primary);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.profile-role {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-bio {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-btn {
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.social-btn:hover {
  background: var(--accent-primary);
  color: #000;
  border-color: var(--accent-primary);
}

/* Page Banner Utility */
.page-banner {
  width: 100%;
  max-width: 450px;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent-primary) 10%, transparent);
}
