* {
  box-sizing: border-box;
}

/* --------------------- */
/* 🎨 BASIC STYLES       */
/* --------------------- */

body {
  margin: 0;
  height: 100vh;
  background: url('filmstrip.gif') no-repeat center center fixed;
  background-size: cover;
  background-color: #f0fbc3; /* soft green */
  animation: fadeInBg 5s ease-in-out infinite alternate;
  font-family: 'Georgia', serif;
  color: #4d014f; /* deep purple text */
}

/* Background animation */
@keyframes fadeInBg {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* --------------------- */
/* 🔠 HEADER             */
/* --------------------- */

header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  text-align: center;
  padding: 1rem;
  background-color: transparent;
  color: #f0fbc3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Navigation links */
nav a {
  margin: 0 10px;
  color: #fbc3d0;
  text-decoration: none;
}

/* --------------------- */
/* 📦 LAYOUT CONTAINER   */
/* --------------------- */

.container {
  display: block;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  padding-top: 5rem; /* enough room for fixed header + sticky buttons */
  box-sizing: border-box;
}

/* --------------------- */
/* 🔝 TOP BUTTONS NAV    */
/* --------------------- */

.top-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0rem;
  justify-content: center;
  position: sticky;
  top: 5.5rem; /* sits under fixed header */
  z-index: 100;
  background: rgba(251, 224, 195, 0.95); /* soft peach */
  padding: 0.75rem;
  border-bottom: 2px solid #ff9900;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

/* Styled tab-like links */
.top-buttons a {
  background: linear-gradient(to bottom, #fbe0c3, #ffd9aa);
  color: #4d014f;
  padding: 0.6rem 1.2rem;
  border: 2px solid #ff9900;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  position: relative;
  top: 2px;
}

.top-buttons a:hover,
.top-buttons a:focus {
  background: linear-gradient(to bottom, #e5c9e5, #d6a3d6); /* light lavender to deeper purple */
  color: #4d014f;
  top: 0;
  box-shadow: 0 6px 12px rgba(77, 1, 79, 0.3); /* soft purple glow */
}

.top-buttons a.active-tab {
  background: linear-gradient(to bottom, #fff0dd, #ffd4a3);
  color: #4d014f;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  top: 0;
}

@keyframes glow {
  0% { box-shadow: 0 0 5px #c27ba0; }
  100% { box-shadow: 0 0 15px #4d014f; }
}

.top-buttons a:hover {
  animation: glow 0.4s alternate infinite;
}

/* --------------------- */
/* 📚 MAIN CONTENT       */
/* --------------------- */

.main-content {
  column-count: 2;
  column-gap: 2rem;
  width: 100%;
  padding: 1rem 0;
  box-sizing: border-box;
}

/* Collapsible book entries */
details {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 1rem;
  border-radius: 4px;
  break-inside: avoid; /* prevents content from splitting between columns */
}

summary {
  cursor: pointer;
  font-weight: bold;
}

.content {
  margin-top: 10px;
}

/* --------------------- */
/* 🖼️ SIDEBAR            */
/* --------------------- */

.sidebar {
  display: grid;
  grid-auto-flow: column; /* Scroll horizontally */
  grid-template-rows: repeat(1, auto); /* Two rows */
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem 0;
  width: 100%;
  box-sizing: border-box;
  scroll-snap-type: x mandatory;
}

/* Book cover images */
.sidebar img {
  max-height: 150px;
  width: auto;
  border-radius: 4px;
  display: block;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* --------------------- */
/* 🖱️ CUSTOM SCROLLBARS  */
/* --------------------- */

/* Pretty scrollbars for WebKit browsers */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #fbe0c3;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #4d014f;
  border-radius: 10px;
  border: 3px solid #fbe0c3;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #ff9900;
}


/* Clean summary style */
summary {
  font-family: 'Georgia', serif;
  font-size: 1.2rem;
  color: #4d014f; /* deep purple */
  font-weight: bold;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}

/* Fun animated star rating */
.rating {
  font-size: 1.2rem;
  color: #ffd700; /* gold stars */
  text-shadow: 0 0 4px #ffd700;
  animation: twinkle 3s infinite alternate;
}
@keyframes twinkle {
  0% { text-shadow: 0 0 4px #ffd700; }
  100% { text-shadow: 0 0 10px #fff700, 0 0 20px #ffd700; }
}

summary:hover {
  color: #7a2365; /* slightly lighter purple on hover */
}

/* Subtle collapsible box */
details {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: none;
  transition: transform 0.2s ease;
}

details[open] {
  transform: scale(1.01);
  border-color: #bbb;
}

/* Content spacing inside collapsible */
.content {
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* Simple arrow icon styling */
summary::-webkit-details-marker {
  color: #4d014f;
  font-size: 1.2rem;
}

/* ---------------------------------- */
/* 🎬 Compact Collapsible Styles */
/* ---------------------------------- */

summary {
  font-family: 'Georgia', serif;
  font-size: 1rem; /* smaller font size */
  color: #4d014f;
  font-weight: bold;
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.3s ease;
}

summary:hover {
  color: #7a2365;
}

details {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  padding: 0.75rem; /* smaller padding */
  margin-bottom: 0.75rem; /* tighter spacing between entries */
  border-radius: 6px;
  box-shadow: none;
  transition: transform 0.2s ease;
  font-size: 0.95rem; /* reduce overall content font size */
}

details[open] {
  transform: scale(1.01);
  border-color: #bbb;
}

.content {
  margin-top: 0.5rem;
  line-height: 1.5;
}

summary::-webkit-details-marker {
  color: #4d014f;
  font-size: 1.1rem;
}
