/* ══════════════════════════════════════════════════════════════
   Gelibolu Revival — 3B Rölyef Harita katmanı (three.js overlay)
   ══════════════════════════════════════════════════════════════ */

.scene3d-host {
    position: fixed;
    z-index: 2;
    display: none;
    background: #10141d;
    overflow: hidden;
}

/* yer adı etiketleri (CSS2D) */
.scene3d-place {
    color: #f2e6cf;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px #000, 0 0 8px #000a;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(14, 16, 20, .35);
    border: 1px solid rgba(242, 222, 171, .18);
    white-space: nowrap;
    transform: translateY(-6px);
    pointer-events: none;
    user-select: none;
}

/* hover tooltip (birim adı) */
.scene3d-tooltip {
    position: fixed;
    z-index: 30;
    pointer-events: none;
    background: rgba(14, 16, 20, .92);
    color: #f2dfab;
    border: 1px solid rgba(242, 222, 171, .3);
    border-radius: 5px;
    padding: 4px 9px;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    box-shadow: 0 4px 16px #000a;
    max-width: 240px;
}

.scene3d-motion-caption {
    position: absolute;
    left: clamp(16px, 34vw, 500px);
    right: 18px;
    bottom: calc(var(--timeline-h, 120px) + 18px);
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 780px;
    padding: 8px 12px;
    border: 1px solid rgba(242, 222, 171, .22);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(14, 16, 20, .82), rgba(31, 28, 22, .72));
    box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
    color: #e9dcc2;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 11px;
    line-height: 1.4;
    pointer-events: none;
}
.scene3d-motion-caption strong {
    flex: 0 0 auto;
    color: #f0c768;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.scene3d-motion-caption span {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.scene3d-motion-caption.is-empty {
    opacity: .72;
}

/* 3B / 2B görünüm anahtarı */
.view3d-toggle {
    position: fixed;
    top: 64px;
    right: 14px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(20,24,30,.92), rgba(34,40,50,.92));
    border: 1px solid rgba(242, 222, 171, .28);
    color: #f2e6cf;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    cursor: pointer;
    box-shadow: 0 6px 20px #0008;
    transition: transform .15s ease, border-color .15s ease, background .2s ease;
}
.view3d-toggle:hover { transform: translateY(-1px); border-color: rgba(242, 222, 171, .55); }
.view3d-toggle .v3d-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #c4645a; box-shadow: 0 0 8px #c4645a;
}
.view3d-toggle[data-mode="2d"] .v3d-dot { background: #7a9ab0; box-shadow: 0 0 8px #7a9ab0; }
.layers-panel .view3d-toggle {
    position: static;
    width: 100%;
    justify-content: flex-start;
    padding: 8px 10px;
    border-radius: 7px;
    box-shadow: none;
    background: rgba(80, 75, 60, .12);
    border-color: var(--border-light);
    font-size: .7rem;
    color: var(--text);
}
.layers-panel .view3d-toggle:hover {
    transform: none;
    background: rgba(120, 100, 70, .2);
    border-color: var(--accent-dim);
}

/* 3B ipucu rozeti (ilk açılışta) */
.scene3d-hint {
    position: fixed;
    bottom: calc(var(--timeline-h, 120px) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(14,16,20,.86);
    border: 1px solid rgba(242,222,171,.22);
    color: #d8cfb8;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    animation: hint3dFade 6s ease forwards;
}
@keyframes hint3dFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
    12% { opacity: 1; transform: translateX(-50%) translateY(0); }
    82% { opacity: 1; }
    100% { opacity: 0; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .view3d-toggle { padding: 5px 10px; font-size: 11px; }
    .scene3d-place { font-size: 10px; }
    .scene3d-motion-caption {
        left: 18px;
        max-width: none;
    }
}
@media (max-width: 768px) {
    .view3d-toggle { top: auto; bottom: calc(var(--timeline-h, 120px) + 14px); right: 10px; padding: 6px 11px; font-size: 11px; }
    .scene3d-place { font-size: 9px; padding: 1px 3px; }
    .scene3d-motion-caption {
        left: 10px;
        right: 10px;
        bottom: calc(var(--timeline-h, 120px) + 54px);
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
        font-size: 10px;
    }
    .scene3d-motion-caption span {
        display: -webkit-box;
        overflow: hidden;
        text-overflow: clip;
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scene3d-hint { animation: none; opacity: 1; }
}
