html, body {
    height: 100%;
    margin: 0;
}

/* Basic reset */
body, h2, button {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page layout */
body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

/* Container styling */
#container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header styling */
header {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%; /* Ensures the header doesn't exceed the viewport width */
    box-sizing: border-box; /* Ensures padding is included in the width calculation */
}
header h1 {
    margin: 0;
}
header h3 {
    margin-left: 10px;
}
.header-title .fa-hammer {
    margin-left: 14px;
}
header a {
    color: #fff;
    text-decoration: none;
    margin-left: 10px;
}
.header-title {
    flex-grow: 1; /* Allows the title to take up as much space as needed */
    display: flex;
    align-items: center; /* Vertically centers the title */
}

/* MIDI Box */
#midi-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 20px;
    margin-right: 20px; /* More space from social media icons */
    box-sizing: border-box;
    border: 1px solid #fff; /* Box-like appearance */
    border-radius: 5px; /* Rounded corners for the box */
    padding: 8px;
    gap: 12px;
}
#midi-controls a {
    background: none;
    align-items: center;
    justify-content: center;
    margin: 0;
    display: flex;
    color: white; /* Adjust based on your header's color scheme */
    cursor: pointer;
    font-size: 12px; /* Smaller icon size */
}
#midi-controls a:focus {
    outline: none;
}

/* Optional: Add hover effect for buttons */
#midi-controls a:hover {
    color: #ccc; /* Lighten the icon color on hover */
}

.header-links {
    display: flex;
    align-items: center; /* Vertically centers the icons */
    flex-shrink: 0; /* Prevents the icons container from shrinking */
}

/* Link button styling */
.link-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    margin: 0 5px;
    cursor: pointer;
    background-color: #333;
    color: #fff;
    border: none;
    text-align: center;
    text-decoration: none;
    font-size: 1.5em;
    transition: background-color 0.3s;
    border-radius: 4px;
}

.link-button:hover {
    background-color: #555;
}

/* Sidebar button styling */
.sidebar-button, .main-button {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 10px; /* Adds space below each button */
    cursor: pointer;
    background-color: #333;
    color: #fff;
    border: none;
    text-align: center;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: normal;
    transition: background-color 0.3s;
    border-radius: 4px;
    white-space: normal; /* Allow text to wrap */
    overflow-wrap: break-word; /* Break long words */
    hyphens: auto; /* Enable hyphenation */
}


.sidebar-button:hover, .main-button:hover {
    background-color: #555;
}

.sidebar-button.active, .main-button.active {
    background-color: #4CAF50; /* Green background for active buttons */
    color: white; /* White text */
}

@media (max-width: 600px) {
    .sidebar-button, .main-button {
        font-size: 4vw; /* Responsive font size for smaller screens */
    }
}

@media (min-width: 600px) {
    .sidebar-button, .main-button {
        font-size: 1.5rem; /* Base font size for larger screens */
    }
}

.not-available {
    position: relative; /* Needed for tooltip positioning */
    cursor: not-allowed;
}

.not-available:hover {
    background-color: #d9534f;
}

.active {
    background-color: #4CAF50; /* Example: green background */
    color: white; /* White text */
}

.fa {
    vertical-align: middle;
}

/* Flex container for sidebar + main content */
.content-row {
    display: flex;
    flex: 1;
}

/* Sidebar styling */
#sidebar {
    background-color: #242424;
    padding: 20px;
    width: 20vw; /* Adjust based on preference */
    overflow-y: auto; /* In case of many items */
    overflow-x: hidden;
    flex-shrink: 0;
    margin: 0;
}

/* Main content styling */
#main-content {
    flex-grow: 1;
    padding: 20px;
    max-width: 100%;
    overflow-x: hidden;
}

.responsive-image {
    max-width: 100%; /* Makes the image scale down if its width is greater than the container */
    min-width: 60%;
    height: auto; /* Maintains the aspect ratio */
    display: block; /* Prevents inline formatting issues */
    border-radius: 8px;
    margin: auto;
}

.start-game h1 {
    text-align: center;
}

.selection-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns items to the start of the flex container */
    margin-bottom: 20px; /* Add space below each section */
}

.button-row {
    display: flex;
    width: 100%; /* Ensures the button row takes full width of the section */
}

.button-row button {
    flex: 1; /* Each button takes equal width */
    margin: 5px; /* Adds space between buttons */
}

.selection-section h2 {
    margin-bottom: 10px; /* Provides space between the heading and buttons */
}

#script-display a {
    text-decoration: none;
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px; /* Space between buttons */
    cursor: pointer;
}

#script-snippet {
    white-space: pre-wrap; /* Allows the text to wrap */
    word-wrap: break-word; /* Breaks words that are too long for one line */
    max-width: 100%; /* Prevents it from extending beyond its container */
}

/* Basic button styling */
button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px; /* Space between buttons */
    cursor: pointer;
}

/* Textarea styling */
textarea {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: calc(100% - 22px); /* Adjusting for padding and border */
    height: 200px; /* Adjust height as needed */
}

footer {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%; /* Ensures the footer doesn't exceed the viewport width */
    box-sizing: border-box; /* Ensures padding is included in the width calculation */
}

footer .footer-left, footer .footer-right {
    display: flex;
    align-items: center;
}

footer p, footer a {
    margin: 0 10px;
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Pop-up functionality */
/* Modal Background */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black for dimming background */
}

/* Modal Content for Dark Theme */
.modal-content {
    background-color: #333; /* Dark background for the content */
    margin: 5% auto; /* Adjusted for alignment */
    padding: 20px;
    border-radius: 8px; /* Rounded corners */
    width: 80%; /* Adjust based on preference, max-width can be used for responsiveness */
    color: #ddd; /* Light text for readability */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: adds depth */
    position: relative; /* For positioning the close button absolutely within the container */
    max-width: 600px; /* Maximum width to ensure content readability */
}

/* Styling for the Close Button */
.close {
    color: #aaa; /* Light grey color, ensuring visibility against the dark background */
    position: absolute; /* Positioned absolutely to align right top corner of modal content */
    top: 10px; /* Distance from top */
    right: 15px; /* Distance from right */
    font-size: 24px; /* Adjusted size */
    font-weight: normal; /* Adjust based on preference */
}

.close:hover, .close:focus {
    color: #fff; /* Changes color on hover/focus for better visibility and interaction cue */
    text-decoration: none;
    cursor: pointer;
}

/* Modal Content Headers and Text Styling */
.modal-content h2 {
    text-align: center; /* Centers the title */
    margin-bottom: 20px; /* Adds space between title and content */
}

.modal-content p {
    text-align: justify; /* Justifies the content for neat alignment */
    line-height: 1.6; /* Improves readability */
}

/* Add padding above and below "Games" in sidebar */
#sidebar h2 {
    padding-top: 10px;
    padding-bottom: 10px;
    margin-top: 10px; /* Standardize spacing across browsers */
    margin-bottom: 10px; /* Standardize spacing across browsers */
}