/* Basic Reset & Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* A more modern font */
    margin: 0;
    padding: 0;
    background-color: #121212; /* Deep black background */
    color: #f0f0f0; /* Light grey text for contrast */
    line-height: 1.6;
    scroll-behavior: smooth; /* Smooth scroll for all anchor links */
}

/* Header Styles */
header {
    background-color: #0d0d0d; /* Slightly darker than body */
    color: #00bcd4; /* Teal accent for title */
    text-align: center;
    padding: 1.5rem 0; /* More padding */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* Stronger shadow for depth */
}

h1 {
    margin: 0;
    font-size: 2.5em; /* Larger title */
    letter-spacing: 2px; /* A bit of spacing */
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.5); /* Subtle glow */
}

/* Toggle Button Styling */
#toggleNavButton {
    background-color: #9c27b0; /* Purple accent */
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin-top: 15px; /* Space from title */
    border-radius: 25px; /* Fully rounded */
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#toggleNavButton:hover {
    background-color: #d81b60; /* Pink on hover */
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Table of Contents Navigation Styles - Hidden by Default */
.table-of-contents {
    background-color: #1a1a1a; /* Darker grey for TOC */
    padding: 0 0; /* Initial padding set to 0 */
    border-bottom: 1px solid #333; /* Subtle divider */
    text-align: center;
    position: sticky;
    top: 150px; /* Adjust based on header height + button */
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);

    max-height: 0; /* Hidden by default */
    overflow: hidden; /* Hide overflow initially */
    transition: max-height 0.7s ease-in-out, padding 0.7s ease-in-out; /* Smooth transition */
}

.table-of-contents.show {
    max-height: 500px; /* Large enough for full content on larger screens */
    padding: 20px 0; /* Restore padding when shown */
    overflow-y: hidden; /* Default to hidden if not enough content to scroll */
}


.table-of-contents h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #9c27b0; /* Purple accent for "Jump to Song" */
    font-size: 1.4em;
    letter-spacing: 1px;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px; /* More space between links */
}

.table-of-contents li a {
    color: #f0f0f0; /* White text for links */
    text-decoration: none;
    padding: 8px 15px; /* Larger clickable area */
    border-radius: 20px; /* More rounded pills */
    background-color: #2a2a2a; /* Dark grey button background */
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #444; /* Subtle border */
}

.table-of-contents li a:hover,
.table-of-contents li a:focus {
    background-color: #00bcd4; /* Teal on hover */
    color: #121212; /* Dark text on hover */
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.7), 0 0 25px rgba(0, 188, 212, 0.3); /* Stronger glow effect */
    transform: translateY(-2px); /* Slight lift */
}

/* Main Content Area */
main {
    max-width: 900px; /* Slightly wider content area */
    margin: 30px auto; /* More margin */
    padding: 0 20px; /* More side padding */
}

/* Song Item Styles */
.song-item {
    background-color: #1a1a1a; /* Darker grey for song cards */
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); /* Deeper shadow */
    margin-bottom: 30px; /* More space between songs */
    padding: 25px; /* More padding inside cards */
    position: relative;
    border: 1px solid #333; /* Subtle border */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Transition for hover effect */
}

.song-item:hover {
    transform: translateY(-5px); /* Lift card on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 188, 212, 0.2); /* Highlight on hover */
}

.song-item h2 {
    color: #f0f0f0; /* White for song titles */
    margin-top: 0;
    margin-bottom: 20px; /* Space between title and lyrics */
    font-size: 1.8em;
    text-align: center;
    border-bottom: 1px solid #444; /* Divider below title */
    padding-bottom: 10px;
}

/* Lyrics Placeholder (always visible) */
.lyrics-placeholder {
    margin-top: 20px;
    padding: 15px;
    background-color: #222; /* Slightly lighter grey for lyrics box */
    border: 1px solid #444;
    border-radius: 8px;
    color: #e0e0e0; /* Off-white for lyrics text */
    font-size: 1.1em; /* Larger text for readability */
    line-height: 1.8;
}

.lyrics-placeholder p {
    margin-bottom: 10px; /* Space between paragraphs in lyrics */
    text-align: left; /* Align lyrics text to the left */
    width: 100%; /* Ensure paragraphs take full width */
}

/* Fixed "Return to Table of Contents" Button */
.fixed-return-to-top {
    position: fixed; /* Stays in place relative to the viewport */
    bottom: 20px; /* 20px from the bottom */
    right: 20px; /* 20px from the right */
    background-color: #9c27b0; /* Purple accent */
    color: #fff;
    padding: 12px 20px; /* Larger padding for better clickability */
    border-radius: 25px; /* Fully rounded pill shape */
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); /* Stronger shadow for floating effect */
    z-index: 1050; /* Ensure it's above other content */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: none; /* Hidden by default, shown by JS when scrolled down */
}

.fixed-return-to-top:hover {
    background-color: #d81b60; /* Pink on hover */
    transform: translateY(-3px); /* Lift effect on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(156, 39, 176, 0.7); /* More pronounced glow */
}


/* Footer Styles */
footer {
    text-align: center;
    padding: 25px 0;
    background-color: #0d0d0d; /* Same as header */
    color: #888; /* Dimmer text for footer */
    margin-top: 40px;
    border-top: 1px solid #333;
}

/* Mobile Responsiveness (Media Queries) */
@media (max-width: 768px) {
    header {
        padding: 1rem 0;
    }
    h1 {
        font-size: 2em;
    }

    /* Adjust sticky top for smaller header and button */
    .table-of-contents {
        top: 120px;
        padding: 0; /* Always start with 0 padding for transition */
    }
    
    .table-of-contents.show {
        padding: 15px 0; /* Smaller padding when shown on mobile */
        max-height: 60vh; /* Allow it to take up to 60% of viewport height */
        overflow-y: auto; /* IMPORTANT: Add scrollbar if content exceeds max-height */
        -webkit-overflow-scrolling: touch; /* Improves scrolling on iOS devices */
    }

    .table-of-contents h2 {
        font-size: 1.1em;
    }
    
    .table-of-contents ul {
        flex-direction: column;
        gap: 10px;
        /* Ensure ul itself doesn't cause overflow on its own */
        width: 100%; 
    }
    .table-of-contents li {
        margin: 0 auto; /* Center individual list items */
    }
    .table-of-contents li a {
        display: block; /* Make links fill their space for easier tapping */
        width: fit-content; /* Shrink button to content */
        margin: 0 auto; /* Center button within li */
    }

    main {
        margin: 20px auto;
        padding: 0 15px;
    }

    .song-item {
        padding: 20px;
        margin-bottom: 25px;
    }
    .song-item h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .lyrics-placeholder {
        font-size: 1em;
        padding: 12px;
    }

    .fixed-return-to-top {
        padding: 10px 15px;
        font-size: 0.9em;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }
    .table-of-contents li a {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    .song-item h2 {
        font-size: 1.3em;
    }
    .lyrics-placeholder {
        font-size: 0.95em;
    }
}