/* Echoes of Apotheosis - Main CSS Style Sheet */

/* =====================================
   Base Reset & Global Styles
===================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: 'Georgia', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #e0e0e0; /* Light color for dark background */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
  }
  
  /* =====================================
     Background Effects
  ===================================== */
  .background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0A1929; /* Fallback color if image doesn't load */
    background-image: url('/assets/background.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: -2;
    filter: blur(1px);
  }
  
  /* Container for shooting stars effect */
  .shooting-stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
  }
  
  /* Base styles for shooting stars */
  .shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #fff;
    z-index: -1;
    border-radius: 50%;
    opacity: 0;
    transform-origin: right center;
    box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.8),
                0 0 20px 5px rgba(255, 255, 255, 0.4);
  }
  
  /* Background stars */
  .star {
    position: absolute;
    border-radius: 50%;
    z-index: -1;
    background-color: transparent;
    box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.8);
  }
  
  .star:nth-child(odd) {
    animation: twinkle-1 4s infinite ease-in-out;
  }
  
  .star:nth-child(even) {
    animation: twinkle-2 6s infinite ease-in-out;
  }
  
  .star:nth-child(3n) {
    animation: twinkle-3 5s infinite ease-in-out;
  }
  
  /* Different star brightness classes */
  .star-dim {
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 3px 0px rgba(255, 255, 255, 0.4);
  }
  
  .star-medium {
    background-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.6);
  }
  
  .star-bright {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.8);
  }
  
  .star-very-bright {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 8px 2px rgba(255, 255, 255, 1), 0 0 12px 4px rgba(255, 255, 255, 0.6);
  }
  
  /* Star twinkling animations */
  @keyframes twinkle-1 {
    0%, 100% { opacity: 0.3; box-shadow: 0 0 2px 0px rgba(255, 255, 255, 0.2); }
    50% { opacity: 1; box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.8); }
  }
  
  @keyframes twinkle-2 {
    0%, 100% { opacity: 0.2; box-shadow: 0 0 3px 1px rgba(170, 200, 255, 0.2); }
    50% { opacity: 0.8; box-shadow: 0 0 10px 2px rgba(170, 200, 255, 0.8); }
  }
  
  @keyframes twinkle-3 {
    0%, 100% { opacity: 0.4; box-shadow: 0 0 4px 1px rgba(255, 230, 210, 0.2); }
    30% { opacity: 0.1; }
    60% { opacity: 1; box-shadow: 0 0 12px 3px rgba(255, 230, 210, 0.8); }
  }
  
  /* Shooting star animations - multiple variations */
  @keyframes shooting-star-1 {
    0% {
      opacity: 0;
      transform: translateX(0) translateY(0) rotate(45deg) scale(1);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    1% {
      opacity: 1;
      transform: translateX(0) translateY(0) rotate(45deg) scale(1);
      box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.3), 0 0 20px 5px rgba(255, 255, 255, 0.1);
    }
    10% {
      opacity: 1;
      box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.5), 0 0 30px 10px rgba(255, 255, 255, 0.2);
    }
    15% {
      opacity: 0;
      transform: translateX(-300px) translateY(300px) rotate(45deg) scale(0.5);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    100% {
      opacity: 0;
      transform: translateX(-300px) translateY(300px) rotate(45deg) scale(0.5);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
  }
  
  @keyframes shooting-star-2 {
    0% {
      opacity: 0;
      transform: translateX(0) translateY(0) rotate(30deg) scale(1);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    1% {
      opacity: 1;
      transform: translateX(0) translateY(0) rotate(30deg) scale(1);
      box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.3), 0 0 20px 5px rgba(255, 255, 255, 0.1);
    }
    10% {
      opacity: 1;
      box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.5), 0 0 30px 10px rgba(255, 255, 255, 0.2);
    }
    15% {
      opacity: 0;
      transform: translateX(-250px) translateY(150px) rotate(30deg) scale(0.5);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    100% {
      opacity: 0;
      transform: translateX(-250px) translateY(150px) rotate(30deg) scale(0.5);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
  }
  
  @keyframes shooting-star-3 {
    0% {
      opacity: 0;
      transform: translateX(0) translateY(0) rotate(60deg) scale(1);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    1% {
      opacity: 1;
      transform: translateX(0) translateY(0) rotate(60deg) scale(1);
      box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.3), 0 0 20px 5px rgba(255, 255, 255, 0.1);
    }
    10% {
      opacity: 1;
      box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.5), 0 0 30px 10px rgba(255, 255, 255, 0.2);
    }
    15% {
      opacity: 0;
      transform: translateX(-200px) translateY(350px) rotate(60deg) scale(0.5);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    100% {
      opacity: 0;
      transform: translateX(-200px) translateY(350px) rotate(60deg) scale(0.5);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
  }
  
  /* =====================================
     Throbber Styles
  ===================================== */
  .throbber-object {
    border: none;
    margin: 0 auto;
    display: block;
    background: transparent;
    pointer-events: none; /* Prevents mouse interaction */
    width: 400px;
    height: 400px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0; /* Position behind the text */
  }
  
  .logo-container {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 0;
  }
  
  /* =====================================
     Header & Intro Section
  ===================================== */
  header {
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
    color: #fff;
    padding: 4rem 2rem; /* Increased padding to accommodate throbber */
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px); /* Add a blur effect for modern browsers */
    border-bottom: 1px solid rgba(80, 200, 120, 0.3); /* Subtle green border */
    overflow: hidden; /* Ensures throbber doesn't extend outside */
    min-height: 300px; /* Ensure there's enough space for the throbber */
    width: 100%; /* Make sure header spans full width */
  }
  
  .header-content {
    position: relative;
    z-index: 6; /* Ensure this is above the throbber */
    pointer-events: auto; /* Make sure it can be interacted with */
    width: 100%;
  }
  
  header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(80, 200, 120, 0.5); /* Glowing text effect */
    position: relative;
    z-index: 2; /* Make sure text is above throbber */
  }
  
  header p {
    font-size: 1.2rem;
    position: relative;
    z-index: 2; /* Make sure text is above throbber */
  }
  
  /* =====================================
     Navigation - Book Bookmark Style
  ===================================== */
  nav {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1000; /* Increased z-index to ensure it overlays content */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    pointer-events: auto; /* Make sure the nav is interactive */
  }
  
  /* Expand on hover */
  nav:hover {
    transform: translateY(-50%) translateX(0);
  }
  
  nav.collapsed {
    transform: translateY(-50%) translateX(-180px);
  }
  
  /* Make the bookmark tabs visible when collapsed */
  nav.collapsed::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -25px;
    width: 25px;
    z-index: -1;
    cursor: pointer;
  }
  
  nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: rgba(10, 25, 41, 0.9);
    padding: 1.5rem 0;
    width: 200px;
    border-radius: 0 10px 10px 0;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
    /* Book-like styles */
    border-right: 2px solid rgba(80, 200, 120, 0.5);
    background-image: linear-gradient(
      to right,
      rgba(5, 15, 30, 0.95) 0%,
      rgba(10, 25, 41, 0.95) 90%,
      rgba(15, 35, 50, 0.95) 100%
    );
  }
  
  /* Book spine effect */
  nav ul:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 8px;
    background: linear-gradient(
      to right,
      rgba(30, 40, 50, 0.9),
      rgba(10, 25, 41, 0.9)
    );
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Individual bookmark styling */
  nav ul li {
    position: relative;
    transition: all 0.3s ease;
    margin: 0.4rem 0;
  }
  
  nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease, transform 0.3s ease;
    display: block;
    padding: 0.8rem 1.5rem 0.8rem 1.8rem;
    border-left: 5px solid transparent;
    position: relative;
    z-index: 2;
  }
  
  /* Bookmark tab effect */
  nav ul li a:before {
    content: '';
    position: absolute;
    right: -20px;
    top: 0;
    width: 25px;
    height: 100%;
    background-color: rgba(80, 200, 120, 0.3);
    border-radius: 0 5px 5px 0;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
    /* Book bookmark texture */
    background-image: linear-gradient(
      to right,
      rgba(80, 200, 120, 0.3) 0%,
      rgba(80, 200, 120, 0.5) 100%
    );
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  }
  
  nav ul li a:hover {
    color: #ffcc00; /* Gold highlight */
    transform: translateX(5px);
    border-left: 5px solid #ffcc00;
  }
  
  nav ul li a:hover:before {
    opacity: 1;
    right: -20px;
    width: 25px;
  }
  
  nav ul li a.active {
    color: #50C878; /* Emerald for active page */
    border-left: 5px solid #50C878;
    background-color: rgba(80, 200, 120, 0.1);
  }
  
  nav ul li a.active:before {
    background-color: #50C878;
    background-image: linear-gradient(
      to right,
      rgba(80, 200, 120, 0.7) 0%,
      rgba(80, 200, 120, 0.9) 100%
    );
    opacity: 1;
    right: -20px;
    width: 25px;
  }
  
  /* Collapsed nav styles - only show bookmarks/tabs */
  nav.collapsed ul li a:before {
    opacity: 1;
    right: -25px;
    width: 25px;
  }
  
  /* Different color bookmarks for each menu item */
  nav ul li:nth-child(1) a:before {
    background-image: linear-gradient(
      to right,
      rgba(80, 200, 120, 0.5) 0%,
      rgba(80, 200, 120, 0.7) 100%
    );
  }
  
  nav ul li:nth-child(2) a:before {
    background-image: linear-gradient(
      to right,
      rgba(255, 180, 0, 0.5) 0%,
      rgba(255, 180, 0, 0.7) 100%
    );
  }
  
  nav ul li:nth-child(3) a:before {
    background-image: linear-gradient(
      to right,
      rgba(100, 150, 255, 0.5) 0%,
      rgba(100, 150, 255, 0.7) 100%
    );
  }
  
  nav ul li:nth-child(4) a:before {
    background-image: linear-gradient(
      to right,
      rgba(220, 100, 150, 0.5) 0%,
      rgba(220, 100, 150, 0.7) 100%
    );
  }
  
  nav ul li:nth-child(5) a:before {
    background-image: linear-gradient(
      to right,
      rgba(180, 120, 250, 0.5) 0%,
      rgba(180, 120, 250, 0.7) 100%
    );
  }
  
  nav ul li:nth-child(6) a:before {
    background-image: linear-gradient(
      to right,
      rgba(120, 230, 180, 0.5) 0%,
      rgba(120, 230, 180, 0.7) 100%
    );
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    nav {
      transform: translateY(-50%) translateX(-180px);
    }
    
    /* For touch devices, we need a larger tab area to tap on */
    nav.collapsed::after {
      width: 30px;
      right: -30px;
    }
    
    nav.collapsed ul li a:before {
      right: -30px;
      width: 30px;
    }
    
    .container {
      width: 95%;
      margin-left: auto;
      margin-right: auto;
      padding: 1rem;
    }
    
    /* Keep container width consistent even when nav is expanded */
    body:has(nav:not(.collapsed)) .container {
      width: 95%; /* Same as default mobile */
    }
    
    /* Fallback for browsers without :has support */
    .nav-expanded .container {
      width: 95%; /* Same as default mobile */
    }
    
    header {
      padding: 3rem 1rem;
    }
    
    header h1 {
      font-size: 2rem;
    }
  }
  
  /* Very small screens */
  @media (max-width: 480px) {
    nav ul {
      width: 180px;
    }
    
    nav.collapsed {
      transform: translateY(-50%) translateX(-160px);
    }
    
    nav.collapsed::after {
      right: -35px;
      width: 35px;
    }
    
    nav.collapsed ul li a:before {
      right: -35px;
      width: 35px;
    }
    
    .container {
      width: 100%;
      border-radius: 0;
    }
    
    /* Keep container width consistent even when nav is expanded */
    body:has(nav:not(.collapsed)) .container {
      width: 100%; /* Same as default for very small screens */
    }
    
    /* Fallback for browsers without :has support */
    .nav-expanded .container {
      width: 100%; /* Same as default for very small screens */
    }
  }
  
  /* Disable hover behavior on touch devices */
  @media (hover: none) {
    nav:hover {
      /* Don't auto-expand on devices without hover capability */
      transform: translateY(-50%) translateX(-180px);
    }
    nav.collapsed:hover {
      transform: translateY(-50%) translateX(-180px);
    }
  }
  
  /* Touch device specific styling (applied via JS) */
  .touch-device nav.collapsed ul li a:before {
    opacity: 1;
    right: -35px;
    width: 35px; /* Larger touch target */
  }
  
  .touch-device nav.collapsed::after {
    width: 35px;
    right: -35px;
  }
  
  /* =====================================
     Main Content Layout
  ===================================== */
  main {
    display: block;
    width: 100%;
    position: relative;
    z-index: 1;
  }
  
  .container {
    width: 90%; /* Back to original width */
    max-width: 1200px; /* Back to original max-width */
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    position: relative;
    z-index: 1;
    background-color: rgba(10, 25, 41, 0.7); /* Semi-transparent background */
    backdrop-filter: blur(5px); /* Subtle blur effect for better readability */
    border-radius: 8px;
    margin-left: auto;
    margin-right: auto;
    transition: none; /* Remove transition for width and margin */
  }
  
  /* Remove container adjustments for expanded nav */
  body:has(nav:not(.collapsed)) .container {
    margin-left: auto;
    margin-right: auto;
    width: 90%; /* Same as default */
    max-width: 1200px; /* Same as default */
  }
  
  /* Fallback for browsers that don't support :has */
  @supports not (selector(:has(*))) {
    .container {
      width: 90%;
      margin-left: auto;
      margin-right: auto;
    }
    
    .nav-expanded .container {
      width: 90%; /* Same as default */
      max-width: 1200px; /* Same as default */
    }
  }
  
  /* Section headings */
  h2 {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #50C878; /* Emerald border */
    padding-bottom: 0.5rem;
    color: #e0e0e0;
  }
  
  /* Content sections */
  section {
    margin-bottom: 2rem;
  }
  
  /* =====================================
     Card Style (for characters, logs, etc.)
  ===================================== */
  .card {
    background-color: rgba(26, 32, 44, 0.8); /* Darker, semi-transparent background */
    border: 1px solid rgba(80, 200, 120, 0.3); /* Subtle green border */
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  
  /* =====================================
     Buttons & Interactive Elements
  ===================================== */
  button, .btn {
    background-color: #50C878; /* Emerald green */
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
  }
  
  button:hover, .btn:hover {
    background-color: #3da166;
  }
  
  /* Hyperlinks */
  a {
    color: #a29bfe; /* Light purple for visibility */
    text-decoration: none;
    transition: color 0.3s ease;
  }
  
  a:hover {
    color: #50C878; /* Green on hover */
  }
  
  /* =====================================
     Forms
  ===================================== */
  input[type="text"],
  input[type="email"],
  textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #2d3748;
    border-radius: 4px;
    margin-bottom: 1rem;
    background-color: rgba(15, 23, 42, 0.8);
    color: #e0e0e0;
  }
  
  input:focus, textarea:focus {
    border-color: #50C878;
    outline: none;
  }
  
  /* =====================================
     Footer
  ===================================== */
  footer {
    background-color: rgba(15, 23, 42, 0.9);
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(80, 200, 120, 0.3); /* Subtle green border */
  }
  
  /* =====================================
     Miscellaneous Elements
  ===================================== */
  hr {
    border: none;
    border-top: 1px solid rgba(80, 200, 120, 0.3); /* Subtle green separator */
    margin: 2rem 0;
  }