/* デモ動画モーダルスタイル */
.modal {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none !important;
}

.modal.is-open {
    display: flex !important;
}

.modal__backdrop {
    cursor: pointer;
}

.modal__content {
    transform: translateY(20px);
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal__close {
    transition: all 0.2s ease;
}

.modal__close:hover {
    transform: scale(1.1);
}

.modal__close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.modal.closing {
    animation: fadeOut 0.3s ease-in;
}

.modal.closing .modal__content {
    animation: slideDown 0.3s ease-in;
}

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

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

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal__content {
        max-width: 95vw;
        margin: 0 10px;
    }
    
    .modal__close {
        top: 2px;
        right: 2px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ローディング状態 */
.video-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* フォーカス表示の改善 */
.modal button:focus,
.modal video:focus {
    outline: 2px solid #3A8DFF;
    outline-offset: 2px;
}

/* ビデオの品質向上 */
#coreaxVideo {
    object-fit: contain;
    background-color: #000;
}

/* アクセシビリティ: 動きを減らす設定に対応 */
@media (prefers-reduced-motion: reduce) {
    .modal,
    .modal__content,
    .modal.closing,
    .modal.closing .modal__content {
        animation: none;
        transition: none;
    }
    
    .video-loading::after {
        animation: none;
    }
}