
:root{
  --bg:#0b0d10;
  --panel:#0f1418;
  --muted:#9aa3a8;
  --accent:#64a9ff;
  --accent2:#b85fef;
  --card:#0f1215;
  --card-contrast: rgba(255,255,255,0.03);
  --whitepanel:#f7f9fb;
  --trans:0.26s;
}

/* base */
html,body{height:100%}
body{
  background:var(--bg);
  color:#e6eef2;
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial;
  margin:0;
  padding:18px;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* cards and panels */
.card-dark{
  background:var(--card);
  border:1px solid var(--card-contrast);
  border-radius:10px;
}
.white-panel{
  background:var(--whitepanel);
  color:#0b0d10;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.05);
}
.muted{color:var(--muted); font-size:0.95rem;}

/* header */
.hero {
  height:150px;
  border-radius:.75rem;
  background-image: url('https://i.imgur.com/k5wrBWD.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1000px rgba(0,0,0,0.12);
}
h1.site-title{font-size:1.25rem; letter-spacing:1px; margin:0; color:#eaf6ff}
.subtitle { color:var(--muted); margin-top:10px; }

/* TABBED SIDEBAR NAVIGATION SYSTEM */
.sidebar-nav {
  position: sticky;
  top: 70px;
}

.sidebar .nav-section {
  margin-bottom: 8px;
}

/* Main sector tabs */
.sidebar .sector-tab {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 6px;
  transition: background var(--trans), color var(--trans);
  text-decoration: none;
  display: block;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.sidebar .sector-tab:hover {
  background: rgba(100,169,255,0.06);
  color: #fff;
}

.sidebar .sector-tab.active {
  background: rgba(100,169,255,0.12);
  color: #fff;
  font-weight: 500;
}

/* Demon sub-tabs container */
.demon-subtabs {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

/* When sector is expanded, show demon tabs */
.sector-tab.active + .demon-subtabs {
  max-height: 2000px; /* Increased from 500px to accommodate many items */
  transition: max-height 0.4s ease-in;
}

/* Individual demon sub-tabs */
.demon-tab {
  color: var(--muted);
  padding: 7px 14px 7px 28px;
  border-radius: 4px;
  transition: background var(--trans), color var(--trans);
  text-decoration: none;
  display: block;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 4px;
}

.demon-tab:hover {
  background: rgba(100,169,255,0.05);
  color: #e6eef2;
}

.demon-tab.active {
  background: rgba(100,169,255,0.1);
  color: var(--accent);
  font-weight: 500;
}

/* Info box under sidebar title */
.sidebar-info-box {
  background: rgba(255,255,255,0.02);
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.03);
}

/* central images & helpers */
.center-img{max-width:100%; border-radius:8px; border:1px solid rgba(255,255,255,0.03); display:block;}
.panel-title{font-weight:600; margin-bottom:6px; color:#eaf6ff;}
.small-box{background:rgba(255,255,255,0.02); padding:10px; border-radius:6px; font-size:0.95rem;}

/* scrollable boxes */
.scrollable-box {
  overflow-y:auto;
  overflow-x:hidden;
}
.scrollable-box::-webkit-scrollbar {
  width: 6px;
}
.scrollable-box::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius:10px;
}
.scrollable-box::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius:10px;
}
.scrollable-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* glance box */
.glance-box{
  background: rgba(255,255,255,0.02);
  border:1px solid rgba(255,255,255,0.04);
  padding:14px;
  border-radius:8px;
  color:#dfe7ea;
  font-size:12px;
  height:100%;
}
.glance-item{
  margin-bottom:12px;
}
.glance-label{
  color:var(--muted);
  margin-bottom:6px;
}
.glance-value{
  color:#ffffff;
  padding-left:12px;
}

/* container */
.demon-image-container{
  width:100%;
  height:280px;
  position:relative;
  overflow:hidden;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.05);
  margin:0 0 16px;
  background:rgba(0,0,0,0.2);
}

/* BASE image rules — centered and scaleable via variables */
.demon-image{
  position:absolute;
  left: var(--x, 50%);         /* center by default */
  top:  var(--y, 50%);         /* center by default */
  transform-origin: center center;
  /* translate centers element, then apply fine pixel offset and scale */
  transform:
    translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px)))
    scale(var(--zoom, 0.55));
  transition: transform 0.18s ease, opacity 0.18s;
  max-width: none;   /* allow the image to be larger than container if desired */
  height: auto;
  width: auto;
}

.demon-image:hover{
  opacity:0.85;
}


