/* ============================================================
   TracePoint – style.css
   ============================================================ */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, system-ui, sans-serif;
    overflow: hidden;
    background: #0a0a0a;
    color: #e0e0e0;
}

#app { display: flex; height: 100vh; }

/* ---- PANELS ---- */
#image-panel, #map-panel {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    border-right: 1px solid #222;
}

/* ---- HEADER ---- */
.panel-header {
    height: 60px; padding: 0 16px;
    background: #151515; border-bottom: 1px solid #2a2a2a;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0; position: relative;
    gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 0.3px; }
.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

#logo {
    height: 22px;
    width: auto;
    display: block;
}

/* ---- TOOLBAR ---- */
.toolbar {
    display: flex; align-items: center; gap: 6px;
    overflow-x: auto; flex: 1;
    padding: 0 4px;
    margin-left: 24px;
    scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }

/* ---- BUTTONS ---- */
button {
    background: #1e1e1e; color: #ccc; border: 1px solid #383838;
    padding: 5px 11px; border-radius: 4px; cursor: pointer;
    font-size: 11px; white-space: nowrap; transition: background 0.15s, color 0.15s;
}
button:hover:not(:disabled) { background: #2a2a2a; color: #fff; }
button.active-mode  { background: #003a55; color: #00aaff; border-color: #00aaff; font-weight: 600; }
button.map-mode     { background: #003325; color: #00ffaa; border-color: #00ffaa; }
button:disabled     { opacity: 0.3; cursor: not-allowed; }

/* ---- LINE ITEMS ---- */
.line-item {
    display: flex; align-items: center; gap: 6px;
    background: #1a1a1a; padding: 4px 10px;
    border-radius: 4px; font-size: 11px;
    cursor: pointer; border: 1px solid #2a2a2a;
    transition: border-color 0.15s;
}
.line-item:hover    { background: #222; }
.line-item.active-line { border-color: var(--lc, #00aaff); background: #181818; }

.line-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--lc, #00aaff); flex-shrink: 0;
}
.line-label { color: #aaa; }

/* ---- POINT MANAGER ---- */
.point-manager {
    display: flex; gap: 4px;
    padding-left: 10px; border-left: 1px solid #2a2a2a;
    flex-wrap: nowrap;
}
.point-item {
    display: flex; align-items: center; gap: 3px;
    background: #1a1a1a; border: 1px solid #2e2e2e;
    padding: 2px 6px; border-radius: 10px; font-size: 10px;
    cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.point-item:hover         { background: #222; border-color: #444; }
.point-item.has-geo       { border-color: #004d33; background: #0d1f18; }
.point-item.has-geo:hover { background: #122b20; border-color: #006644; }

.pt-geo-icon {
    width: 12px; height: 12px; flex-shrink: 0;
    color: #556;
}
.point-item:hover .pt-geo-icon  { color: #aaa; }
.point-item.has-geo .pt-geo-icon { color: #00cc88; }
.pt-geo-icon.geo-active {
    animation: pulse-btn 1s infinite;
}

@keyframes pulse-btn {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.btn-delete {
    background: none; border: none; color: #554; cursor: pointer;
    padding: 0 2px; font-size: 13px; line-height: 1;
    transition: color 0.15s;
}
.btn-delete:hover { color: #ff4444; }

/* Map mode hint badge */
.map-hint {
    padding: 3px 10px; border-radius: 4px; font-size: 10px;
    border: 1px solid; animation: pulse-btn 1.2s infinite;
    white-space: nowrap; flex-shrink: 0;
}

/* ---- CONTENT AREAS ---- */
#image-container {
    flex: 1; position: relative; overflow: hidden; background: #111;
    cursor: crosshair;
}
#map-container {
    flex: 1; position: relative; overflow: hidden; background: #111;
}
#image-canvas { display: none; cursor: crosshair; position: absolute; top: 0; left: 0; }

#drop-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #333; font-size: 14px; letter-spacing: 0.5px;
    pointer-events: none;
    border: 2px dashed transparent;
    transition: color 0.2s, border-color 0.2s;
}
#image-container.drag-active #drop-overlay { border-color: #00aaff; color: #00aaff; }

/* GitHub button */
#btn-github {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex-shrink: 0;
    color: #555; border-radius: 4px;
    transition: color 0.15s;
}
#btn-github:hover { color: #fff; }
#btn-github svg   { width: 28px; height: 28px; }

/* Navbar right cluster */
.navbar-right {
    display: flex; align-items: center; gap: 24px; flex-shrink: 0;
}

/* Horizon button */
#btn-horizon {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 4px; flex-shrink: 0;
    background: #1e1e1e; border: 1px solid #383838;
    color: #aaa; cursor: pointer; font-size: 11px;
    white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#btn-horizon:hover          { background: #2a2a2a; color: #fff; }
#btn-horizon.active-mode    { background: #2a2000; color: #ffdc32; border-color: #ffdc32; font-weight: 600; }
#btn-horizon.horizon-active { background: #2a1800; color: #ffaa00; border-color: #ffaa00; }
#btn-horizon svg            { width: 14px; height: 14px; flex-shrink: 0; }

/* Map hint bar */
.toolbar-hint {
    font-size: 13px; color: #777; white-space: nowrap;
    position: absolute; left: 50%; transform: translateX(-50%);
}

/* Leaflet z-index fixes */
.leaflet-pane.leaflet-shadow-pane    { z-index: 600; pointer-events: none; }
.leaflet-pane.leaflet-overlay-pane   { z-index: 500; pointer-events: none; }

/* ---- ZOOM HINT ---- */
#zoom-hint {
    position: absolute; bottom: 10px; left: 10px;
    background: #111a; color: #777; font-size: 10px;
    padding: 4px 8px; border-radius: 3px; pointer-events: none;
    letter-spacing: 0.3px;
}

/* ---- LAYER SWITCHER ---- */
.layer-switcher-wrap {
    position: relative;
}
.layer-burger {
    width: 32px; height: 32px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: #151515 !important; border: 1px solid #333 !important;
    border-radius: 4px !important; cursor: pointer;
    color: #aaa; box-shadow: 0 2px 6px #0006;
    transition: background 0.15s, color 0.15s;
}
.layer-burger:hover { background: #222 !important; color: #fff; }

.layer-menu {
    position: absolute; top: 38px; right: 0;
    background: #151515; border: 1px solid #2a2a2a;
    border-radius: 6px; min-width: 170px;
    box-shadow: 0 4px 16px #000a;
    overflow: hidden; z-index: 1000;
}
.layer-item {
    padding: 9px 14px; font-size: 12px; color: #bbb;
    cursor: pointer; transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.layer-item:hover  { background: #222; color: #fff; }
.layer-item.active { color: #00aaff; background: #0a1a2a; }
.intersection-marker {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255, 220, 50, 0.25);
    border: 2px solid #ffdc32;
    box-shadow: 0 0 0 0 rgba(255, 220, 50, 0.6);
    animation: intersection-pulse 1.6s ease-out infinite;
}

@keyframes intersection-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 220, 50, 0.7); }
    70%  { box-shadow: 0 0 0 14px rgba(255, 220, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 220, 50, 0); }
}