/* ===== Powerline Map — DRONESHOT.TW ===== */

:root {
    --bg-dark: #1a2332;
    --primary: #FEEEA5;
    --glass-bg: rgba(30, 40, 55, 0.88);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.65);
    --blur: blur(12px);
    --header-h: 54px;
    --search-h: 50px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh; overflow: hidden;
}

/* ===== Header ===== */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(55, 58, 70, 0.88);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center;
    padding: 0 16px; z-index: 1000; gap: 12px;
}
.header-logo img { height: 30px; display: block; }
.header-title { font-size: 15px; font-weight: 700; flex: 1; }
.header-btn {
    background: rgba(255,255,255,0.08); border: none; color: var(--text-primary);
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 20px; transition: background .2s;
}
.header-btn:hover { background: rgba(255,255,255,0.18); }

/* ===== Search Bar ===== */
#search-bar {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    height: var(--search-h);
    background: var(--glass-bg);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center;
    padding: 0 12px; z-index: 999;
}
.search-inner {
    flex: 1; display: flex; align-items: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 0 12px; height: 38px;
}
.search-inner:focus-within { border-color: var(--primary); }
.search-icon { color: var(--text-muted); font-size: 18px; margin-right: 8px; }
.search-inner input {
    flex: 1; background: none; border: none;
    color: var(--text-primary); font-size: 14px;
    font-family: inherit; outline: none; min-width: 0;
}
.search-inner input::placeholder { color: var(--text-muted); }
.search-btn {
    background: var(--primary); color: #1a2332; border: none;
    padding: 5px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    font-family: inherit; flex-shrink: 0;
}

/* ===== Map ===== */
#map {
    position: fixed;
    top: calc(var(--header-h) + var(--search-h));
    left: 0; right: 0; bottom: 0;
    z-index: 1;
}

/* ===== Filter Bar ===== */
.filter-bar {
    position: fixed;
    top: calc(var(--header-h) + var(--search-h) + 10px);
    left: 50%; transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 3px; z-index: 1000;
    display: flex; gap: 2px;
}
.filter-label {
    font-size: 12px; font-weight: 700; color: var(--text-secondary);
    padding: 6px 14px;
    display: flex; align-items: center; gap: 4px;
}
.filter-label i { color: var(--primary); font-size: 15px; }

/* ===== Info Panel ===== */
.info-panel {
    position: fixed;
    bottom: 16px; left: 12px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 14px;
    z-index: 1000;
    min-width: 180px;
}
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2px 0;
}
.info-label { font-size: 12px; color: var(--text-muted); }
.info-value { font-size: 13px; font-weight: 700; }
.info-hint {
    margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--glass-border);
    font-size: 10px; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
}

/* ===== Legend ===== */
.map-legend {
    position: fixed;
    bottom: 16px; right: 12px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px 12px;
    z-index: 1000;
    display: flex; gap: 12px;
    font-size: 11px; color: var(--text-secondary);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.dot-tower { background: #e74c3c; }
.dot-hv { background: #f39c12; }
.legend-line {
    width: 16px; height: 2px;
    background: rgba(231, 76, 60, 0.6);
}

/* ===== Footer ===== */
.map-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6);
    font-size: 9px; color: var(--text-muted);
    text-align: center; padding: 3px 8px;
    z-index: 999;
}

/* ===== Leaflet Overrides ===== */
.leaflet-control-zoom { margin-top: 10px !important; }
.leaflet-control-zoom a {
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--glass-border) !important;
}

/* ===== Locate marker pulse ===== */
.locate-marker {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 0 rgba(254,238,165, 0.5);
    animation: pulse-ring 1.5s ease-out infinite;
}
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(254,238,165, 0.5); }
    100% { box-shadow: 0 0 0 16px rgba(254,238,165, 0); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .info-panel { left: 8px; right: 8px; bottom: 28px; min-width: auto; }
    .map-legend { right: 8px; bottom: 28px; left: auto; }
    .info-panel ~ .map-legend { bottom: 110px; }
}
