/* Recipe Book - Pastel Pixel Style */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

:root {
  --pink: #e8b4b8;
  --peach: #edd1b0;
  --cream: #faf6ed;
  --teal: #b8d4d4;
  --sky: #c9e4de;
  --brown: #a08070;
  --dark: #705850;
  --paper: #fffef7;
}

body {
  min-height: 100vh;
  background: url('pink_clouds.gif') center center;
  background-size: cover;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  overflow: hidden;
}

/* Hint text */
.hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  color: var(--dark);
  padding: 10px 20px;
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  box-shadow:
    4px 4px 0 var(--pink),
    inset -2px -2px 0 rgba(0,0,0,0.1);
  border: 2px solid var(--dark);
  z-index: 100;
}

/* Book Container */
.book-container {
  perspective: 1500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The Book */
.book {
  position: relative;
  width: 350px;
  height: 450px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.book:hover:not(.open) {
  transform: rotateY(-5deg) translateY(-5px);
}

/* Book Cover */
.book-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  transform-origin: left center;
}

.book.open .book-cover {
  transform: rotateY(-160deg);
}

.cover-front {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--pink);
  border: 4px solid var(--dark);
  box-shadow:
    6px 6px 0 var(--dark),
    inset -4px -4px 0 rgba(0,0,0,0.15),
    inset 4px 4px 0 rgba(255,255,255,0.3);
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.cover-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, var(--brown) 0%, var(--pink) 100%);
  border-right: 2px solid var(--dark);
  transform: translateZ(-2px);
}

.cover-inner {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pixel-border {
  background: var(--cream);
  border: 4px solid var(--dark);
  padding: 25px 20px;
  text-align: center;
  box-shadow:
    inset -3px -3px 0 rgba(0,0,0,0.1),
    inset 3px 3px 0 rgba(255,255,255,0.5);
}

.cover-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  filter: drop-shadow(2px 2px 0 var(--dark));
}

.cover-title {
  font-family: 'VT323', monospace;
  font-size: 2.4rem;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 2px 2px 0 var(--pink);
}

.cover-stars {
  margin-top: 10px;
  color: var(--brown);
  font-size: 1.2rem;
  letter-spacing: 8px;
}

/* Book Pages (when open) */
.book-pages {
  position: absolute;
  width: 800px;
  height: 450px;
  left: 20px;
  display: flex;
  background: var(--cream);
  border: 4px solid var(--dark);
  box-shadow: 6px 6px 0 var(--dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease 0.3s;
}

.book.open .book-pages {
  opacity: 1;
  pointer-events: auto;
}

.page {
  flex: 1;
  padding: 25px;
  position: relative;
  background: var(--paper);
}

.left-page {
  border-right: 2px dashed var(--brown);
}

.page-spine {
  width: 4px;
  background: var(--peach);
}

.page-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Index Page */
.index-title {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  color: var(--dark);
  text-align: center;
  margin-bottom: 20px;
}

.recipe-list {
  list-style: none;
  flex: 1;
}

.recipe-list li {
  display: flex;
  align-items: baseline;
  margin: 15px 0;
  font-size: 1.3rem;
  color: var(--dark);
}

.recipe-name {
  flex-shrink: 0;
}

.dots {
  flex: 1;
  border-bottom: 2px dotted var(--brown);
  margin: 0 8px;
  height: 0.5em;
}

.page-num {
  color: var(--brown);
  flex-shrink: 0;
}

.page-footer {
  margin-top: auto;
  text-align: center;
}

.back-link {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--brown);
  text-decoration: none;
  padding: 5px 15px;
  border: 2px solid var(--brown);
  transition: all 0.2s;
}

.back-link:hover {
  background: var(--pink);
  color: var(--dark);
}

/* Recipe Page */
.recipe-header {
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--brown);
}

.recipe-title {
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  color: var(--dark);
}

.recipe-columns {
  display: flex;
  gap: 15px;
  flex: 1;
}

.recipe-section {
  flex: 1;
}

.recipe-section h4 {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--brown);
  margin-bottom: 10px;
  border-bottom: 2px solid var(--pink);
  padding-bottom: 5px;
}

.recipe-section ul,
.recipe-section ol {
  font-size: 1rem;
  color: var(--dark);
  line-height: 1.1;
  padding-left: 18px;
}

.recipe-section li {
  margin: 1px 0;
}

/* Page Spreads */
.page-spread {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Page Navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}

.nav-btn {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--brown);
  background: var(--cream);
  border: 2px solid var(--brown);
  padding: 5px 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--pink);
  color: var(--dark);
}

/* Empty page placeholder */
.empty-page {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  font-size: 1.2rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
  .book {
    width: 220px;
    height: 290px;
  }

  .book-pages {
    width: 440px;
    height: 290px;
  }

  .cover-title {
    font-size: 1.8rem;
  }

  .page {
    padding: 15px;
  }

  .recipe-columns {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 500px) {
  .book-pages {
    width: 260px;
    flex-direction: column;
    height: auto;
    min-height: 350px;
  }

  .page-spine {
    width: 100%;
    height: 2px;
  }

  .left-page {
    border-right: none;
    border-bottom: 2px dashed var(--brown);
  }
}
