/* ============================================
   movie.php 専用（MOVIE 一覧ページ）
   カードは top.php の MOVIE セクションと同デザイン。レイアウトはグリッド。
   ============================================ */

#movie {
    padding-top: 80px;
    padding-bottom: 80px;
    justify-content: flex-start;
    position: relative;
}

/* タイトルバウンス（SCHEDULE同様 グレー→ピンク） */
#movie .title-bounce {
    animation: textBounceGrey 5s ease-in-out infinite;
}
#movie .title-bounce:nth-child(1) { animation-delay: 0s; }
#movie .title-bounce:nth-child(2) { animation-delay: 0.4s; }
#movie .title-bounce:nth-child(3) { animation-delay: 0.8s; }
#movie .title-bounce:nth-child(4) { animation-delay: 1.2s; }
#movie .title-bounce:nth-child(5) { animation-delay: 1.6s; }

#movie h2 {
    color: #6e6e6e;
    position: relative;
    z-index: 2;
    font-weight: 300;
    -webkit-text-stroke: 5px #ffffff;
    text-stroke: 5px #ffffff;
    paint-order: stroke fill;
}

#movie h2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 5px);
    width: 1180px;
    height: 15px;
    background: linear-gradient(90deg,
        #ffcfe3 0%,
        #eaeaff 40%,
        #eaeaff 60%,
        #ffcfe3 100%);
    background-size: 200% 100%;
    border-radius: 5px;
    z-index: -1;
    animation: borderGradientFlow 10s ease-in-out infinite;
}

@keyframes borderGradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 一覧グリッド（PC: 幅に応じて最大4列・中央寄せ） */
.movie-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px);
    justify-content: center;
    gap: 36px 20px;
    margin: 40px auto 0;
    max-width: 1180px;
    width: 100%;
}

/* ===== カード（top.php の MOVIE と同一デザイン） ===== */
.movie-card-slot {
    width: 280px;
    height: 550px;
}
.movie-card {
    position: relative;
    width: 280px;
    height: 550px;
    background-image: url('../images/schedulecard_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform-origin: top left;
    cursor: pointer;
}

/* メディア（縦長動画） */
.movie-card-media {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 234px;
    height: 320px;
    background-color: #f0f0f0;
    overflow: hidden;
    z-index: 1;
}
.movie-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: #f0f0f0;
}
.movie-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding-left: 3px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 3;
}

/* 名前・サイズ・ハッシュタグ */
.movie-card-name {
    position: absolute;
    top: 380px;
    left: 50%;
    transform: translateX(-50%);
    width: 234px;
    font-family: "Yu Mincho", "YuMincho", serif;
    color: #6e6e6e;
    text-align: center;
}
.movie-card-name .name-main { font-size: 30px; }
.movie-card-name .name-age { font-size: 14px; }

.movie-card-size {
    position: absolute;
    top: 427px;
    left: 50%;
    transform: translateX(-50%);
    width: 234px;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 13px;
    color: #6e6e6e;
    text-align: center;
}

