/* =====================
   Sidebar Navigation - Base Styles (PC/Desktop)
   ===================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 230px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  min-height: 100vh;
  box-shadow: 1px 0 0 0 rgba(0,0,0,0.05);
  padding-top: 60px;
  transition: width 0.3s, transform 0.3s;
}

.sidebar-top {
  margin-bottom: 30px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  margin-bottom: 16px;
}

.logo-sphere {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px 0 rgba(50, 50, 93, 0.08);
  margin-bottom: 8px;
  background: #23272a;
}

.logo-sphere video, .logo-sphere img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-text {
  font-size: 1.31rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  color: #fff;
}

.nav {
  width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  height: 60vh;
  gap: 8px;
  padding: 0;
  transform: translateY(-10%);
}

.nav-link {
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif !important;
  font-size: 1.08rem;
  font-weight: 600;
  color: #fff;
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
  letter-spacing: 0.01em;
  line-height: 1.7;
  transition: color 0.18s, background 0.18s;
  box-shadow: none;
  text-align: left;
  width: auto;
  display: block;
  opacity: 0.85;
}

.nav-link:not(:last-child) {
  margin-bottom: 4px;
}

.nav-link.active,
.nav-link:hover,
.nav-link:focus {
  color: var(--accent);
  background: none;
  text-shadow: none;
  opacity: 1;
}

/* Sidebar bottom section */
.sidebar-bottom {
  margin-top: auto;
  margin-bottom: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cv-btn {
  color: var(--accent);
  font-size: 0.97rem;
  font-weight: 400;
  margin-top: 8px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition);
}
.cv-btn:hover { color: #72ffb4; }


/* Hamburger menu - hidden on PC by default */
.hamburger {
  display: none;
  position: fixed;
  top: 22px;
  left: 18px;
  z-index: 999;
  background: none;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: #fff;
  background-color: var(--accent);
  border-radius: 2px;
  transition: 0.22s;
}

.sidebar.open ~ #sidebar-toggle span,
#sidebar-toggle[aria-expanded="true"] span {
  background-color: #fff;
}


/* =====================
   Tablet Styles (max-width: 1100px)
   ===================== */
@media (max-width: 1100px) {
  .sidebar {
    width: 180px;
    min-width: 180px;
    padding-top: 36px;
  }
  .logo-sphere {
    width: 70px;
    height: 70px;
  }
  .logo-text {
    font-size: 1.05rem;
  }
  .nav {
    width: 100%;
    gap: 5px;
  }
  .nav-link {
    font-size: 0.95rem;
  }
}

/* =====================
   Mobile/Tablet Compact Sidebar (max-width: 800px)
   ===================== */
@media (max-width: 800px) {
  /* Hamburger is now visible */
  .hamburger {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 28px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    background: none;
    
    border: none;
  }
  .hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    background-color: var(--accent);
    border-radius: 2px;
  }

  /* Sidebar is hidden by default (slides out) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    min-width: 220px;
    max-width: 80vw;
    height: 100vh;
    background-color: #1e1e1e;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    padding-top: 40px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.16);
  }

  /* Sidebar is visible when .open is added (JS toggles this) */
  .sidebar.open {
    transform: translateX(0);
  }

  .logo-sphere {
    width: 40px;
    height: 40px;
  }
  .logo-text { display: none; }
  .nav {
    width: 100%;
    gap: 3px;
    transform: none;
  }
  .nav-link {
    font-size: 0.9rem;
    text-align: center;
    padding: 4px 0;
  }

  /* Optional: dark overlay/backdrop */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 900;
    transition: opacity 0.3s ease-in-out;
  }
  .sidebar-backdrop.hidden {
    display: none;
  }

  #sidebar-toggle {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 3000 !important;    /* ← Make sure it's above sidebar & backdrop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    pointer-events: auto !important; /* ← Always clickable */
  }

.sidebar,
.sidebar-backdrop {
  z-index: 1000;
}

#sidebar-toggle span {
    display: block;
    width: 24px;
    height: 4px;
    margin: 3px 0;
    background-color: var(--accent);
    border-radius: 2.5px;
    transition: background 0.2s;
    box-shadow: none;
  }

  #sidebar-toggle[aria-expanded="true"] span {
    background-color: #fff;
  }
   .sidebar {
    z-index: 2000;
  }
   .sidebar-backdrop {
    z-index: 1500;
  }

#sidebar-toggle[aria-expanded="true"] span {
  background-color: #fff; /* Optional: white when open, or keep green if you prefer */
}
}

/* =====================
   Extra Mobile Adjustments (max-width: 600px)
   ===================== */
@media (max-width: 600px) {
  .sidebar {
    width: 95vw !important;
    min-width: 95vw !important;
    max-width: 100vw !important;
    padding-top: 30px;
  }
  main {
    margin-left: 0 !important;
  }
}

/* =====================
   Ultra Mobile - Further Tweaks (max-width: 400px)
   ===================== */
@media (max-width: 400px) {
  .sidebar {
    width: 100vw !important;
    min-width: 100vw !important;
    padding-top: 18px;
  }
}