/* progress bars */
.stat-row{
  margin-bottom:8px;
}
.stat-label{
  font-size:11px;
  color:var(--muted);
  margin-bottom:3px;
}
.progress { 
  height:6px; 
  border-radius:999px; 
  background: rgba(255,255,255,0.05); 
}
.progress-bar{ 
  background: linear-gradient(90deg, var(--accent), #9fd6ff); 
}

/* text boxes */
.update-box,
.diagnosis-box,
.abilities-box,
.notes-box{
  border-radius:8px;
  padding:12px !important;
  background: rgba(255,255,255,0.01);
  border:1px solid rgba(255,255,255,0.03);
  color:#dfe7ea;
  font-size:13px;
}

.abilities-box{
  flex:0 0 300px;
}

.update-box{
  flex:0 0 250px;
}

.notes-box{
  flex:1 1 auto;
  min-height:0;
}


.diagnosis-box,
.notes-box{
  flex:1 1 auto;
  min-height:0;
}

.box-title{
  color:var(--muted);
  font-size:12px;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:0.5px;
}


/* character block */
.character-block{ 
  background: rgba(255,255,255,0.01); 
  border-radius:8px; 
  padding:16px; 
  margin-bottom:14px; 
  border:1px solid rgba(255,255,255,0.03); 
}
.character-name{
  font-size:1.15rem;
  font-weight:600;
  color:#eaf6ff;
}

/* hunters grid */
.hunters img{ 
  width:100%; 
  aspect-ratio:1/1; 
  object-fit:cover; 
  border-radius:6px; 
  border:1px solid rgba(255,255,255,0.03); 
  display:block;
  transition:opacity 0.2s;
}
.hunters img:hover{
  opacity:0.85;
}

/* force Bootstrap's text-muted to use your theme variable */
.text-muted {
  color: var(--muted) !important;
}

/* semi-transparent soft-grey button background */
.link-button {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(2px);
  border-radius: .5rem;
  padding: 4px 6px;
  font-size: 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

/* anchors inside */
.link-button a {
  text-decoration: none;
  color: rgba(235, 235, 235, 0.95);
  padding: 3px 4px;
  display: block;
  letter-spacing: 1.5px;
  opacity: 0.85;
}

.link-button a:hover {
  opacity: 1;
}

.left-panel-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Content switching - hide all content by default */
.content-section {
  display: none;
}

/* Show active content */
.content-section.active {
  display: block;
}

/* Sector overview  */
.sector-overview {
  display: flex;
  gap: 1.5rem;
  align-items: start;
  flex-wrap: wrap;
}

.sector-overview img {
  width: 360px;
  height: 220px;
  object-fit: cover;
}

/* responsive */
@media(max-width:992px){
  .sector-overview img {
    width: 100%;
    height: auto;
  }
}


/* Universal tooltip styling */
.tooltip-universal {
  position: absolute;
  z-index: 30000;
  max-width: 300px;
  padding: 8px 10px;
  font-size: 0.9rem;
  line-height: 1.3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  background: linear-gradient(180deg, rgba(18,22,26,0.98), rgba(12,14,16,0.98));
  color: #e6eef2;
  pointer-events: none;        /* don't block mouse events */
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  visibility: hidden;
  padding-right: 12px;
}

/* visible state */
.tooltip-universal.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* small arrow (positioned for top by default) */
.tooltip-universal::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
  left: calc(50% - 5px);
  bottom: -5px; /* arrow below tooltip (when tooltip is above target) */
  box-shadow: -2px 2px 6px rgba(0,0,0,0.25);
}

/* arrow when tooltip placed below target */
.tooltip-universal[data-placement="bottom"]::after {
  top: -5px;
  bottom: auto;
}

/* visual hint on hovered labels */
.tooltip-target-hint {
  cursor: help;
  outline: none; /* we'll keep focus styles available when focused */
}

/* Focus visible for keyboard users */
.tooltip-target-hint:focus {
  box-shadow: 0 0 0 3px rgba(100,169,255,0.12);
  border-radius: 3px;
}





/* ========================================================
   SCROLLABLE NAVIGATION SIDEBAR
   Add this to your existing CSS in the <style> section
   ======================================================== */

/* Make the sidebar navigation scrollable */
.sidebar-nav {
max-height: 2000px;


  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  top: 0;
}


/* Custom scrollbar styling for the sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(100,169,255,0.15);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(100,169,255,0.25);
}

/* Firefox scrollbar */
.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(100,169,255,0.15) rgba(255,255,255,0.02);
}

/* Smooth scrolling behavior */
.sidebar-nav {
  scroll-behavior: smooth;
}


.sidebar-nav::before {
  top: 0;
  background: linear-gradient(to bottom, var(--card) 30%, transparent 100%);
  margin-bottom: -15px;
}

.sidebar-nav::after {
  bottom: 0;
  background: linear-gradient(to top, var(--card) 30%, transparent 100%);
  margin-top: -15px;
}



/* ========================================================
   4. NAVIGATION
   ======================================================== */

/* --- Mobile Navigation Circle --- */
.mobile-nav {
  position: fixed;
  bottom: 15px;
  right: -140px; /* hidden by default */
  height: 250px;
  width: 250px;
  border-radius: 50% 0 0 50%;
  background: rgba(255,255,255,0.02);
  border: 2px solid #9f2a2a;
  z-index: 9999;
  opacity: 0.5;
  backdrop-filter: blur(3px);
  transition: right 0.3s ease, opacity 0.3s ease;
  pointer-events: none; /* Base element not clickable */
}

