* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #cc0000;
    --primary-red-hover: #ff0000;

    --bg-color: #f9f9f9;
    --surface-color: #ffffff;
    --border-color: #ccc;
    --text-color: #0f0f0f;
    --text-color-light: #606060;
    --item-hover-bg: #e0e0e0;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.home {
    display: inline-block;
    width: fit-content;
}

.home img {
    display: inline-block;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#searchBox {
    flex: 1;
    padding: 2px;
    font-size: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: 4px;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    background: var(--primary-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: var(--primary-red-hover);
}

.main-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex: 1 1 auto;
    min-height: 0;
}

.video-player {
    flex: 0 0 auto;
}

#videoPlayer,
video {
    width: 100%;
    height: auto;
}

video {
    width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-info {
    margin-top: 15px;
}

.video-info h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.video-info p {
    color: var(--text-color-light);
    line-height: 1.6;
}

.sidebar {
    flex: 1 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    -ms-overflow-style: none;
    /* IE, Edge */
    scrollbar-width: none;
    /* Firefox */
}

.scroll-hidden::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.results {
    display: grid;
    gap: 15px;
}

.video-item {
    display: flex;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.video-item:hover {
    background: var(--item-hover-bg);
}

.video-item img {
    width: 168px;
    height: 94px;
    object-fit: cover;
    border-radius: 8px;
}

.video-details {
    flex: 1;
}

.video-details h3 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.video-details small {
    color: var(--text-color-light);
    font-size: 12px;
}

.hidden {
    display: none;
}

@media (max-width: 800px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        max-width: 100%;
    }
}

.slide-switch {
    display: inline-block;
    position: relative;
    width: 3em;
    height: 1.5em;
    border-radius: 1.5em;
    overflow: hidden;
}

.slide-switch input {
    display: none;
}

.slide-switch span {
    position: absolute;
    display: block;
    width: 4.5em;
    height: 100%;
    left: 0;
    background-color: #E3E3E3;
    transition: all 300ms linear;
}

.slide-switch span::before {
    content: 'ON';
    position: absolute;
    display: inline-block;
    right: .3em;
    color: white;
    font-size: 0.8em;
    line-height: 2em;
}

.slide-switch span::after {
    content: '';
    position: absolute;
    display: block;
    width: 1.3em;
    height: 1.3em;
    border-radius: 1.3em;
    left: 1.6em;
    top: 0.1em;
    background-color: white;
}

.slide-switch input:checked~span {
    left: -1.5em;
    background-color: limegreen;
}

.options {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid #000;

}

.quality {
    display: block;
}

@media(min-width:800px) {
    .video-player {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media(min-width:1200px) {
    .video-player {
        flex: 0 0 60%;
        max-width: 60%;
    }
}

.duration {
    border: 1px solid black;
    width: fit-content;
    margin: 3px;
    padding: 3px;
}


.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 1000;

    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.loading-bar.show {
    transform: translateY(0);
}

.loading-bar.hide {
    transform: translateY(-100%);
}

.drop-table #droptable {
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 0px;
    padding-bottom: 0px;
    background: orange;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}


.options {
    display: flex;
    /* display:noneではなくflexのままにする */
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #000;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.options.show {
    max-height: 300px;
    /* 十分な高さ */
    opacity: 1;
    background-color: rgba(240, 131, 0, 0.2);
    text-align: center;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    /* これで「ホーム」が左、「設定」が右になります */
    align-items: center;
    /* 上下の中心を揃えて同じ高さに見せます */
    padding: 10px 20px;
    /* 画面端に密着しすぎないよう余白を調整 */
    width: 100%;
    /* 横幅いっぱい */
    box-sizing: border-box;
}

.home img {
    display: block;
    height: 30px;
    /* アイコンのサイズはお好みで */
    width: auto;
}

.settings {
    position: relative;
    /* 詳細設定メニュー(options)をボタンの下に出すために必要 */
}

/* 詳細設定メニューが右端からはみ出さないように調整 */
.options {
    position: absolute;
    right: 0;
    /* 右側に合わせる */
    top: 100%;
    /* ボタンのすぐ下に配置 */
    z-index: 100;
    /* 他の要素より上に表示 */
    /* 背景色や枠線などは既存のスタイルを維持してください */
}