/* 自己紹介動画モーダル */
.intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.intro-modal-visible {
    opacity: 1;
}

.intro-modal-closing {
    opacity: 0;
}

/* 背景オーバーレイ */
.intro-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

/* モーダルコンテンツ */
.intro-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    z-index: 10001;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 閉じるボタン（シンプル） */
.intro-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 300;
    line-height: 1;
}

.intro-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.intro-modal-close:active {
    transform: scale(0.95);
}

/* 動画ラッパー */
.intro-video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #000;
}

/* SAMPLEバッジ */
.intro-video-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(10, 186, 181, 0.95) 0%, rgba(0, 160, 160, 0.95) 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 6px;
    z-index: 10;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(10, 186, 181, 0.3);
    pointer-events: none;
}

/* 動画 */
.intro-video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80vh;
    object-fit: contain;
}

/* スマホ対応（縦動画優先） */
@media (max-width: 768px) {
    .intro-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .intro-modal-close {
        top: -10px;
        right: -10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .intro-video-wrapper {
        border-radius: 12px;
    }
    
    .intro-video {
        max-height: 85vh;
    }
    
    .intro-video-badge {
        top: 12px;
        left: 12px;
        padding: 5px 12px;
        font-size: 10px;
    }
}

/* 超小型デバイス */
@media (max-width: 480px) {
    .intro-modal-content {
        width: 98%;
    }
    
    .intro-modal-close {
        top: -8px;
        right: -8px;
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-width: 2px;
    }
    
    .intro-video {
        max-height: 90vh;
    }
    
    .intro-video-badge {
        top: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 9px;
    }
}

/* タブレット横向き */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .intro-modal-content {
        max-width: 600px;
    }
    
    .intro-video {
        max-height: 75vh;
    }
}

/* アクセシビリティ: モーション削減の設定がある場合 */
@media (prefers-reduced-motion: reduce) {
    .intro-modal {
        transition: none;
    }
    
    .intro-modal-content {
        animation: none;
    }
    
    .intro-modal-close {
        transition: none;
    }
    
    .intro-modal-close:hover {
        transform: scale(1.05);
    }
}

/* ローディング状態（動画読み込み中） */
.intro-video-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #0ABAB5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

.intro-video-wrapper:has(.intro-video[readyState="4"])::before {
    display: none;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .intro-modal-overlay {
        background-color: rgba(0, 0, 0, 0.92);
    }
}
