@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Playfair+Display:wght@400;700&display=swap');

body {
    background-image: url('/images/wallpaper.jpg');
    background-size: cover;
    background-attachment: fixed;
    font-family: 'Playfair Display', serif;
}
.shooting-star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
.shooting-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px 2px rgba(229, 217, 182, 0.6);
    opacity: 0;
    animation: shootingStar linear infinite;
}
.shooting-star.star1 {
    top: 20%;
    left: 20%;
    animation-duration: 2s;
    animation-delay: 10s;
}
.shooting-star.star2 {
    top: 30%;
    left: 0%;
    animation-duration: 2.5s;
    animation-delay: 11s;
}
.shooting-star.star3 {
    top: 5%;
    left: 10%;
    animation-duration: 1.8s;
    animation-delay: 12s;
}
.shooting-star.star4 {
    top: 10%;
    left: 70%;
    animation-duration: 2.2s;
    animation-delay: 13s;
}
@keyframes shootingStar {
    0% {
        transform: translate(0, 0);
        opacity: 0.4;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translate(200px, 200px);
        opacity: 0;
    }
}
@media (max-width: 640px) {
    .shooting-star {
        width: 2px;
        height: 2px;
        box-shadow: 0 0 6px 1px rgba(229, 217, 182, 0.5);
    }
    .shooting-star.star1 {
        top: 30%;
        left: 25%;
        animation-duration: 1.5s;
    }
    .shooting-star.star2 {
        top: 35%;
        left: 45%;
        animation-duration: 1.8s;
    }
    .shooting-star.star3 {
        top: 55%;
        left: 35%;
        animation-duration: 1.3s;
    }
    .shooting-star.star4 {
        top: 10%;
        left: 65%;
        animation-duration: 1.6s;
    }
    @keyframes shootingStar {
        0% {
            transform: translate(0, 0);
            opacity: 0.3;
        }
        50% {
            opacity: 0.5;
        }
        100% {
            transform: translate(100px, 100px);
            opacity: 0;
        }
    }
}
header {
    background: rgba(20, 33, 61, 0.95); /* Deep navy blue */
    color: #e5d9b6; /* Sandy beige */
    text-align: center;
    padding: 1rem;
    border-bottom: 3px solid #d4a373; /* Sandy beige border */
}
header h1 {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 2.5rem;
    margin: 0;
}
header p {
    font-size: 1rem;
    margin: 0.5rem 0 0;
    color: #b0a68a; /* Muted sandy beige */
}
.book-container {
    max-width: 800px;
    margin: 2rem auto;
    background: rgba(20, 33, 61, 0.95); /* Deep navy blue */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    position: relative;
    opacity: 0.8;
    border: 2px solid #d4a373; /* Sandy border */
}
.page-image {
    max-width: 75%;
    height: auto;
    border: 5px solid #d4a373; /* Sandy beige border */
    border-radius: 10px;
    transition: transform 0.5s ease;
}
.page-image:hover {
    transform: scale(1.02);
}
.nav-button {
    background: #2d3748; /* Dark blue-gray */
    color: #e5d9b6; /* Sandy beige text */
    padding: 1rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}
