/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0e27;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 157, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 157, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* Glowing orbs */
body::after {
    content: '';
    position: fixed;
    top: -65%;
    left: -50%;
    width: 200%;
    height: 300%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 157, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 200, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 0, 150, 0.1) 0%, transparent 50%);
    animation: orbRotate 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

@keyframes orbRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Map container */
#map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Move Leaflet zoom controls to top right */
.leaflet-top.leaflet-left {
    left: auto !important;
    right: 10px;
    top: 20px;
}

/* Style the zoom controls to match theme */
.leaflet-control-zoom a {
    background: rgba(15, 20, 40, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 157, 0.3) !important;
    color: #00ff9d !important;
    transition: all 0.3s ease;
}

.leaflet-control-zoom a:hover {
    background: rgba(15, 20, 40, 1) !important;
    border-color: rgba(0, 255, 157, 0.5) !important;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.3);
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 255, 157, 0.2) !important;
}

/* Remove default Leaflet div icon styling */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Directional Arrow Icon */
.arrow-icon {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 16px solid #00ff9d;
    position: relative;
    transform-origin: center;
}

.arrow-icon::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 10px solid rgba(0, 0, 0, 0.3);
    left: -4px;
    top: 1px;
    z-index: -1;
}

/* Info Panel - TOP LEFT */
.info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 320px;
    max-height: calc(100vh - 40px);
    background: rgba(15, 20, 40, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(0, 255, 157, 0.2);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.info-panel.collapsed {
    transform: translateX(-360px);
}

/* Panel Header */
.panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 255, 157, 0.2);
}

.panel-header h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    background: linear-gradient(135deg, #00ff9d, #00c8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.panel-header p,
.panel-header a {
    font-size: 13px;
    color: rgba(0, 255, 157, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.panel-header a:hover {
    color: #00ff9d;
}

/* Panel Content */
.panel-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 255, 157, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 157, 0.3);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 157, 0.5);
}

/* Stats Section */
.stats-section {
    margin-bottom: 20px;
}

.stats-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
}

/* Control Container */
.control-container {
    margin-bottom: 20px;
}

.control-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 255, 157, 0.9);
}

.control-container select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 255, 157, 0.05);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-container select:hover {
    background: rgba(0, 255, 157, 0.1);
    border-color: rgba(0, 255, 157, 0.4);
}

.control-container select:focus {
    outline: none;
    border-color: #00ff9d;
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.1);
}

.control-container select option {
    background: rgba(15, 20, 40, 0.95);
    color: #fff;
    padding: 10px;
}

.control-container p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.control-container strong {
    color: #00ff9d;
}

/* Hide Panel Button */
#hide-panel-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.1), rgba(0, 200, 255, 0.1));
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #00ff9d;
    margin-top: 10px;
    transition: all 0.3s ease;
}

#hide-panel-button:hover {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(0, 200, 255, 0.2));
    transform: translateY(-2px);
    box-shadow: 
        0 4px 15px rgba(0, 255, 157, 0.3),
        0 0 20px rgba(0, 255, 157, 0.2);
    border-color: rgba(0, 255, 157, 0.5);
}

/* Show Panel Button */
.show-panel-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(15, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 255, 157, 0.2);
    cursor: pointer;
    z-index: 1001;
    font-size: 14px;
    font-weight: 600;
    color: #00ff9d;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.show-panel-button.visible {
    opacity: 1;
    pointer-events: auto;
}

.show-panel-button:hover {
    background: rgba(15, 20, 40, 1);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 255, 157, 0.3);
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal */
.modal {
    background: rgba(15, 20, 40, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 
        0 10px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(0, 255, 157, 0.2),
        0 0 40px rgba(0, 255, 157, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal h3 {
    margin: 0 0 25px 0;
    font-size: 22px;
    background: linear-gradient(135deg, #00ff9d, #00c8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(0, 255, 157, 0.9);
    font-weight: 600;
    font-size: 13px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 255, 157, 0.05);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: rgba(0, 255, 157, 0.08);
    border-color: #00ff9d;
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.1);
}

.form-group select option {
    background: rgba(15, 20, 40, 0.95);
    color: #fff;
    padding: 10px;
}

.form-group input:read-only {
    background: rgba(255, 255, 255, 0.03);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.5);
}

.form-group + p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin: 10px 0;
    line-height: 1.5;
}

/* Modal buttons */
.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-btn-submit {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(0, 200, 255, 0.2));
    color: #00ff9d;
    border-color: rgba(0, 255, 157, 0.3);
}

.modal-btn-submit:hover {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.3), rgba(0, 200, 255, 0.3));
    border-color: #00ff9d;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 15px rgba(0, 255, 157, 0.3),
        0 0 20px rgba(0, 255, 157, 0.2);
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Crosshair cursor for map */
.map-crosshair {
    cursor: crosshair !important;
}

.map-crosshair * {
    cursor: crosshair !important;
}

/* Custom notification */
.custom-notification {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.custom-notification.active {
    display: flex;
}

.custom-notification-content {
    background: rgba(15, 20, 40, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: 
        0 10px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(0, 255, 157, 0.2),
        0 0 40px rgba(0, 255, 157, 0.2);
    animation: notificationSlideIn 0.3s ease-out;
}

@keyframes notificationSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-notification h3 {
    color: #00ff9d;
    margin: 0 0 15px 0;
    font-size: 20px;
    text-shadow: 0 0 15px rgba(0, 255, 157, 0.5);
}

.custom-notification p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 25px 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.custom-notification-button {
    padding: 12px 28px;
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(0, 200, 255, 0.2));
    color: #00ff9d;
    border: 1px solid rgba(0, 255, 157, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.custom-notification-button:hover {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.3), rgba(0, 200, 255, 0.3));
    border-color: #00ff9d;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 15px rgba(0, 255, 157, 0.3),
        0 0 20px rgba(0, 255, 157, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .info-panel {
        width: calc(100% - 40px);
        max-width: 340px;
    }
    
    .info-panel.collapsed {
        transform: translateX(calc(-100% - 40px));
    }
    
    .modal {
        width: 95%;
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .panel-header h2 {
        font-size: 18px;
    }
    
    .modal h3 {
        font-size: 18px;
    }
    
    .charge-popup .stats {
        flex-direction: column;
        gap: 10px;
    }
}