/* ヒトヤク動画プレーヤー専用CSS */

/* 動画モーダルのアニメーション */
#video-modal {
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* 動画コンテナのアニメーション */
#video-modal .relative.w-full {
    animation: videoSlideIn 0.4s ease-out;
}

@keyframes videoSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 動画サムネイルのホバー効果 */
.video-play-btn {
    transition: all 0.3s ease;
}

.video-play-btn:hover {
    transform: translateY(-2px);
}

/* 再生ボタンのアニメーション */
.video-play-btn .fa-play {
    transition: all 0.3s ease;
}

.video-play-btn:hover .fa-play {
    transform: scale(1.1);
}

/* プログレスバーのアニメーション */
#progress-bar {
    transition: width 1s linear;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #3b82f6);
    background-size: 200% 100%;
    animation: progressGlow 2s ease-in-out infinite;
}

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

/* 動画コントロールのホバー効果 */
#video-controls button {
    transition: all 0.2s ease;
}

#video-controls button:hover {
    color: #60a5fa !important;
    transform: scale(1.1);
}

/* ローディングアニメーション */
#video-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* 動画情報パネルのアニメーション */
#video-modal .bg-white.rounded-lg.p-4 {
    animation: infoPanelSlideUp 0.5s ease-out 0.2s both;
}

@keyframes infoPanelSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* サムネイル画像の効果 */
.video-thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.video-thumbnail-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-thumbnail-container:hover::before {
    opacity: 1;
}

/* 動画統計バッジ */
.video-stats-badge {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* フルスクリーン対応 */
#video-modal:fullscreen {
    padding: 0;
}

#video-modal:fullscreen .relative.w-full {
    max-width: none;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#video-modal:fullscreen .bg-white.rounded-lg.p-4 {
    display: none;
}

/* 動画の縦横比維持 */
.aspect-video {
    aspect-ratio: 16 / 9;
}

/* エラー状態のスタイル */
.video-error-state {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.video-error-state button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.video-error-state button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* メディアクエリ - レスポンシブ対応 */
@media (max-width: 768px) {
    #video-modal .relative.w-full {
        margin: 1rem;
    }
    
    #video-controls {
        padding: 0.75rem;
    }
    
    #video-controls .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .video-play-btn .w-20.h-20 {
        width: 4rem;
        height: 4rem;
    }
    
    .video-play-btn .fa-play {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    #video-modal {
        padding: 1rem;
    }
    
    #video-modal .bg-white.rounded-lg.p-4 {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    #video-modal h3 {
        font-size: 1.25rem;
    }
    
    .video-thumbnail-container img {
        border-radius: 8px;
    }
}

/* アクセシビリティ対応 */
@media (prefers-reduced-motion: reduce) {
    #video-modal,
    #video-modal .relative.w-full,
    #progress-bar,
    .video-play-btn,
    #video-controls button {
        animation: none !important;
        transition: none !important;
    }
}

/* ハイコントラスト対応 */
@media (prefers-contrast: high) {
    #video-controls {
        background: rgba(0, 0, 0, 0.9);
    }
    
    #video-controls button {
        border: 1px solid currentColor;
    }
    
    #progress-bar {
        background: #ffffff !important;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    #video-modal .bg-white {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    #video-modal .text-gray-800 {
        color: #f9fafb;
    }
    
    #video-modal .text-gray-600 {
        color: #d1d5db;
    }
    
    #video-modal .text-gray-500 {
        color: #9ca3af;
    }
}

/* 動画コンテンツのアニメーション */
.video-content-animation {
    animation: contentReveal 0.8s ease-out;
}

@keyframes contentReveal {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 統計数値のカウントアップ効果 */
.stat-number {
    font-variant-numeric: tabular-nums;
    transition: all 0.5s ease;
}

.stat-number.counting {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* CTA ボタンの強化 */
.video-cta-button {
    position: relative;
    overflow: hidden;
}

.video-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.video-cta-button:hover::before {
    left: 100%;
}

/* 閉じるボタンの強化 */
#close-video {
    background: rgba(0, 0, 0, 0.5);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#close-video:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* キーボードフォーカス対応 */
button:focus-visible,
.video-play-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 動画の読み込み状態表示 */
.video-loading-dots {
    animation: loadingDots 1.5s infinite;
}

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

.video-loading-dots:nth-child(2) { animation-delay: 0.3s; }
.video-loading-dots:nth-child(3) { animation-delay: 0.6s; }