/* 基本設定 */
:root {
    --primary-color: #00A0E9;
    --primary-dark-color: #007BCC;
    --text-color: #333;
    --light-text-color: #fff;
    --bg-color: #f8f9fa;
    --container-bg-color: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --panel-width: 300px;
    --panel-height: 533px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 背景の模様 */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(135deg, rgba(0, 160, 233, 0.05) 25%, transparent 25%),
        linear-gradient(225deg, rgba(0, 160, 233, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, rgba(0, 160, 233, 0.05) 25%, transparent 25%),
        linear-gradient(315deg, rgba(0, 160, 233, 0.05) 25%, var(--bg-color) 25%);
    background-size: 80px 80px;
    z-index: -1;
    opacity: 0.6;
}

/* メインコンテンツ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 5;
}


/* ロゴ */
.logo-container {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
    /* ロゴと動画プレイヤーの間の余白 */
}

.logo-image {
    width: 500px;
    /* ロゴの基本サイズを指定 */
    max-width: 100%;
    /* コンテナより大きくはならないように */
    height: auto;
}


.main-title {
    font-size: 2.5rem;
    color: var(--primary-dark-color);
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.main-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2.5rem;
}

/* --- プレイヤー スタイル --- */
.shorts-player {
    width: 100%;
    padding: 4rem 0 1rem;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.main-video-container {
    position: relative;
    width: 100%;
    height: var(--panel-height);
    perspective: 2500px;
    margin-bottom: 0;
    transform-style: preserve-3d;
}

.main-video-panel {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--panel-width);
    height: var(--panel-height);
    margin-left: calc(var(--panel-width) / -2);
    background-color: #000;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #555;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.5s ease;
    will-change: transform, opacity;
    pointer-events: none;
    /* クリックイベントを無効化 */
}

/* アクティブなパネルのみクリックを有効化 */
.main-video-panel.active {
    pointer-events: auto;
}

.main-video-panel .youtube-player,
.main-video-panel iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 24px;
}

.main-video-panel video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

/* ナビゲーションボタン */
.nav-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.2s ease;
    color: var(--text-color);
    z-index: 20;
}

.nav-btn:hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev {
    left: calc(50% - 450px);
}

.nav-btn.next {
    right: calc(50% - 450px);
}

/* 説明エリア */
.video-info-area {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin: 0 auto 2.5rem auto;
    box-sizing: border-box;
    /* 追加: paddingを含めて幅を計算 */
}

#video-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-dark-color);
}

#video-description {
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
}

/* サムネイルプレイリスト */
.thumbnail-playlist {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
    /* 追加: paddingを含めて幅を計算 */
}

.playlist-item {
    background-color: var(--container-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    width: 160px;
    border: 2px solid transparent;
}

.playlist-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.playlist-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 160, 233, 0.3);
}

.playlist-thumbnail {
    width: 100%;
    height: 90px;
    background-color: #e9ecef;
    overflow: hidden;
}

.playlist-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-info {
    padding: 0.75rem;
}

.playlist-title {
    font-weight: 700;
    margin: 0;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* フッター */
.page-footer {
    text-align: center;
    padding: 3rem 1rem 2rem;
    margin-top: 4rem;
    color: #888;
    font-size: 0.9rem;
}

.back-to-top {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    text-decoration: none;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    transition: background-color 0.2s ease;
}

.back-to-top:hover {
    background-color: var(--primary-dark-color);
}

.copyright {
    margin: 0;
}


/* --- レスポンシブ対応 (スマートフォン向け) --- */
@media screen and (max-width: 768px) {
    :root {
        --panel-width: 240px;
        --panel-height: 426px;
    }

    .main-content {
        padding: 1rem;
    }

    /* ロゴのサイズを調整 */
    .logo-image {
        width: 90%;
        max-width: 300px;
    }

    .main-title {
        font-size: 1.8rem;
        margin-top: 1.5rem;
    }

    .main-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .shorts-player {
        padding: 2rem 0;
    }

    .nav-btn {
        top: 40%;
        /* 垂直位置をPC版と揃える */
        width: 40px;
        height: 40px;
    }

    /* ナビゲーションボタンの位置をパネルの横に調整 */
    .nav-btn.prev {
        left: calc(50% - var(--panel-width) / 2 - 45px);
    }

    .nav-btn.next {
        right: calc(50% - var(--panel-width) / 2 - 45px);
    }

    .video-info-area {
        margin: 0 auto 2rem auto;
        padding: 1rem;
    }

    #video-title {
        font-size: 1.2rem;
    }

    #video-description {
        font-size: 0.9rem;
    }

    .thumbnail-playlist {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0.5rem 1rem 1rem 1rem;
        gap: 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .thumbnail-playlist::-webkit-scrollbar {
        display: none;
    }

    .playlist-item {
        flex-shrink: 0;
        width: 140px;
    }
}

/* 外部リンク */
.external-link-container {
    text-align: center;
    margin: 3rem 0;
}

.external-link-button {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark-color));
    color: var(--light-text-color);
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 204, 0.4);
    border: none;
    position: relative;
    overflow: hidden;
}

.external-link-button::after {
    content: '→';
    position: absolute;
    right: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.external-link-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 123, 204, 0.6);
    padding-right: 4.5rem;
}

.external-link-button:hover::after {
    opacity: 1;
    right: 2rem;
}