/* ===== GLOBAL ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BODY ===== */
body {
  font-family: 'VT323', monospace;
  background-color: #F8F0D1;
  color: #000;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 250px;
  background-color: #D10000;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-right: 4px solid black;
  box-shadow: 4px 0 0 #000;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #000;
  border-radius: 5px;
}

.logo {
  width: 100%;
  margin-bottom: 15px;
  border: 3px solid #000;
  border-radius: 8px;
}

.menu-section {
  margin-bottom: 20px;
}

.menu-section h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
  text-align: left;
  color: #fff;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-section ul {
  list-style: none;
  padding-left: 0;
}

.menu-section a {
  display: block;
  text-decoration: none;
  color: #fff;
  background: #000;
  padding: 8px;
  margin: 5px 0;
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.menu-section a:hover {
  background: #F8F0D1;
  color: #000;
}

/* ===== SIDEBAR BOTTOM ===== */
.sidebar-bottom {
  margin-top: auto;
  text-align: center;
  font-size: 14px;
}

.sidebar-bottom button {
  font-family: 'Press Start 2P';
  font-size: 10px;
  background-color: #fff;
  color: #D10000;
  border: 2px solid #000;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.sidebar-bottom button:hover {
  background-color: #D10000;
  color: #fff;
}

.sidebar-extra {
  text-align: center;
  font-size: 12px;
  color: #fff;
  margin-top: 10px;
}

/* ===== CONTENT AREA ===== */
.content {
  margin-left: 250px;
  padding: 40px;
  width: calc(100% - 250px);
  background-color: #fff;

  /* Center all boxes below the header */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ===== TOP HEADER ===== */
.top-header {
  text-align: center;
  font-family: 'Press Start 2P';
  font-size: 20px;
  color: #fff;
  background-color: #D10000;
  padding: 20px;
  border: 4px solid #000;
  border-radius: 10px;
  box-shadow: 4px 4px 0 #000;
  margin-bottom: 30px;
  text-transform: uppercase;
}

/* ===== SECTIONS (Intro, Creator, History, Wallpapers) ===== */
section {
  background-color: #F8F0D1;
  border: 3px solid #000;
  border-radius: 10px;
  padding: 20px;
  margin: 0 auto 30px auto;
  box-shadow: 5px 5px 0 #D10000;
  width: 80%;
  max-width: 900px;
  text-align: justify;
  line-height: 1.5;
}

section h2, section h3 {
  text-align: center;
  margin-bottom: 10px;
  color: #D10000;
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
}

section img {
  display: block;
  margin: 0 auto 15px auto;
  border: 2px solid #000;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

section:not(:last-child) {
  margin-bottom: 40px;
}

/* ===== PARAGRAPHS ===== */
p {
  font-family: 'VT323', monospace;
  font-size: 20px;
  line-height: 1.6;
  margin-top: 10px;
  margin-bottom: 10px;
  text-align: justify;
  text-justify: inter-word;
}

/* ===== HEADER IMAGES ===== */
.header-image {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border: 4px solid #000;
  border-radius: 10px;
  margin-bottom: 15px;
}

/* ===== CREATOR PHOTO ===== */
.creator-photo {
  display: block;
  margin: 0 auto 20px auto;
  border: 5px solid #D10000;
  background-color: #D10000;
  border-radius: 12px;
  padding: 10px;
  max-width: 300px;
  box-shadow: 5px 5px 0 #000;
}

/* ===== WALLPAPER GRID (3x3) ===== */
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  justify-items: center;
  margin-top: 20px;
}

.wallpaper img {
  width: 100%;
  max-width: 250px;
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 4px 4px 0 #D10000;
  transition: transform 0.3s ease;
}

.wallpaper img:hover {
  transform: scale(1.05);
}

/* ===== DOWNLOAD BUTTON ===== */
.download-button {
  display: inline-block;
  background-color: #D10000;
  color: #fff;
  text-decoration: none;
  font-family: 'Press Start 2P';
  font-size: 12px;
  padding: 10px 15px;
  border-radius: 8px;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  transition: all 0.2s ease;
}

.download-button:hover {
  background-color: #fff;
  color: #D10000;
  transform: translateY(-2px);
}

/* ===== BOOKS SECTION ===== */
.books {
  padding: 20px;
  max-width: 1200px;
  margin: auto;
}

.books h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 22px;
  color: #D10000;
  font-family: 'Press Start 2P';
  text-shadow: 1px 1px #000;
}

/* ===== BOOK GRID ===== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  justify-items: center;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: #fff8e1;
  border: 2px solid #D10000;
  border-radius: 10px;
  padding: 10px;
  height: 420px;
  transition: transform 0.2s;
  text-align: center;
}

.book-card:hover {
  transform: scale(1.05);
}

/* ===== UPDATED BOOK HEADER ===== */
.book-header {
  text-align: center;
  font-weight: bold;
  color: #D10000;
  font-family: 'Press Start 2P';
  margin-bottom: 10px;

  /* Auto-resize for long titles */
  font-size: clamp(10px, 1.5vw, 16px);
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.book-card img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 10px;
}

.book-description {
  font-family: 'VT323', monospace;
  font-size: 16px;
  text-align: center;
  color: #2b1e1e;
  flex-grow: 1;
}

/* ===== POPUP ===== */
.popup {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.popup-box {
  background: #fff;
  border: 3px solid #000;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 5px 5px 0 #D10000;
  width: 300px;
}

.popup-header {
  font-family: 'Press Start 2P';
  color: #D10000;
  margin-bottom: 10px;
}

.close-btn {
  background: #D10000;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

.close-btn:hover {
  background: #000;
}