body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    background-color: #333;
    overflow: hidden;
}

.nintendo-3ds {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.top-screen, .bottom-screen {
    width: 100%;
    height: 50vh;
    display: flex;
    flex-direction: column;
    background-color: #333;  
}

.top-screen {
    justify-content: center;
    align-items: center;
    gap: 0px;
}

#youtube-banner {
    width: 100%;  
    height: auto; 
    max-height: 50%;  
    object-fit: contain;  
    margin-top: 10px;  
}

#loading-gif {
    max-width: 20%;  
    max-height: 20%;
}

.bottom-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: hidden; 
}

#video-results {
    display: flex;
    flex-direction: column; 
    align-items: center;  
    justify-content: flex-start;  
    flex-grow: 1;
    overflow-y: auto; 
    padding: 20px 0 120px 0; 
    width: 100%;
    box-sizing: border-box;
    gap: 10px;  
    max-height: calc(100% - 50px); 
    position: relative;
    z-index: 1;
}

.youtube-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;  
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;  
    background-color: #000;  
    z-index: 5;  
    box-sizing: border-box; 
    margin-bottom: 0;
}

.youtube-controls button[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
}

.youtube-logo-controls {
    height: 25px;  
    max-width: 120px;  
    object-fit: contain;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background-color: transparent;  
}

#search-icon-btn, #settings-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;  
    cursor: pointer;
    padding: 5px;  
    min-width: 30px;  
}

#search-icon-btn {
    margin-left: auto;
}

#video-search {
    flex-grow: 1;
    margin: 0 5px;  
    background-color: #444;
    color: #fff;
    border: 1px solid #555;
    max-width: 200px;  
}

#search-btn {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 5px;  
}

#settings-btn {
    margin-right: 10px;
}

.video-thumbnail {
    width: 320px;  
    height: 240px; 
    object-fit: cover;
    cursor: pointer;
    background-color: #444;  
    margin: 5px 0; 
}

.video-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    margin-right: 10px;
}

.settings-panel {
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 100%; 
    background-color: #000;
    transition: left 0.3s ease-in-out;
    z-index: 20;
}

.settings-panel.open {
    left: 0;
}

.settings-content {
    padding: 20px;
    color: white;
    height: 100%; 
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.settings-header h2 {
    margin: 0;
    color: white;
}

.settings-header button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    margin-right: 10px;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signin-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%; 
    padding: 0 20px; 
    box-sizing: border-box;
    background-color: #000; 
    max-height: 250px;  
    overflow-y: auto;   
    scrollbar-width: thin;
    scrollbar-color: #888 #333;
}

.signin-options::-webkit-scrollbar {
    width: 8px;
}

.signin-options::-webkit-scrollbar-track {
    background: #333;
}

.signin-options::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

.signin-options::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

.signin-button {
    background-color: #444;
    color: white;
    border: 1px solid #555;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; 
    max-width: none; 
    padding: 15px;
    border-radius: 0; 
    font-weight: bold;
    cursor: pointer;
    margin: 0; 
}

.signin-button img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.google-signin {
    background-color: #444;
    color: white;
}

.google-plus-signin {
    background-color: #444;
    color: white;
}

#create-account {
    background-color: #444;
    color: white;
}

#google-plus-signin {
    background-color: #dd4b39;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
}

.top-screen.settings-active {
    background-color: #333; 
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #333;
    margin: 15% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 500px;
    color: white;
    text-align: center;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.account-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.account-type-btn {
    background-color: white;
    color: #333;
    border: none;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.account-type-btn:hover {
    background-color: #f0f0f0;
}

.login-icon-container {
    position: absolute;
    top: 20%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10; 
}

.login-icon-text {
    position: absolute;
    top: 70%; 
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 16px;
    z-index: 10;
}

.login-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    background-color: #333;
    z-index: 100;
    padding: 20px;
    box-sizing: border-box;
    display: none;
}

.login-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    color: white;
    height: 100%;
}

.login-form {
    width: 80%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.login-form input {
    padding: 10px;
    background-color: #444;
    border: none;
    color: white;
}

.login-form button {
    padding: 10px;
    background-color: #4285F4;
    color: white;
    border: none;
    cursor: pointer;
}

.bottom-screen-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: flex-end;
}

.bottom-screen-modal .modal-content {
    background-color: #333;
    width: 100%;
    max-width: none;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    color: white;
    position: relative;
    max-height: 70%;
    overflow-y: auto;
}

.bottom-screen-modal .close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.bottom-screen-modal .account-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

.bottom-screen-modal .account-options::-webkit-scrollbar {
    width: 8px;
}

.bottom-screen-modal .account-options::-webkit-scrollbar-track {
    background: #444;
}

.bottom-screen-modal .account-options::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.bottom-screen-modal .account-options::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.bottom-screen-modal .account-type-btn {
    background-color: #444;
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.bottom-screen-modal .account-type-btn:hover {
    background-color: #555;
}

.single-account-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    text-align: center;
    z-index: 1000;
}

.bottom-screen .profile-slide-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 10;
}

.bottom-screen .profile-slide-container.slide-in {
    transform: translateX(0);
}

.bottom-screen .profile-slide-container.slide-out {
    transform: translateX(100%);
}

.bottom-screen .profile-view {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    text-align: center;
}

.bottom-screen .profile-back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.bottom-screen .profile-view .profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
}

.bottom-screen .profile-view h2 {
    margin: 0 0 10px 0;
}

.bottom-screen .profile-view p {
    margin: 0;
}

.websim-feature-divider {
    width: 100%;
    height: 1px;
    background-color: #555;
    margin: 10px 0;
}

.websim-feature-label {
    color: #aaa;
    text-align: center;
    font-size: 12px;
    margin: 10px 0;
}

.bottom-screen-modal .import-video-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.bottom-screen-modal .import-video-content input {
    padding: 10px;
    background-color: #444;
    border: none;
    color: white;
}

.bottom-screen-modal .import-video-content button {
    padding: 10px;
    background-color: #4285F4;
    color: white;
    border: none;
    cursor: pointer;
}

#imported-video-controls {
    background-color: #222 !important;
}



#video-container {
    display: none; 
    width: 100%;
    height: auto;  
    max-height: calc(50vh - 60px); 
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#video-container iframe {
    width: 100%;  
    max-width: 320px;  
    height: auto;
    max-height: 240px; 
    object-fit: contain;
    margin: 0 auto;  
}

#bottom-thumbnail-container {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.8);
    z-index: 5;
    max-height: calc(100% - 90px);
}

.bottom-video-thumbnail {
    width: 320px;
    height: 240px;
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}

/* Sliding playback overlay image */
.play-overlay-image {
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: cover;
    position: absolute;
    left: 0;
    bottom: 170px; /* sit very close above the 40px-tall black controls bar */
    z-index: 15; /* above video list and other content */
    pointer-events: none; /* keep video list and controls clickable */
}

/* Slide in from right */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInFromRight 0.3s ease-out forwards;
}