/* Vagnby PowerMap Styles */

:root {
    --bg-color: #0b0f19;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 243, 255, 0.2);
    --hover-bg: rgba(0, 243, 255, 0.1);

    --neon-cyan: #00f3ff;
    --neon-pink: #bc13fe;
    --text-main: #ffffff;
    --text-muted: #94a3b8;

    --card-radius: 16px;
    --glow-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
}

/* Layout */
body {
    overflow: hidden;
    /* Prevent scroll */
}

.map-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
    /* Above particles */
}

/* Sidebar Controls */
.controls-panel {
    width: 380px;
    height: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

/* Brand Header */
.brand-header {
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
}

.brand-header h1 {
    font-size: 2.2rem;
    margin: 10px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 0%, var(--neon-cyan) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-header p {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin: 0;
}

.title-wrapper {
    position: relative;
    display: inline-block;
}

.beta-badge {
    position: absolute;
    top: -8px;
    right: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    transform: rotate(12deg);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: badge-pulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.6), 0 0 30px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.9), 0 0 50px rgba(239, 68, 68, 0.5);
    }
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--neon-cyan);
}

/* Input Cards */
.input-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-card label {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-cyan);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 12px 15px 12px 45px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    background: rgba(0, 243, 255, 0.05);
}

/* Range Slider */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--neon-cyan);
    margin-top: -8px;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-cyan);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
}

.neon-badge {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

/* Action Button */
.action-btn {
    background: var(--neon-cyan);
    color: #0b0f19;
    border: none;
    padding: 15px;
    border-radius: 30px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    position: relative;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--neon-cyan);
}

.action-btn:active {
    transform: translateY(0);
}

/* Map Area */
.map-wrapper {
    flex: 1;
    position: relative;
    background: #000;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Dark Mode Filter for OSM Tiles */
.leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Fix Popup/Marker Colors inverted by filter */
/* Note: Since the filter is on the tile pane, markers (marker-pane) remain normal color! 
   However, popups might look standard unless styled */

/* Custom Popup Style */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: rgba(11, 15, 25, 0.9) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--neon-cyan);
    color: #fff !important;
    border-radius: 8px !important;
}

.leaflet-popup-content h3 {
    color: var(--neon-cyan);
    font-family: 'Orbitron', sans-serif;
    margin: 5px 0 10px 0;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 5px;
}

/* Debug */
.debug-section {
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-btn:hover {
    color: var(--neon-cyan);
}

.debug-log {
    background: #000;
    border: 1px solid var(--glass-border);
    padding: 10px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #0f0;
    height: 150px;
    overflow-y: auto;
    margin-top: 10px;
    border-radius: 8px;
}

.hidden {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .map-layout {
        flex-direction: column;
    }

    .controls-panel {
        width: 100%;
        height: 50%;
        /* More balanced split */
        order: 2;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        padding: 20px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }

    .map-wrapper {
        height: 50%;
        order: 1;
    }

    .brand-header h1 {
        font-size: 1.5rem;
    }
}

/* Map Markers */
.custom-div-icon {
    background: transparent;
    border: none;
}

.custom-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background: #333;
    /* Fallback */
    border: 2px solid #fff;
    font-size: 1.2rem;
    position: relative;
    transition: transform 0.2s;
}

.custom-marker:hover {
    transform: scale(1.2);
    z-index: 1000;
}

.marker-start {
    background: #10b981;
    border-color: #059669;
    box-shadow: 0 0 15px #10b981;
}

.marker-end {
    background: #ef4444;
    border-color: #b91c1c;
    box-shadow: 0 0 15px #ef4444;
}

.marker-range {
    background: #f59e0b;
    border-color: #d97706;
    box-shadow: 0 0 15px #f59e0b;
}

.marker-charger {
    background: #0b0f19;
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* Loading Spinner */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.action-btn.loading .loader {
    display: block;
}

.action-btn.loading i {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Status Messages */
.status-box {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 15px;
    border: 1px solid;
}

.status-box.info {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.status-box.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.status-box.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Filter Section */
.filter-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

.filter-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s;
}

.filter-header:hover {
    background: rgba(0, 243, 255, 0.05);
    color: var(--neon-cyan);
}

.filter-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.filter-arrow.rotated {
    transform: rotate(180deg);
}

.filter-options {
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.filter-chip:hover {
    border-color: var(--neon-cyan);
    color: #fff;
}

.filter-chip.active {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.filter-chip i {
    font-size: 0.7rem;
}

.apply-filter-btn {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 12px;
    border-radius: 25px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 10px;
}

.apply-filter-btn:hover {
    background: var(--neon-cyan);
    color: #0b0f19;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

/* Menu Button */
.menu-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(11, 15, 25, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--neon-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.menu-btn:hover {
    background: var(--neon-cyan);
    color: #0b0f19;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

/* Compact Dropdown Menu */
.compact-menu {
    position: fixed;
    top: 75px;
    right: 20px;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 999;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 180px;
}

.compact-menu.open {
    display: flex;
}

.compact-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.compact-menu a:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
}

.compact-menu a.active {
    background: rgba(0, 243, 255, 0.15);
    color: var(--neon-cyan);
}

.compact-menu a i {
    width: 20px;
    text-align: center;
}

/* Chat Widget Button */
.chat-widget-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    background: var(--neon-cyan);
    border: none;
    border-radius: 50%;
    color: #0b0f19;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 25px rgba(0, 243, 255, 0.4);
    transition: all 0.3s;
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 35px rgba(0, 243, 255, 0.6);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 350px;
    height: 450px;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 999;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.chat-window.open {
    display: flex;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.chat-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-chat:hover {
    color: #ef4444;
}

.messages-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-row {
    display: flex;
}

.message-row.bot {
    justify-content: flex-start;
}

.message-row.user {
    justify-content: flex-end;
}

.bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-row.bot .bubble {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.message-row.user .bubble {
    background: var(--neon-cyan);
    color: #0b0f19;
}

.input-area {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 10px 15px;
    color: #fff;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--neon-cyan);
    border: none;
    border-radius: 50%;
    color: #0b0f19;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
}

.typing .dot {
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}