.movie-card-tags {
    position: absolute;
    top: 462px;
    left: 50%;
    transform: translateX(-50%);
    width: 234px;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 14px;
    color: #bf9ce2;
    text-align: center;
    line-height: 1.6;
    word-break: break-word;
}
.movie-card-2 .movie-card-tags { color: #48ddd2; }

/* ===== 動画ポップアップ（枠のみ） ===== */
.movie-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}
.movie-popup-overlay.active { display: flex; }
.movie-popup-container { position: relative; max-width: 100%; }
.movie-popup-video-wrap {
    width: min(360px, 86vw);
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
#moviePopupVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}
.movie-popup-close {
    position: absolute;
    top: -46px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

/* ===== ページネーション（20件/ページ） ===== */
.movie-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 48px auto 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.movie-pagination .pagination-btn {
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 16px;
    padding: 8px 15px;
    border: 2px solid rgba(191, 156, 226, 0.4);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.85);
    color: #333333;
    cursor: pointer;
    transition: all 0.3s ease;
}
.movie-pagination .pagination-btn:hover:not(.active):not(:disabled) {
    background: rgba(191, 156, 226, 0.18);
    border-color: rgba(191, 156, 226, 0.7);
    transform: translateY(-2px);
}
.movie-pagination .pagination-btn.active {
    background: linear-gradient(135deg, #bf9ce2 0%, #48ddd2 100%);
    border-color: #bf9ce2;
    color: #ffffff;
    font-weight: bold;
}
.movie-pagination .pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.movie-pagination .pagination-info {
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 14px;
    color: #666666;
    padding: 0 10px;
}

/* ページ外カードの非表示 */
.movie-card-slot.hidden { display: none; }

/* ===== SP: 2列 + カード縮小（top.php の MOVIE と同じ縮小率） ===== */
@media screen and (max-width: 768px) {
    #movie { padding-top: 40px; padding-bottom: 50px; }
    #movie h2::before { width: 90%; }
    .movie-list {
        grid-template-columns: repeat(2, 168px);
        gap: 28px 12px;
        max-width: 100%;
    }
    .movie-card-slot { width: 168px; height: 330px; }   /* 550 * 0.6 */
    .movie-card { transform: scale(0.6); }

    .movie-pagination { gap: 8px; margin-top: 36px; }
    .movie-pagination .pagination-btn { font-size: 13px; padding: 6px 11px; }
    .movie-pagination .pagination-info { font-size: 12px; width: 100%; text-align: center; }
}

/* === MOVIE: 会員限定 / 空表示（ATTENDA DB連携 追加分） === */
.movie-members-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    background: #c9a227;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: .03em;
}
.movie-card.is-members .movie-play-icon {
    background: rgba(0, 0, 0, .45);
    border-radius: 50%;
}
.movie-popup-video-wrap {
    position: relative;
}
.movie-popup-members-note {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, .85);
    border-radius: 8px;
}
.movie-popup-members-note i { font-size: 34px; color: #c9a227; }
.movie-popup-members-note p { margin: 0; font-size: 15px; letter-spacing: .05em; }
.movie-empty { text-align: center; color: #888; padding: 40px 0; width: 100%; }

/* === MOVIE: 長い名前のマーキー表示（追加分） === */
.movie-card-name { overflow: hidden; white-space: nowrap; }
.movie-card-name .name-main { display: inline-block; white-space: nowrap; }
.movie-card-name.is-marquee { text-align: left; }
.movie-card-name.is-marquee .name-main {
    animation: movieNameMarquee linear infinite alternate;
    animation-duration: var(--marquee-dur, 6s);
}
@keyframes movieNameMarquee {
    from { transform: translateX(0); }
    to   { transform: translateX(var(--marquee-dist, 0)); }
}

/* === MOVIE 一覧: フィルタバー（追加分） === */
.movie-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 960px;
    margin: 20px auto 24px;
    padding: 0 12px;
}
.movie-filter-input,
.movie-filter-select {
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 14px;
    color: #4a4a4a;
    background: #fff;
    border: 1px solid #d9c9b0;
    border-radius: 6px;
    padding: 8px 12px;
    box-sizing: border-box;
}
.movie-filter-input { flex: 1 1 220px; min-width: 180px; }
.movie-filter-select { flex: 0 0 auto; cursor: pointer; }
.movie-filter-count { font-size: 12px; color: #8a8a8a; white-space: nowrap; }
/* PC: 1行に収め、段落ちを防ぐ（検索入力が伸びすぎないよう縮小可に） */
@media (min-width: 601px) {
    .movie-filter-bar { flex-wrap: nowrap; }
    .movie-filter-input { flex: 1 1 320px; min-width: 280px; }
    .movie-filter-select { max-width: 240px; }
}
@media (max-width: 600px) {
    .movie-filter-input,
    .movie-filter-select { flex: 1 1 100%; }
}

/* MOVIE 会員限定ポップアップ内のログインボタン */
.movie-popup-members-note .movie-popup-login-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 9px 22px;
    font-size: 14px;
    color: #fff;
    background: #c9a227;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.05em;
}
.movie-popup-members-note .movie-popup-login-btn:hover { background: #b38f1f; }
