/**
 * TikTok Style Onboarding Guide CSS
 * ユーザー操作ガイドのアニメーション・デザイン
 * @version 1.0.0
 */

/* ===== 初回アクセス時のスクロールガイド ===== */
.scroll-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeInGuide 0.5s ease-out forwards;
    pointer-events: auto;
}

.scroll-guide-overlay.hiding {
    animation: fadeOutGuide 0.5s ease-out forwards;
}

@keyframes fadeInGuide {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOutGuide {
    from { opacity: 1; }
    to { opacity: 0; }
}

.scroll-guide-content {
    text-align: center;
    color: #fff;
}

.scroll-guide-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.scroll-guide-hand {
    font-size: 48px;
    animation: swipeUpDown 1.5s ease-in-out infinite;
}

@keyframes swipeUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.scroll-guide-arrows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.scroll-guide-arrows i {
    display: block;
    font-size: 24px;
    color: var(--primary-color, #ff007f);
    animation: arrowPulse 1s ease-in-out infinite;
}

.scroll-guide-arrows i:first-child {
    animation-delay: 0s;
}

.scroll-guide-arrows i:last-child {
    animation-delay: 0.3s;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-5px); }
}

.scroll-guide-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.scroll-guide-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.scroll-guide-dismiss {
    background: var(--primary-color, #ff007f);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.scroll-guide-dismiss:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
}

/* ===== ダブルタップ操作フィードバック ===== */
.double-tap-feedback {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 100;
}

.double-tap-feedback.left {
    left: 15%;
}

.double-tap-feedback.right {
    right: 15%;
}

.double-tap-feedback.visible {
    animation: doubleTapShow 0.8s ease-out forwards;
}

@keyframes doubleTapShow {
    0% { opacity: 0; transform: translateY(-50%) scale(0.5); }
    20% { opacity: 1; transform: translateY(-50%) scale(1.2); }
    40% { transform: translateY(-50%) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

.double-tap-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.double-tap-icon i {
    font-size: 24px;
    color: #fff;
}

.double-tap-text {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ===== 初回表示用のダブルタップヒント ===== */
.double-tap-hint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
    z-index: 50;
}

.double-tap-hint-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: hintFadeInOut 3s ease-in-out forwards;
}

.double-tap-hint-zone.left {
    animation-delay: 0.5s;
}

.double-tap-hint-zone.center {
    animation-delay: 1s;
}

.double-tap-hint-zone.right {
    animation-delay: 1.5s;
}

@keyframes hintFadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

.hint-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    animation: hintPulse 1s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hint-icon i {
    font-size: 20px;
    color: #fff;
}

.hint-text {
    font-size: 12px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: center;
}

/* ===== 再生バーの改善 ===== */
.video-progress-bar-container {
    height: 30px !important;
    padding: 10px 0;
    touch-action: none;
}

.video-progress-bar-container::after {
    height: 6px !important;
    bottom: 12px !important;
    border-radius: 3px !important;
    background: rgba(255, 255, 255, 0.25) !important;
}

.seek-progress {
    height: 6px !important;
    bottom: 12px !important;
    border-radius: 3px !important;
}

/* 再生バーのつまみ（ドラッグハンドル） */
.seek-progress::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--primary-color, #ff007f);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}

.video-slide.controls-visible .seek-progress::after,
.video-progress-bar-container:hover .seek-progress::after,
.video-progress-bar-container.dragging .seek-progress::after {
    opacity: 1;
}

/* 再生バーのスライドヒント */
.progress-bar-hint {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.progress-bar-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.video-slide.show-progress-hint .progress-bar-hint {
    opacity: 1;
    animation: hintBounce 0.5s ease-out;
}

@keyframes hintBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* ===== 漫画ページのスライドガイド ===== */
.manga-swipe-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    opacity: 0;
    animation: fadeInGuide 0.5s ease-out forwards;
    pointer-events: auto;
}

.manga-swipe-guide.hiding {
    animation: fadeOutGuide 0.5s ease-out forwards;
}

.manga-swipe-content {
    text-align: center;
    color: #fff;
}

.manga-swipe-animation {
    width: 120px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.manga-swipe-hand {
    font-size: 40px;
    position: absolute;
    left: 20%;
    animation: swipeLeftRight 2s ease-in-out infinite;
}

@keyframes swipeLeftRight {
    0%, 100% { left: 20%; opacity: 1; }
    50% { left: 70%; opacity: 0.5; }
}

.manga-swipe-arrows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 30px;
}

.manga-swipe-arrows i {
    font-size: 24px;
    color: var(--primary-color, #ff007f);
    animation: arrowFade 1s ease-in-out infinite alternate;
}

.manga-swipe-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.manga-swipe-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.manga-swipe-dismiss {
    background: var(--primary-color, #ff007f);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== シングルページ漫画のスワイプヒント ===== */
.single-manga-swipe-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    animation: slideUpFadeIn 0.5s ease-out forwards, slideDownFadeOut 0.5s ease-out 4s forwards;
}

@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes slideDownFadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.single-manga-swipe-hint i {
    font-size: 20px;
    animation: swipeHintArrow 1s ease-in-out infinite;
}

@keyframes swipeHintArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.single-manga-swipe-hint span {
    font-size: 14px;
    font-weight: 500;
}

/* ===== 漫画シングルページのスワイプガイド ===== */
.manga-swipe-guide-single {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    animation: fadeInGuide 0.5s ease-out forwards;
    cursor: pointer;
}

.manga-swipe-guide-single.hidden {
    display: none;
}

.manga-swipe-guide-single .swipe-guide-content {
    text-align: center;
    color: #fff;
}

.manga-swipe-guide-single .swipe-animation {
    width: 120px;
    height: 80px;
    margin: 0 auto 15px;
    position: relative;
}

.manga-swipe-guide-single .swipe-hand {
    font-size: 36px;
    position: absolute;
    top: 50%;
    left: 20%;
    transform: translateY(-50%);
    animation: swipeLeftRightHand 2s ease-in-out infinite;
}

@keyframes swipeLeftRightHand {
    0%, 100% { left: 20%; opacity: 1; }
    50% { left: 70%; opacity: 0.6; }
}

.manga-swipe-guide-single .swipe-arrows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 40px;
}

.manga-swipe-guide-single .swipe-arrows i {
    font-size: 20px;
    color: var(--primary-color, #ff007f);
    animation: arrowFade 1s ease-in-out infinite alternate;
}

@keyframes arrowFade {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.manga-swipe-guide-single .swipe-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.manga-swipe-guide-single .swipe-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}