.nav-button:hover {
    background: #4a5568; /* Lighter blue-gray */
}
.pagination {
    color: #e5d9b6;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}
.toc-container {
    width: 300px; /* Fixed width for consistency */
    background: rgba(20, 33, 61, 0.95);
    border-radius: 10px;
   /* border: 2px solid #d4a373; */
    padding: 0;
    opacity: 0.8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 120px;
    left: 50%;
    transform: none;
    z-index: 100;
    border: 2px solid #d4a373; /* Sandy border */
    padding: 10px;
    margin-left: .5rem;
}

.toc-container.dragging {
    transform: none;
}


.toc-container.hidden {
    max-height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}
.toc-container:not(.hidden) {
    max-height: 300px; /* Increased to accommodate content */
    opacity: 1;
}

.toc-header {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1rem;
    color: #e5d9b6;
    text-align: center;
    padding: 0.5rem;
    cursor: move;
}

.toc-hide {
    font-size: 0.6rem;
    color: #facc15;
    margin-top: 0.5rem;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    display: block;
    text-align: center;
}
.toc-hide:hover {
    background: #e6b800;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}


.toc-list li:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}




.toc-list::-webkit-scrollbar {
    width: 6px;
}
.toc-list::-webkit-scrollbar-track {
    background: rgba(20, 33, 61, 0.5);
}
.toc-list::-webkit-scrollbar-thumb {
    background: #d4a373;
    border-radius: 3px;
}
.toc-list li {
    padding: 0.5rem 1rem;
}
.toc-list a {
    color: #e5d9b6;
    text-decoration: none;
    font-size: 0.7rem;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.toc-list a:hover {
    color: #f5e6cc;
    background: rgba(255, 255, 255, 0.05);
}
.toc-list a.current-poem {
    font-weight: bold;
    color: #facc15;
}

.toc-toggle{
    margin-top: 15px;
}

/* Music Player Container */
.music-player {
background: rgba(20, 33, 61, 0.95);
color: #e5d9b6;
padding: 0.75rem;
border-radius: 10px;
border: 2px solid #d4a373; /* Sandy border */
backdrop-filter: blur(5px);
width: 260px;
position: fixed;
bottom: 20px;
right: 20px;
z-index: 9999;
cursor: move;
font-size: 0.85rem;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
user-select: none;
opacity: 0.8;
}

/* Album Art with Pulse + Glow */
.album-art {
width: 60px;
height: 60px;
border-radius: 5px;
object-fit: cover;
border: 2px solid #d4a373;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-art.playing {
animation: pulse 2.5s ease-in-out infinite;
box-shadow: 0 0 12px 3px #d4a373aa; /* Soft glowing sand light */
}

@keyframes pulse {
0%   { transform: scale(1); box-shadow: 0 0 10px 2px #d4a37388; }
50%  { transform: scale(1.05); box-shadow: 0 0 18px 4px #d4a373ee; }
100% { transform: scale(1); box-shadow: 0 0 10px 2px #d4a37388; }
}

/* Control Buttons */
.music-player button {
background: #d4a373;
color: #14213d;
padding: 0.3rem 0.5rem;
border-radius: 5px;
transition: background 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}

.music-player button:hover {
background: #e6b800;
}

.music-player svg {
width: 16px;
height: 16px;
}



/* Visualizer */
.visualizer {
width: 100%;
height: 40px;
border-radius: 5px;
background: rgba(20, 33, 61, 0.3);
margin-top: 0.5rem;
}

/* Seek Bar */
input[type="range"] {
width: 100%;
height: 4px;
margin-top: 0.25rem;
background: #d4a373;
border-radius: 3px;
appearance: none;
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
width: 10px;
height: 10px;
background: #f5e6cc;
border-radius: 50%;
border: none;
}

/* Tracklist Toggle Link */
#tracklistToggle {
font-size: 0.6rem;
color: #facc15;
margin-top: 0.5rem;
text-decoration: underline;
background: none;
border: none;
cursor: pointer;
}

/* Tracklist Container */
#tracklistContainer {
max-height: 120px;
overflow-y: auto;
margin-top: 0.25rem;
border-top: 1px solid rgba(255,255,255,0.1);
padding-top: 0.25rem;
font-size: 0.6rem;
}

/* Scrollbar Theming (WebKit-based) */
#tracklistContainer::-webkit-scrollbar {
width: 6px;
}
#tracklistContainer::-webkit-scrollbar-track {
background: rgba(20, 33, 61, 0.5);
}
#tracklistContainer::-webkit-scrollbar-thumb {
background: #d4a373;
border-radius: 3px;
}

/* Tracklist Links (Like Table Rows) */
.track-row {
display: block;
padding: 4px 6px;
text-decoration: none;
color: #e5d9b6;
}
.track-row:hover {
background-color: rgba(255, 255, 255, 0.05);
color: #f5e6cc;
}
.track-row:nth-child(even) {
background-color: rgba(255, 255, 255, 0.03);
}
.track-row.now-playing {
font-weight: bold;
color: #facc15;
}

