body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: sans-serif;
    overflow: hidden;
    touch-action: manipulation;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

#logoImg {
    height: 40px;
    width: auto;
}

#controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#controls button,
#youtubeSearchInput {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

#youtubeSearchInput {
    width: min(28vw, 280px);
}

.search-panel {
    position: relative;
}

#youtubeSearchForm {
    display: flex;
    align-items: center;
}

#youtubeSearchResults {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(420px, 80vw);
    max-height: min(65vh, 480px);
    overflow-y: auto;
    background: #171717;
    border: 1px solid #555;
    border-radius: 8px;
    z-index: 20;
}

#youtubeSearchResults:not(:empty) {
    display: block;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 0;
    text-align: left;
}

.search-result:hover {
    background: #333;
}

.search-message {
    padding: 12px;
    color: #ddd;
    font-size: 13px;
}

.search-result img {
    width: 120px;
    height: 68px;
    flex: none;
    object-fit: cover;
}

.search-result-details {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.search-result-details strong,
.search-result-details span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#controls button:active {
    background: #fff;
    color: #000;
}

#statusArea {
    font-size: 12px;
    color: #aaa;
}

main {
    flex-grow: 1;
    position: relative;
}

#videoContainer {
    width: 100%;
    height: 100%;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    border: none;
}

footer {
    padding: 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    font-size: 12px;
    color: #888;
}

#loadingSpinner {
    color: #fff;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#authModal {
    display: flex;
}
