/* ════════════════════════════════════════════════
   SHARED GLOBAL ASSETS — sidebar.css
   Floating Toggle Button & Collapsible Drawer Sidebar
   ════════════════════════════════════════════════ */

/* Clean body paddings - the floating button is overlay-based */
body {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-bottom: 0 !important;
}

body.sidebar-active {
  overflow: hidden !important;
}

/* ─── 1. Floating Toggle Button ─── */
.floating-toggle-btn {
  position: fixed;
  left: 0;
  top: 28px;
  width: 24px;
  height: 36px;
  background: rgba(10, 12, 28, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  border-radius: 0 6px 6px 0;
  color: var(--diamond, #6ee7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001; /* Must sit higher than sidebar to remain visible while sliding */
  outline: none;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.2s ease, 
              background-color 0.2s ease;
}

.floating-toggle-btn:hover {
  background: rgba(92, 232, 255, 0.08);
  border-color: var(--diamond, #6ee7ff);
}

.floating-toggle-btn .toggle-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hidden state when drawer opens */
.floating-toggle-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-15px);
}

/* ─── 2. Drawer Sidebar ─── */
.sidebar-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  z-index: 10000;
  background: linear-gradient(180deg, rgba(8, 10, 24, 0.98) 0%, rgba(4, 6, 16, 0.99) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  gap: 24px;
  box-sizing: border-box;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Brand header */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.sidebar-brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Inner sidebar close button */
.sidebar-close-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm, 4px);
  color: var(--text-dim, #7880a8);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  padding: 0;
}
.sidebar-close-btn:hover {
  color: var(--danger, #ff5f5f);
  border-color: rgba(255, 95, 109, 0.25);
  background: rgba(255, 95, 109, 0.08);
  box-shadow: 0 0 8px rgba(255, 95, 109, 0.15);
}
.sidebar-close-btn svg {
  width: 14px;
  height: 14px;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 4px var(--arcane-glow, rgba(157, 111, 255, 0.4)));
}

.sidebar-title {
  font-family: var(--font-display, 'Minecraft', 'VT323', monospace);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 #000;
}

/* Menu list */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-item {
  width: 100%;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md, 6px);
  color: var(--text-muted, #a6b0cf);
  text-decoration: none;
  font-family: var(--font-ui, sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.sidebar-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-icon-wrap {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim, #7880a8);
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.sidebar-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.sidebar-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-dim, #7880a8);
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

/* Link Hover Actions */
.sidebar-link:hover {
  color: var(--text-primary, #ffffff);
  background: rgba(92, 232, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.04);
}
.sidebar-link:hover .sidebar-icon-wrap {
  color: var(--diamond, #6ee7ff);
  transform: scale(1.08);
}
.sidebar-link:hover .sidebar-chevron {
  opacity: 0.85;
  transform: translateX(3px);
  color: var(--diamond, #6ee7ff);
}

/* Active Highlight */
.sidebar-link.active {
  color: var(--diamond, #6ee7ff);
  background: rgba(92, 232, 255, 0.08);
  border: 1px solid rgba(92, 232, 255, 0.2);
}
.sidebar-link.active .sidebar-icon-wrap {
  color: var(--diamond, #6ee7ff);
}
.sidebar-link.active .sidebar-chevron {
  color: var(--diamond, #6ee7ff);
  opacity: 0.85;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--diamond, #6ee7ff);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--diamond, #6ee7ff);
}

/* ─── 3. Bottom Links Group (Discord, Donate) ─── */
.sidebar-bottom-group {
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link--bottom {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-link--bottom:hover {
  background: rgba(92, 232, 255, 0.08);
  border-color: rgba(92, 232, 255, 0.15);
}

/* ─── 4. Backdrop Overlay ─── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Custom styles for Donate Close button */
.disclaimer-btn--cancel {
  border-style: solid;
}
.disclaimer-btn--cancel:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

/* ══════════════════════════════════════════════════════════════
   MINECRAFT THEME — Sidebar Overrides
   ══════════════════════════════════════════════════════════════ */

/* ─── Floating Toggle Button ─── */
body.theme-minecraft .floating-toggle-btn {
  background: #3c3c3c;
  border: 2px solid #555;
  border-left: none;
  border-radius: 0 3px 3px 0;
  box-shadow: 2px 0 0 #000, 4px 0 8px rgba(0,0,0,0.6);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #55ff55;
}
body.theme-minecraft .floating-toggle-btn:hover {
  background: #555;
  border-color: #aaaaff;
  color: #aaaaff;
}

/* ─── Sidebar Panel ─── */
body.theme-minecraft .sidebar-nav {
  background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  border-right: 3px solid #555;
  box-shadow: 4px 0 0 #000, 8px 0 16px rgba(0,0,0,0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ─── Brand Header ─── */
body.theme-minecraft .sidebar-brand {
  border-bottom: 2px dashed #3c3c3c;
}
body.theme-minecraft .sidebar-title {
  font-family: 'Minecraft', 'VT323', monospace;
  color: #ffff55;
  text-shadow: 2px 2px 0 #3f3f00;
  letter-spacing: 0.08em;
}
body.theme-minecraft .sidebar-logo-img {
  filter: drop-shadow(0 0 6px rgba(255,170,0,0.7));
}

/* ─── Close button ─── */
body.theme-minecraft .sidebar-close-btn {
  color: #aaaaaa;
  border: 1px solid #555;
  border-radius: 0;
  background: #3c3c3c;
  box-shadow: inset 1px 1px 0 #6b6b6b, inset -1px -1px 0 #000;
}
body.theme-minecraft .sidebar-close-btn:hover {
  color: #ff5555;
  border-color: #ff5555;
  background: #3c3c3c;
  box-shadow: inset 1px 1px 0 #6b6b6b, inset -1px -1px 0 #000, 0 0 8px rgba(255,85,85,0.3);
}

/* ─── Menu Links ─── */
body.theme-minecraft .sidebar-link {
  font-family: 'Minecraft', 'VT323', monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #aaaaaa;
  border-radius: 0;
  border: 1px solid transparent;
}
body.theme-minecraft .sidebar-link:hover {
  color: #ffffff;
  background: #2d2d2d;
  border-color: #555;
}
body.theme-minecraft .sidebar-link:hover .sidebar-icon-wrap {
  color: #55ff55;
  transform: scale(1.05);
}
body.theme-minecraft .sidebar-link:hover .sidebar-chevron {
  color: #55ff55;
  opacity: 1;
}
body.theme-minecraft .sidebar-icon-wrap {
  color: #555555;
}
body.theme-minecraft .sidebar-chevron {
  color: #555555;
}

/* ─── Active Link ─── */
body.theme-minecraft .sidebar-link.active {
  color: #ffff55;
  background: #2d2d2d;
  border: 1px solid #555;
  box-shadow: inset 1px 1px 0 #3c3c3c;
}
body.theme-minecraft .sidebar-link.active .sidebar-icon-wrap {
  color: #55ff55;
}
body.theme-minecraft .sidebar-link.active .sidebar-chevron {
  color: #55ff55;
  opacity: 1;
}
body.theme-minecraft .sidebar-link.active::before {
  background: #55ff55;
  border-radius: 0;
  box-shadow: 0 0 6px #55ff55;
}

/* ─── Bottom group separator ─── */
body.theme-minecraft .sidebar-bottom-group {
  border-top: 2px dashed #3c3c3c;
}
body.theme-minecraft .sidebar-link--bottom {
  background: #1a1a1a;
  border: 1px solid #3c3c3c;
  border-radius: 0;
}
body.theme-minecraft .sidebar-link--bottom:hover {
  background: #2d2d2d;
  border-color: #55ff55;
}

/* ─── Backdrop ─── */
body.theme-minecraft .sidebar-backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