footer {
    background: rgba(20, 33, 61, 0.95); /* Deep navy blue */
    color: #e5d9b6; /* Sandy beige */
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    border-top: 3px solid #d4a373; /* Sandy beige border */
    height: 50px;
}
footer a {
    color: #e6b800; /* Brighter sand tone */
    text-decoration: none;
    transition: color 0.3s ease;
}
footer a:hover {
    color: #f5e6cc; /* Light sandy beige */
}

.subfooter {
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

@media (min-width: 1024px) {
    .music-player {
    top: auto;
    bottom: 20px;
    left: 20px;
    right: auto;
    }
}
@media (max-width: 640px) {
        #mini-player {
          display: flex !important;
          justify-content: center;
          align-items: center;
          position: fixed;
          bottom: 64px; /* Adjust based on footer height */
          left: 0;
          right: 0;
          padding: 12px;
          z-index: 50;
          box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
        }

        header h1 {
            font-family: 'Cinzel Decorative', cursive;
            font-size: 1rem;
            margin: 0;
        }
        header p {
            font-size: .75rem;
            margin: 0.5rem 0 0;
            color: #b0a68a; /* Muted sandy beige */
        }

        .book-container {
            max-width: 800px;
            margin: auto auto;
            background: rgba(20, 33, 61, 0.95); /* Deep navy blue */
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            padding: 2rem;
            position: relative;
            opacity: 0.8;
            border: 2px solid #d4a373; /* Sandy border */
        }
        .pagination {
            font-size: 0.8rem;
            margin-top: 0.5rem;
            margin-bottom: 0.75rem;
        }
        .music-player {
            display: none;
        }

        .toc-container {
            position: static;
            width: auto;
            margin: 0 auto;
            padding: 0.5rem;
            transform: none;
        }
        .toc-hide {
            font-size: 0.6rem;
            padding: 0.3rem 0.75rem;
            margin: 0.3rem auto 0;
        }
        .toc-list a {
            font-size: 0.85rem;
            padding: 0.3rem 0.75rem;
        }
        
      }

/* Pulsing glow for the album art thumbnail */
.playing-glow {
    animation: miniPulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px 2px #d4a373aa;
  }
  @keyframes miniPulse {
    0%,100% { transform: scale(1);  box-shadow: 0 0 6px 2px #d4a37388; }
    50%     { transform: scale(1.1); box-shadow: 0 0 12px 4px #d4a373ee; }
  }
  
  /* Mini‑player container */
  #mini-player {
    display: flex;
    justify-content: center;
    position: fixed;
    bottom: 64px;  /* above the main footer */
    left: 0; right: 0;
    padding: 0.5rem 1rem;
    background: rgba(20,33,61,0.95);
    border-top: 2px solid #d4a373;
    z-index: 50;
    color: rgb(229 217 182 / var(--tw-text-opacity, 1));
  }
  #mini-player.hidden {
    display: none;
  }
  
  /* Inner layout */
  .mini-container {
    width: 100%;
    max-width: 800px;
    align-items: center;
  }
  
  /* Album art thumb */
  .mini-album-art {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #d4a373;
  }
  
  /* Text + viz */
  .mini-info {
    display: flex;
    align-items: center;
  }
  .mini-info .text-xs {
    font-size: 0.75rem;
    color: #e5d9b6;
  }
  .mini-visualizer {
    width: 40px;
    height: 6px;
    margin-left: 0.5rem;
    background: rgba(20,33,61,0.3);
    border-radius: 2px;
  }
  
  /* Control buttons */
  .mini-controls button {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: #e5d9b6;
    cursor: pointer;
    padding: 0 0.25rem;
  }
  .mini-controls button:hover {
    color: #f5e6cc;
  }
  
  /* Expand icon (hidden on mobile) */
  .expand-icon {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: #e5d9b6;
    cursor: pointer;
  }
  @media (max-width: 640px) {
    .expand-icon { display: none; }
  }
