/* Reset and base */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  min-height: 100vh;
}

/* Default sidebar layout (used by certificates.html and barf.html) */
#sidebar {
  width: 300px;
  height: 100vh;
  background: #161b22;
  padding: 2rem;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 1px solid #30363d;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Fullscreen nav variant (used by index.html via body.fullscreen) */
body.fullscreen #sidebar {
  width: 100vw;
  height: 100vh;
  background: #161b22;
  padding: 1rem;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Profile picture */
.profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #30363d; /* fallback */
  margin-bottom: 1.5rem;
  border: 2px solid #58a6ff;
  overflow: hidden;
}
body.fullscreen .profile-pic {
  width: 160px;
  height: 160px;
  border-width: 3px;
}
.profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Navigation */
nav ul {
  list-style: none;
  width: 100%;
  text-align: center;
}
body.fullscreen nav ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
nav li { margin: 0.2rem 0; }

/* Links: two visual modes (sidebar pages vs fullscreen) */
nav a {
  color: #8b949e;
  text-decoration: none;
  transition: 0.3s;
  font-weight: 600;
  padding: .5rem .75rem;
  border-radius: 8px;
  display: inline-block;
  min-width: 180px;
  text-align: center;
}
body.fullscreen nav a {
  color: #c9d1d9;
  font-weight: 700;
  padding: .75rem 1.25rem;
  min-width: 220px;
  border: 1px solid transparent;
  background: transparent;
}
nav a:hover { color: #58a6ff; }
body.fullscreen nav a:hover {
  color: #0b1115;
  background: #58a6ff;
  transform: translateY(-3px);
}

/* Subtitle helper */
.subtitle { color: #8b949e; font-weight: 600; font-size: .95rem; margin-top: .25rem; }

/* Main content (hidden for fullscreen nav) */
#main-content {
  margin-left: 300px;
  width: calc(100% - 300px);
  padding: 3rem;
  line-height: 1.6;
}
body.fullscreen #main-content { display: none; }

/* README / GitHub-like content */
#readme-container {
  max-width: 800px;
  margin: 0 auto;
  background: #0d1117;
}
#readme-container h1 { border-bottom: 1px solid #30363d; padding-bottom: 0.5rem; margin-bottom: 1rem; }
#readme-container code { background: #1f242c; padding: 0.2rem 0.4rem; border-radius: 6px; }
#readme-container pre { background: #161b22; padding: 1rem; border-radius: 6px; overflow-x: auto; margin: 1rem 0; }

/* Certificates layout */
.cert-container { max-width: 900px; margin: 0 auto; }
.cert-entry {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #23262a;
  padding-bottom: 2rem;
}
.cert-entry img {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  background: #0b1014;
  border: 1px solid #22272b;
}
/* PDF preview: render embedded PDFs with the same visual treatment as image thumbnails */
.pdf-preview {
  width: 100%;
  max-width: 420px;
  height: 260px; /* short preview height to match thumbnail feel */
  border-radius: 8px;
  background: #0b1014;
  border: 1px solid #22272b;
  overflow: hidden;
}
.cert-info { max-width: 420px; }
.cert-info h2 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  color: #78a093;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: #238636;
  color: #fff;
  padding: .65rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transition: transform .12s, background .12s;
}
.btn:hover { transform: translateY(-2px); background: #2ea043; }

/* Mobile hamburger toggle button */
.nav-toggle {
  display: none; /* hidden by default on desktop */
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: #238636;
  border: none;
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  color: #fff;
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}
.nav-toggle:hover { background: #2ea043; }
.nav-toggle:focus { outline: 2px solid #58a6ff; outline-offset: 2px; }

/* Hamburger icon */
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
  transition: 0.3s;
}

/* Responsive */
@media (max-width: 900px) {
  .cert-entry { flex-direction: column; }
  .cert-info, .cert-entry img { max-width: 100%; }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Show hamburger toggle on mobile (for all pages except index.html) */
  body:not(.fullscreen) .nav-toggle {
    display: flex;
  }
  
  /* Hide sidebar by default on mobile */
  body:not(.fullscreen) #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }
  
  /* Show sidebar when nav is open */
  body:not(.fullscreen).nav-open #sidebar {
    transform: translateX(0);
  }
  
  /* Adjust main content to full width on mobile */
  body:not(.fullscreen) #main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem;
    padding-top: 5rem; /* space for hamburger button */
  }
  
  /* Fullscreen index.html stays centered */
  body.fullscreen #sidebar {
    padding: 1rem;
  }
  
  body.fullscreen nav ul {
    gap: 0.75rem;
  }
  
  body.fullscreen nav a {
    min-width: 180px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }
  
  /* Sidebar adjustments for mobile (non-fullscreen pages only) */
  body:not(.fullscreen) #sidebar {
    width: 280px;
    padding: 1.5rem;
  }
  
  /* Overlay when nav is open */
  body:not(.fullscreen).nav-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
}
