/* Virtual Office Tour - 管理画面スタイル */

.vot-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
}

.vot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.vot-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.vot-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

/* ツアー一覧テーブル */
.vot-list-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.vot-list-table th,
.vot-list-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.vot-list-table th {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.vot-list-table tr:last-child td {
    border-bottom: none;
}

.vot-list-table tr:hover td {
    background: rgba(var(--primary-rgb), 0.05);
}

.vot-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.vot-badge.is-public {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.vot-badge.is-private {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
}

.vot-empty {
    padding: var(--space-8);
    text-align: center;
    color: var(--text-secondary);
}

/* フォーム */
.vot-form {
    background: var(--bg-card);
    padding: var(--space-6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.vot-form-row {
    margin-bottom: var(--space-4);
}

.vot-form-row label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
    color: var(--text-primary);
}

.vot-form-row input[type=text],
.vot-form-row input[type=url],
.vot-form-row textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-family: inherit;
}

.vot-form-row textarea {
    min-height: 80px;
    resize: vertical;
}

.vot-form-hint {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.vot-form-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

/* シーン一覧 */
.vot-scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.vot-scene-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.vot-scene-card:hover {
    box-shadow: var(--shadow-md);
}

.vot-scene-thumb {
    width: 100%;
    aspect-ratio: 2 / 1;
    background: var(--bg-card) center/cover no-repeat;
    display: block;
}

.vot-scene-thumb.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.vot-scene-info {
    padding: var(--space-3);
}

.vot-scene-title {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.vot-scene-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.vot-scene-actions {
    padding: 0 var(--space-3) var(--space-3);
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* マップ編集 */
.vot-map-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.vot-map-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.vot-map-marker {
    position: absolute;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    margin-top: -32px;
    background: #ef4444;
    color: #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: auto;
}

.vot-map-marker span {
    transform: rotate(45deg);
}

.vot-map-marker.current {
    background: #10b981;
    z-index: 2;
}

/* Pannellum 表示 */
.vot-viewer {
    width: 100%;
    height: 480px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ボタン */
.vot-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vot-btn:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.vot-btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.vot-btn.primary:hover {
    background: var(--primary-dark);
}

.vot-btn.danger {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.vot-btn.danger:hover {
    background: #dc2626;
}

.vot-btn.sm {
    padding: 4px 10px;
    font-size: var(--text-xs);
}

/* 公開URL表示ボックス */
.vot-public-url-box {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    word-break: break-all;
}

.vot-public-url-box .label {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
    display: block;
    color: var(--text-secondary);
}

.vot-public-url-box a {
    color: var(--primary);
}

.vot-embed-box {
    margin-top: var(--space-2);
    padding: var(--space-3);
    background: var(--bg-secondary, rgba(0,0,0,0.03));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.vot-embed-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.vot-embed-box .label {
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
}

.vot-embed-code {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    padding: var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
}

/* アラート */
.vot-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}

.vot-alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.vot-alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.vot-alert.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 公開ビューア用 */
.vot-public-body {
    margin: 0;
    padding: 0;
    background: #111;
    color: #fff;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
}

.vot-preview-badge {
    position: fixed;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.6);
    color: #fbbf24;
    border-radius: 4px;
    font-size: 12px;
    z-index: 20;
    pointer-events: none;
}

.vot-public-title-on-map {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    padding-top: 8px;
}

/* 未配置シーンボタン（マップ下）: 旧 .vot-back-to-map を流用していたので残す */
.vot-back-to-map {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.vot-back-to-map:hover {
    background: rgba(255,255,255,0.25);
}

/* 360°ビュー内「← マップを見る」リンク（ミニマップの直上） */
.vot-map-link {
    position: absolute;
    left: 0;
    bottom: 100%;
    margin-bottom: 6px;
    padding: 8px 14px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
    pointer-events: auto;
}

.vot-map-link:hover {
    background: rgba(0,0,0,0.8);
}

@media (max-width: 600px) {
    .vot-map-link { font-size: 12px; padding: 6px 12px; }
}

.vot-public-map {
    padding: 24px;
    text-align: center;
}

.vot-public-map .vot-map-wrapper {
    max-width: 1000px;
    background: transparent;
    border: none;
}

.vot-public-map .vot-map-wrapper img {
    cursor: default;
    border-radius: 6px;
}

.vot-public-map .vot-map-marker {
    cursor: pointer;
    background: #0ea5e9;
    transition: transform var(--transition-fast);
}

.vot-public-map .vot-map-marker:hover {
    background: #0284c7;
    transform: rotate(-45deg) scale(1.15);
}

.vot-public-viewer {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1;
}

.vot-scene-label {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    z-index: 5;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* === ミニマップ（Pannellum オーバーレイ）=== */
/* container を画像の実サイズに合わせる（max 240px に収まる範囲で auto）。
   固定サイズで object-fit: contain にすると、縦長/横長の画像で余白が生じ、
   マーカーの % 座標が画像表示域とズレるため。 */
.vot-minimap {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    overflow: visible;
    z-index: 6;
    pointer-events: none;
}
.vot-minimap img {
    border-radius: 5px;
}
.vot-minimap img {
    display: block;
    max-width: 240px;
    max-height: 240px;
    width: auto;
    height: auto;
}
.vot-mm-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
    background: rgba(14,165,233,0.85);
    box-shadow: 0 0 2px rgba(0,0,0,0.6);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.1s;
}
.vot-mm-marker:hover {
    transform: scale(1.3);
    background: rgba(14,165,233,1);
}
.vot-mm-marker.current {
    background: #10b981;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    z-index: 2;
}
.vot-mm-fan {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    transform-origin: center;
    z-index: 1;
}
@media (max-width: 600px) {
    .vot-minimap img { max-width: 160px; max-height: 160px; }
    .vot-mm-fan { width: 64px; height: 64px; }
}

/* === 公開ビューア: ホットスポット（THETA 風: 白い山形 + 下にラベル）=== */
/* cssClass 指定時は pnlm-hotspot クラスが付かないので .vot-arrow-hotspot 単独でセレクタ */
.vot-arrow-hotspot {
    /* visibility は Pannellum が inline style で動的制御する（ビュー内/外）ため CSS で固定しない。
       .pnlm-hotspot-base の visibility:hidden は Pannellum render 前の初期値として効くが、
       render 後は inline style が優先されるので問題ない。 */
    width: 80px;
    height: 70px;
    margin: -20px 0 0 -40px; /* 山形の頂点が yaw/pitch の位置に来るよう調整 */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20' fill='none' stroke='white' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'><polyline points='4,16 20,4 36,16'/></svg>");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 64px auto;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
    cursor: pointer;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    transition: transform 0.15s;
    position: absolute;
}
.vot-arrow-hotspot:hover {
    transform: scale(1.08);
}
.vot-arrow-label {
    display: block;
    position: absolute;
    top: 38px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    letter-spacing: 0.02em;
}

/* === 編集画面: 向きハンドル === */
.vot-dir-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    cursor: grab;
    user-select: none;
    touch-action: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 3;
}
.vot-dir-handle:active { cursor: grabbing; }

/* === Pannellum コントロール: 大きい丸アイコンに上書き（公開ビューア用） === */
/* シーン遷移中に見える背景を body と同じ黒に（デフォルトの白地+模様を打ち消し） */
.vot-public-viewer .pnlm-container {
    background: #111;
}

/* ローディング表示: デフォルト非表示。一定時間を超えたら JS で .vot-show-slow を付けて表示 */
.vot-public-viewer .pnlm-load-box,
.vot-public-viewer .pnlm-lbox {
    display: none !important;
}
.vot-public-viewer .pnlm-load-box.vot-show-slow,
.vot-public-viewer .pnlm-lbox.vot-show-slow {
    display: block !important;
}

/* Pannellum の位置決め親 .pnlm-controls-container を右上に */
.vot-public-viewer .pnlm-controls-container {
    top: 16px;
    left: auto;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 外枠は消す（個別ボタンで丸く作り直し） */
.vot-public-viewer .pnlm-controls {
    border: none;
    background: transparent;
    box-shadow: none;
    margin-top: 0;
    border-radius: 0;
}

/* スプライト画像（+ / - / □ のアイコン）を無効化し CSS で描画 */
.vot-public-viewer .pnlm-sprite {
    background-image: none !important;
}

/* zoom-controls は +/- が縦積みになる 48x104 の箱 */
.vot-public-viewer .pnlm-zoom-controls {
    width: 48px;
    height: 104px;
    position: relative;
}

.vot-public-viewer .pnlm-zoom-in,
.vot-public-viewer .pnlm-zoom-out,
.vot-public-viewer .pnlm-fullscreen-toggle-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);
    transition: background-color 0.15s;
    position: absolute;
    left: 0;
}

.vot-public-viewer .pnlm-zoom-in { top: 0; }
.vot-public-viewer .pnlm-zoom-out { bottom: 0; top: auto; border-top: 1px solid rgba(255,255,255,0.25); }
.vot-public-viewer .pnlm-fullscreen-toggle-button { position: relative; }

.vot-public-viewer .pnlm-zoom-in:hover,
.vot-public-viewer .pnlm-zoom-out:hover,
.vot-public-viewer .pnlm-fullscreen-toggle-button:hover {
    background-color: rgba(0,0,0,0.85);
}

/* +（ズームイン）: 横棒 + 縦棒 */
.vot-public-viewer .pnlm-zoom-in::before,
.vot-public-viewer .pnlm-zoom-in::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 1px;
}
.vot-public-viewer .pnlm-zoom-in::before { width: 18px; height: 2px; }
.vot-public-viewer .pnlm-zoom-in::after  { width: 2px;  height: 18px; }

/* −（ズームアウト）: 横棒のみ */
.vot-public-viewer .pnlm-zoom-out::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 18px; height: 2px; border-radius: 1px;
}

/* フルスクリーン: 角が欠けた四隅アイコン */
.vot-public-viewer .pnlm-fullscreen-toggle-button::before,
.vot-public-viewer .pnlm-fullscreen-toggle-button::after {
    content: '';
    position: absolute;
    width: 8px; height: 8px;
    border: 2px solid #fff;
    background: transparent;
}
.vot-public-viewer .pnlm-fullscreen-toggle-button::before {
    left: 12px; top: 12px;
    border-right: none; border-bottom: none;
}
.vot-public-viewer .pnlm-fullscreen-toggle-button::after {
    right: 12px; bottom: 12px;
    border-left: none; border-top: none;
}

@media (max-width: 600px) {
    .vot-public-viewer .pnlm-zoom-controls { width: 44px; height: 96px; }
    .vot-public-viewer .pnlm-zoom-in,
    .vot-public-viewer .pnlm-zoom-out,
    .vot-public-viewer .pnlm-fullscreen-toggle-button { width: 44px; height: 44px; }
}