.mobile-nav.open {
  right: 0 !important;
  opacity: 1;
}

.mobile-nav:hover {
  opacity: 1;
}

/* Make specific nav elements clickable */
.mobile-nav .nav-tab,
.mobile-nav .side-nav,
.mobile-nav .nav-link {
  pointer-events: auto;
}

/* --- Side Navigation Links --- */
.side-nav {
  position: absolute;
  bottom: 15px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  z-index: 10000;
}

.nav-link {
  display: inline-block;
  background: #9f2a2a;
  color: white;
  text-decoration: none;
  padding: 1px 25px;
  border-radius: 20px 0 0 70px;
  transition: all 0.3s ease;
  font-family: monospace;
  letter-spacing: 2px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-link:hover {
  background: #b53333;
  padding-left: 55px;
  color: #ffcccc;
  box-shadow: -6px 6px 16px rgba(0,0,0,0.4);
  transform: scale(1.02);
}

.nav-link .nav-content {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease;
}

.nav-link:hover .nav-content {
  transform: translateX(-10px);
}

.nav-link i {
  margin-right: 8px;
  font-size: 14px;
  min-width: 16px;
}

/* Nav link padding lengths (left side extension) */
.nav-link.home { 
  padding-left: 40px;  /* shortest */
}

.nav-link.characters { 
  padding-left: 30px; 
}

.nav-link.locations  { 
  padding-left: 50px;  /* longest */
}

.nav-link.worldinfo { 
  padding-left: 40px;  /* longest */
}

.nav-link.stories { 
  padding-left: 40px; 
}

.nav-link.au { 
  padding-left: 40px;  /* shortest */
}

/* --- Navigation Tab Toggle --- */
.nav-tab {
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  width: 20px;
  height: 60px;
  background: #9f2a2a;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.3s ease;
}

.nav-tab:hover {
  background: #b53333;
}



/* --- Mobile Breakpoints --- */
@media (max-width: 768px) {
  /* Navigation adjustments */
  .mobile-nav {
    height: 150px;
    width: 150px;
    right: -125px;
    border-radius: 60% 0 0 60%;
    transform: scale(0.65);
    transform-origin: bottom right;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
    .pagedoll-inline-wrapper {
        display: none;
    }

    /* Mobile navigation scale */
    .mobile-nav {
        transform: scale(0.65);
        transform-origin: bottom right;
    }
    
    /* =====================================================
       MOBILE CARD SIZE ADJUSTMENTS
       Further reduce card sizes on mobile devices
    ===================================================== */
    .folder-background {
        height: 180px; /* Smaller height on mobile */
    }
    
    .folder-title {
        font-size: 1rem;
    }
    
    .folder-tags {
        font-size: 0.7rem;
    }
}

        /* ===========================
           END NAVIGATION STYLES
        ============================*/




/* ========================================================
   MOBILE & SMALL SCREEN
   All rules use max-width only — large screens untouched
   ======================================================== */

/* Below lg (991px) — tablets and below */
@media (max-width: 991px) {

  body {
    padding: 10px;
  }

  .hero {
    height: 100px;
  }

  h1.site-title {
    font-size: 1rem;
  }

  /* Remove sticky so sidebar doesn't fight the stacked layout */
  .sidebar-nav {
    position: relative;
    top: 0;
    max-height: 350px;
  }

  /* Tighten character block padding */
  .character-block {
    padding: 10px;
  }

  /* File header badges wrap cleanly */
  .character-name {
    font-size: 1.1rem;
  }

  /* Reduce image container height */
  .demon-image-container {
    height: 200px;
  }

  /* Glance box: drop to 2 columns */
  .glance-box > div {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Keep full-width items full-width */
  .glance-item[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  /* Let all text boxes expand naturally — no fixed heights */
  .abilities-box,
  .update-box,
  .notes-box,
  .diagnosis-box {
    flex: none !important;
    height: auto !important;
  }

}


/* Small phones (575px and below) */
@media (max-width: 575px) {

  body {
    padding: 6px;
  }

  .hero {
    height: 75px;
  }

  .character-name {
    font-size: 1rem;
  }

  /* Glance box: single column on phones */
  .glance-box > div {
    grid-template-columns: 1fr !important;
  }

  .demon-image-container {
    height: 170px;
  }

  /* Reduce box padding */
  .update-box,
  .diagnosis-box,
  .abilities-box,
  .notes-box {
    padding: 10px !important;
  }

  /* Stat labels slightly smaller */
  .stat-label {
    font-size: 10px;
  }

  /* Tighten glance box padding */
  .glance-box {
    padding: 10px;
  }

  /* Sector overview text box full width */
  .sector-overview {
    flex-direction: column;
  }

}





/* Compact Containment Summary */
.glance-box {
  padding: 10px;
  font-size: 11px;
}

.glance-item {
  margin-bottom: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

.glance-label {
  color: var(--muted);
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.glance-value {
  color: #ffffff;
  padding-left: 4px;
  line-height: 1.4;
}



