/* Lights on Cabana Theme - Library Bookshelf Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%);
  background-attachment: fixed;
  color: #FFFFFF;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Header */
.simple-header {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
  color: white;
  text-align: center;
}

.simple-header h1 {
  color: #FFD700;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin: 0.5rem 0;
}

.simple-header a {
  color: #87CEEB;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.simple-header a:hover {
  color: #FFD700;
}

.subtitle {
  color: #87CEEB;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  margin-top: 0.5rem;
}

/* Library Container */
.library-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem 1rem;
}

.library {
  perspective: 1500px;
}

/* Back Button */
#back-btn { 
  position: fixed; 
  top: 15px; 
  left: 15px; 
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.95) 0%, rgba(178, 34, 34, 0.95) 100%);
  border: 2px solid #FFD700; 
  color: #FFD700; 
  padding: 10px 20px; 
  border-radius: 25px; 
  text-decoration: none;
  font-weight: bold;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6), 
              0 0 15px rgba(255, 215, 0, 0.4);
}

#back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 
              0 0 25px rgba(255, 215, 0, 0.6);
}

/* Bookshelf Frame */
.bookshelf-frame {
  background: #5d4037;
  border: 10px solid #4e342e;
  border-radius: 8px;
  padding: 20px;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.5), 0 20px 40px rgba(0,0,0,0.4);
  max-width: 900px;
  margin: 40px auto;
  width: 95%;
}

/* Crown Molding */
.bookshelf-top {
  height: 45px;
  background: #4e342e;
  margin: -10px -25px 0 -25px;
  position: relative;
  border-radius: 4px 4px 2px 2px;
  box-shadow: 
    0 4px 0 #3e2723,
    0 8px 15px rgba(0,0,0,0.4),
    inset 0 10px 0 #5d4037;
  border-bottom: 2px solid #3e2723;
  z-index: 10;
}

.bookshelf-top::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 5%;
  width: 90%;
  height: 8px;
  background: #5d4037;
  border-radius: 10px 10px 0 0;
  opacity: 0.8;
}

.snow-pile {
  position: absolute;
  top: -12px;
  left: 15%;
  width: 70%;
  height: 18px;
  background: white;
  border-radius: 50% 50% 0 0;
  filter: blur(1px);
  z-index: 11;
}

.bookshelf-base {
  height: 30px;
  background: #3e2723;
  margin: 0 -15px;
}

/* --- SHELF (DESKTOP: 4 BOOKS) --- */
.shelf {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Desktop: 4 books per shelf */
  gap: 30px;
  margin-bottom: 60px;
  padding: 20px 40px 10px 40px;
  background: linear-gradient(to bottom, #2c1b18, #1a0f0d); 
  border: 4px solid #3d2622;
  border-bottom: none;
  box-shadow: inset 0 10px 30px rgba(0,0,0,0.8);
  position: relative;
  justify-items: center;
  align-items: end;
  animation: bookSlideIn 0.6s ease forwards; /* MOVED HERE */
}

/* Wood Base */
.shelf::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -4px;
  right: -4px;
  height: 20px; 
  background: #5d4037;
  background-image: url('../images/wood-pattern.png');
  border: 1px solid rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  border-radius: 0 0 4px 4px;
}

/* Book Styles */
.book {
  height: 210px;
  width: 100%;
  max-width: 80px;
  background: var(--book-color, #c0392b);
  border-radius: 2px 8px 8px 2px;
  position: relative;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  cursor: pointer;
  background-image: linear-gradient(
    90deg, 
    rgba(0,0,0,0.4) 0%, 
    rgba(255,255,255,0.1) 20%, 
    rgba(255,255,255,0.1) 80%, 
    rgba(0,0,0,0.4) 100%
  );
  box-shadow: 
    5px 5px 15px rgba(0,0,0,0.5),
    inset 2px 0 5px rgba(255,255,255,0.2);
}

/* Book Spine */
.book-spine {
  width: 100%;
  height: 100%;
  padding: 1rem;
  background-image: url('../images/dark-leather.png');
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Gold Foil Bands */
.book::before {
  content: '';
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 0;
  right: 0;
  border-top: 2px solid rgba(255, 215, 0, 0.4);
  border-bottom: 2px solid rgba(255, 215, 0, 0.4);
  pointer-events: none;
}

/* 3D Pages Effect */
.book::after {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 100%;
  width: 40px;
  background: #e0e0e0;
  background-image: repeating-linear-gradient(
    to bottom,
    #e0e0e0,
    #e0e0e0 2px,
    #d1d1d1 3px
  );
  transform-origin: left;
  transform: rotateY(90deg);
  border: 1px solid #999;
  border-left: none;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Hover Effects */
.book:not(.empty):not(.placeholder):hover {
  transform: translateZ(50px) rotateY(-25deg);
  box-shadow: 
    20px 20px 40px rgba(0,0,0,0.6),
    0 0 30px rgba(255, 215, 0, 0.3);
  border-color: #FFD700;
  z-index: 10;
}

.book:not(.empty):not(.placeholder):hover::after {
  opacity: 1;
}

/* Placeholder Books */
.book.placeholder {
  opacity: 0.7;
  cursor: default;
}

.book.placeholder:hover {
  transform: translateY(-5px);
  opacity: 0.85;
}

.book.placeholder .book-spine {
  font-style: italic;
  opacity: 0.8;
}

/* Empty Books */
.book.empty {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.book.empty .book-spine {
  opacity: 0.5;
  font-size: 0.8rem;
}

/* Decorations */
.decoration, .decorationlarge {
  display: flex;
  justify-content: center;
  align-items: center;
}

.decoration {
  font-size: 2.5rem;
  padding-bottom: 5px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

.decorationlarge {
  font-size: 4.5rem;
  padding-bottom: 0px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

/* Cursor Styles */
div.book {
  cursor: default;
}

a.book {
  cursor: pointer;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #87CEEB;
  margin-top: 2rem;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablets and small laptops */
@media (max-width: 968px) {
  .bookshelf-frame {
    width: 95%;
    padding: 15px;
  }

  .shelf {
    gap: 20px;
    padding: 20px 10px 10px 10px;
  }
}

/* Mobile Phones - 3 BOOKS PER SHELF */
@media (max-width: 600px) {
  .shelf {
    grid-template-columns: repeat(2, 1fr) !important; /* Mobile: 2 books per shelf */
    gap: 15px;
    padding: 15px 10px 5px 10px;
    margin-bottom: 40px; /* Space between the visual "shelves" */
  }

  .book {
    height: 160px;
    max-width: 90px;
  }

  .book-spine {
    font-size: 0.75rem;
  }
}

/* Very Small Phones */
@media (max-width: 380px) {
  .shelf {
    gap: 10px;
    padding: 10px 5px 5px 5px;
  }

  .book {
    height: 140px;
    max-width: 60px;
  }

  .book-spine {
    font-size: 0.65rem;
  }

  .decoration {
    font-size: 1.5rem;
  }

  .decorationlarge {
    font-size: 2.5rem;
  }
}

/* Animations */
@keyframes bookSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shelf:nth-child(1) { animation-delay: 0.1s; }
.shelf:nth-child(2) { animation-delay: 0.2s; }
.shelf:nth-child(3) { animation-delay: 0.3s; }
.shelf:nth-child(4) { animation-delay: 0.4s; }