/* Digital Earth Voyage - CSS Styling (Minimal Edition) */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Space+Grotesk:wght@300;400;600&display=swap');

:root {
    --bg-color: #030712;
    --accent-blue: #00f2fe;
    --text-primary: #f3f4f6;
    --text-muted: rgba(255, 255, 255, 0.5);
    --nav-bg: rgba(0, 0, 0, 0.2);
    --nav-hover-bg: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
}

/* 全画面動画プレイヤーラッパー */
#player-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* YouTubeの黒帯を隠して全画面表示にするためのアスペクト比調整 */
#player-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 Ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 Ratio */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* 映像の上に被せるビネット効果 */
.screen-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 60%, rgba(3, 7, 18, 0.5) 100%);
    z-index: 2;
    pointer-events: none;
}

/* --- UI レイヤー --- */
.ui-container {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none; /* 下のiframeのロードイベントなどを妨げない */
}

/* ナビゲーションボタン (フローティング矢印) */
.nav-btn {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    width: 60px;
    height: 80px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.3;
}

.nav-btn svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    transition: transform 0.2s;
}

.nav-btn:hover {
    opacity: 0.9;
    background: var(--nav-hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.left-btn {
    left: 20px;
}

.left-btn:hover svg {
    transform: translateX(-4px);
}

.right-btn {
    right: 20px;
}

.right-btn:hover svg {
    transform: translateX(4px);
}

/* センターボトムのロケーションタイトル表示 */
.location-display {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--text-primary);
    opacity: 0.75;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    background: rgba(3, 7, 18, 0.6);
    padding: 8px 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* --- 起動画面レイヤー --- */
#intro-screen {
    position: absolute;
    inset: 0;
    background-color: var(--bg-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* サイバーグリッド背景 */
#intro-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(18, 24, 38, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 24, 38, 0.5) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
    mask-image: radial-gradient(circle, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    pointer-events: none;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 500px;
    padding: 40px;
    z-index: 102;
}

.intro-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 32px;
    letter-spacing: 6px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-subtitle {
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--accent-blue);
    text-transform: uppercase;
    margin-bottom: 40px;
    font-family: 'Share Tech Mono', monospace;
}

.start-button {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 16px 40px;
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 4px;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.start-button:hover {
    background: var(--accent-blue);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
    transform: scale(1.05);
}

/* シネマティックなカメラトランジションレイヤー */
#transition-overlay {
    position: absolute;
    inset: 0;
    background-color: var(--bg-color);
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ローダー・レーダーアニメーション */
.radar-scanner {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 50%;
    margin-bottom: 20px;
}

.radar-scanner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: rotate 2s linear infinite;
}

.radar-glow {
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(127, 0, 255, 0.2);
    border-radius: 50%;
}

.transition-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--accent-blue);
    animation: pulse 1.5s infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* モバイルレスポンシブ調整 */
@media (max-width: 768px) {
    .nav-btn {
        width: 44px;
        height: 60px;
    }
    
    .left-btn {
        left: 10px;
    }
    
    .right-btn {
        right: 10px;
    }
    
    .location-display {
        bottom: 25px;
        font-size: 11px;
        padding: 6px 12px;
        letter-spacing: 2px;
    }
    
    .intro-title {
        font-size: 24px;
    }
}

/* --- Camera Directory (SEO & LLMO) --- */
.camera-directory-accordion {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 50;
    pointer-events: auto;
    font-family: 'Space Grotesk', sans-serif;
}

/* 閉じた状態の概要トグル */
.directory-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(3, 7, 18, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px;
    border-radius: 30px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 11px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1.5px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    list-style: none; /* デフォルトの矢印を消す */
}

.directory-summary::-webkit-details-marker {
    display: none; /* Safari用矢印消去 */
}

.directory-summary:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
    transform: translateY(-2px);
}

.summary-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    color: var(--accent-blue);
}

.chevron-icon {
    font-size: 8px;
    transition: transform 0.3s;
    opacity: 0.7;
}

.camera-directory-accordion[open] .chevron-icon {
    transform: rotate(180deg);
}

/* 開いた状態のコンテンツ（モーダルオーバーレイ風） */
.camera-directory-accordion[open] .directory-content {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: calc(100vw - 40px);
    max-width: 900px;
    max-height: calc(100vh - 120px);
    background: rgba(3, 7, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 16px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* スクロールバーのカスタマイズ */
.camera-directory-accordion[open] .directory-content::-webkit-scrollbar {
    width: 6px;
}
.camera-directory-accordion[open] .directory-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

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

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.directory-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.directory-section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--accent-blue);
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
    padding-bottom: 6px;
    text-transform: uppercase;
}

.directory-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.directory-item {
    transition: transform 0.2s;
}

.directory-item:hover {
    transform: translateX(4px);
}

.directory-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.directory-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* アクティブなカメラのスタイル */
.directory-link.active-cam {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.directory-link.active-cam .cam-name {
    color: var(--accent-blue);
    font-weight: 600;
}

.cam-name {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cam-location {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* スマホ表示の調整 */
@media (max-width: 768px) {
    .camera-directory-accordion {
        bottom: auto;
        top: 20px;
        left: 20px;
    }
    
    .camera-directory-accordion[open] .directory-content {
        top: 70px;
        left: 10px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 100px);
        padding: 20px;
    }
    
    .directory-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

