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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 0;
    background: black;
    color: white;
    overscroll-behavior: none; /* Prevents pull-to-refresh on mobile */
    display: flex;
    flex-direction: column;
}
#controls {
    /* position: fixed; Removed fixed positioning */
    /* top: 10px; Removed */
    /* left: 50%; Removed */
    /* transform: translateX(-50%); Removed */
    /* z-index: 1000; Removed */
    margin: 10px auto; /* Centers horizontally, adds 10px top/bottom margin */
    background-color: rgba(30, 30, 30, 0.85); /* Darker, slightly more transparent */
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: flex; /* Keeps inner items (label, select) aligned */
    align-items: center; /* Aligns inner items vertically */
    width: fit-content; /* Or a specific width if preferred, ensures margin auto works for centering */
    flex-shrink: 0;
}
#controls label {
    color: #f0f0f0;
    margin-right: 8px;
    font-size: 0.9em;
}
#languageSelector {
    padding: 6px 10px;
    font-size: 0.9em;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: white;
    cursor: pointer;
}
#languageSelector:focus {
    outline: none;
    border-color: #777;
}



#logoContainer { /* Styles for the new logo container */
    text-align: center; /* Centers the image within the div */
    padding: 10px 0; /* Adds some vertical spacing */
    flex-shrink: 0; /* Prevent logo container from shrinking */
}
#logoContainer img {
    /*max-height: 60px;*/ /* Adjust as needed for your logo's size */
    width: auto; /* Maintain aspect ratio */
}


#subtitles {
    position: relative; 
    width: 100%;
    flex-grow: 1; /* Allows subtitles to take available vertical space */
    min-height: 400px;
    font-size: 8vw; 
    display: flex;
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center;
    line-height: 1.3;
    padding: 10px 20px; 
    box-sizing: border-box;
    overflow-y: auto; 
}
/* Default styling for cue containers created by vtt.js */
.cue-div {
    position: relative; /* Changed from absolute to flow naturally if multiple */
    width: auto; /* Let content define width up to max-width */
    max-width: 90%; /* Max width for readability */
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0.3em 0.6em;
    border-radius: 4px;
    margin-bottom: 0.5em; /* Space between multiple cues */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
/* Styling for text within the cue when vtt.js applies ::cue pseudo-element styling */
/* This might be overridden by .cue-div if vtt.js creates divs directly */
#subtitles::cue {
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 1em; /* Relative to #subtitles font-size */
    padding: 0.3em 0.6em;
    border-radius: 4px;
}
#messageArea {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 1001; /* Above controls */
    text-align: center;
    font-size: 1.2em;
}

#footer {
    text-align: center;
    font-size: 0.8em;
    color: #aaa;
    /*background-color: #1a1a1a;*/ /* Slightly different background for footer */
    flex-shrink: 0; /* Prevent footer from shrinking */
    /*border-top: 1px solid #333;*/ /* Optional top border */
}
#footer img {
    height: 40px; /* Adjust as needed */
    width: auto;
    vertical-align: middle;
}