/* Reset and basic body styling */
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Basic styling for top header - Koishi background is now dynamic */
.top-header {
  position: relative;
  width: 50%;
  height: auto;
  min-height: 15vh;
  background-color: transparent;
  padding: 10px;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 10;
  margin: 0 auto;
}

.top-header-title {
  font-family: "Pixellari", sans-serif;
  font-size: 7vh;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(138, 43, 226, 0.6);

  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

/* Container for main layout */
.container {
  display: flex;
  justify-content: center;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  min-height: calc(100vh - 15vh);
  transform: scale(1.3);
  transform-origin: top center;
}

/* Left Navigation Sidebar */
.left-nav {
  width: 250px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 0;
  min-height: calc(100vh - 15vh);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  width: 100%;
}

.nav-list li {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 1rem 2rem;
  color: #ffffff;
  text-decoration: none;
  font-family: "Pixellari", sans-serif;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  border: none;
  text-align: center;
  border-radius: 8px;
  margin: 0.5rem 1rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: translateX(5px);
}

.nav-link.active {
  background: rgba(138, 43, 226, 0.3);
  text-shadow: 0 0 15px rgba(138, 43, 226, 0.8);
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 2rem 3rem;
  color: #ffffff;
  max-width: 800px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 10px;
  margin-left: 2rem;
  height: 100%;
  min-height: calc(100vh - 15vh);
}

.content-section {
  display: none;
  animation: fadeIn 0.5s ease-in;
}

.content-section.active {
  display: block;
}

.content-section h1 {
  font-family: "Pixellari", sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.content-section p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive design for random entries */
@media (max-width: 768px) {
  .random-entries {
    grid-template-columns: 1fr; /* Single column on mobile */
    max-width: 100%;
  }
  
  .random-entry-btn {
    font-size: 0.9rem;
    padding: 0.8rem 1rem;
  }
}

/* Random section styling */
.random-entries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  max-width: 600px; /* Limit the width so buttons don't get too wide */
}

.random-entry-btn {
  background: rgba(138, 43, 226, 0.2);
  border: 2px solid rgba(138, 43, 226, 0.5);
  color: #ffffff;
  padding: 1rem 1.5rem;
  font-family: "Pixellari", sans-serif;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
}

.random-entry-btn:hover {
  background: rgba(138, 43, 226, 0.4);
  border-color: rgba(138, 43, 226, 0.8);
  text-shadow: 0 0 15px rgba(138, 43, 226, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
}

/* Random image display */
.random-image-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
  max-height: 500px;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.random-image-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 0, 0, 0.7);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  z-index: 1001;
  transition: background 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 0, 0, 0.9);
}

#random-koishi-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.image-info {
  padding: 10px;
  text-align: center;
}

.image-info a {
  color: #4ecdc4;
  text-decoration: none;
  font-family: monospace;
  font-size: 0.9rem;
}

.image-info a:hover {
  color: #ff6b9d;
  text-shadow: 0 0 5px rgba(255, 107, 157, 0.5);
}
