/* made using a template: Template 2097 Pop https://www.tooplate.com/view/2097-pop */

:root {
  --filter: rgba(0, 0, 0, 0.7);
  --quatr-color: rgb(210, 50, 60);
  --tertiary-color: rgb(170, 20, 30);
  --primary-color: rgb(130, 10, 20);
  --secondary-color: rgb(80, 0, 10);
  --button: rgba(30, 30, 30, 0.7);
  --details: rgb(15, 15, 15);
  --form: rgb(40, 40, 40);
  --form-focus: rgb(50, 50, 50);
  --button-text: whitesmoke;
  --ui-scale: 1; /* Updated dynamically by JS on large screens */
}

body {
  background-color: black;
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-size: 19px;
  font-weight: 300;
  color: white;
  position: relative;
  overflow: auto;
}

a {
  color: var(--tertiary-color)
}

::-webkit-scrollbar {
  width: 20px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--form);
  border-radius: 20px;
  border: 6px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--form-focus);

}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Background */
#main-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/misc/background.webp');
  background-size: cover;
  background-position: center;
  z-index: -2;
}

#bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--filter);
  z-index: -1;
}

/* Container for top tabs (Main Page) */
.top-tabs-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(var(--ui-scale));
  transform-origin: top center;
  display: flex;
  gap: 20px;
  z-index: 10;
}

/* Container for floating top right buttons (Legal Page) */
.top-left-floating {
  position: fixed;
  top: 20px;
  left: 30px;
  display: flex;
  gap: 15px;
  z-index: 10;
}

/* Base button styles */
.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

/* specific style for tabs */
.nav-tab {
  border-top: none;
  border-radius: 0 0 15px 15px;
  width: 55px;
  height: 50px;
  transform-origin: top center;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scaleY(1.1) scaleX(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.nav-tab:active {
  transform: scaleY(1.05) scaleX(1.02);
}

/* specific style for floating orbs */
.nav-orb {
  border-radius: 50%;
  width: 50px;
  height: 50px;
}

.nav-orb:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.nav-orb:active {
  transform: translateY(1px);
}

/* Footer bar */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px 40px;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none; /* let clicks through to graph below */
}

.footer-left,
.footer-right {
  pointer-events: auto;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.footer-left a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-left a:hover {
  color: white;
}

/* On very narrow screens, stack them centered */
@media (max-width: 480px) {
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 20px;
    gap: 2px;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  }
}

/* Modal Window */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--details);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  padding: 50px 40px;
  position: relative;
  overflow-y: auto;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

#poem-modal-content {
  transition: height 0.3s ease, opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 1;
  transform: scale(1) translateY(0);
}

#poem-modal-content.transitioning {
  opacity: 0;
  transform: scale(0.98) translateY(10px);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  z-index: 1001;
}

.modal-close:hover {
  color: white;
  transform: rotate(90deg);
}

.poem-modal-content {
  color: white;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Custom Scrollbar for Modal Container */
.modal-container::-webkit-scrollbar {
  width: 12px;
}

.modal-container::-webkit-scrollbar-thumb {
  background-color: var(--form);
  border-radius: 10px;
  border: 3px solid var(--details);
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--form-focus);
}

.modal-container::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------------------------
   Graph Container & Elements
--------------------------------- */
#graph-container {
  position: absolute;
  /* width and height are now managed dynamically by javascript */
  z-index: 1;
  /* Below top buttons (10) and modal (1000) */
}

/* Edges Layer (SVG) */
.graph-edges-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  /* Let clicks pass through to nodes/background */
}

/* Graph Nodes */
.graph-node {
  position: absolute;
  transform: translate(-50%, -50%);
  /* Center the node exactly on its coordinates */
  background: rgba(100, 100, 100, 0.1);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  padding: 12px;
  /* Margin between border and image */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease, width 0.4s ease, height 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.graph-node img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  /* Let the button handle clicks */
  transition: opacity 0.3s ease;
}

.graph-node:focus {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  outline: none;
}

.graph-node:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.graph-node:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  background: rgba(170, 20, 30, 0.8);
  /* Darker tertiary color on hover */
  border-color: rgba(255, 255, 255, 0.8);
}

/* Modal Specific Custom Scrollbar */
.modal-container::-webkit-scrollbar {
  width: 12px;
}

.modal-container::-webkit-scrollbar-track {
  margin-top: 10px;
  margin-bottom: 10px;
  background-color: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Poem Modal Interactive Elements */
.poem-translate-btn {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  color: white;
  padding: 8px 30px;
  font-weight: 300;
  transition: all 0.3s ease;
  width: 100%;
}

.poem-translate-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: white;
}

.poem-translate-btn:active {
  transform: translateY(1px);
}

.poem-text {
  white-space: pre-wrap;
  font-size: 1.15rem;
  line-height: 2.2;
  text-align: left;
  color: rgba(255,255,255,0.9);
  margin: 0;
}

.poem-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.poem-meta-text {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
  font-size: 1rem;
  margin-bottom: 8px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.poem-meta-text i {
  color: var(--tertiary-color);
  font-size: 1.1rem;
}

.poem-meta-btn {
  text-decoration: none !important;
  color: white !important;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  color: white;
  padding: 8px 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 160px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.poem-meta-btn i {
  color: #ffd700;
  font-size: 1.1rem;
}

.poem-meta-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-decoration: none !important;
  color: white !important;
}

.poem-meta-btn:active {
  transform: translateY(1px);
  text-decoration: none !important;
  color: white !important;
}

.poem-meta-btn:focus {
  text-decoration: none !important;
  color: white !important;
}

.poem-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.poem-list-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  text-align: left;
  width: 100%;
}

.poem-list-item:hover, 
.poem-list-item:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  outline: none;
}

.poem-list-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  flex-grow: 1;
  padding-right: 20px;
}

.poem-list-title {
  font-size: 1.05rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
}

.poem-list-author {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
}

.poem-list-arrow {
  color: var(--tertiary-color, #fff);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.poem-list-item:hover .poem-list-arrow,
.poem-list-item:focus .poem-list-arrow {
  transform: translateX(5px);
}
