/* 
 * EV Smart Charging & Routing System Styles 
 * Premium automotive theme with glassmorphism
 */

:root {
    --ev-bg: rgba(255, 255, 255, 0.95);
    --ev-accent: #007bff; /* Togg blue */
    --ev-accent-rgb: 0, 123, 255;
    --ev-text: #333333;
    --ev-border: rgba(0, 0, 0, 0.1);
    --ev-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Sticky Bar - Normal State (In Flow) */
.ev-sticky-bar {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    z-index: 10000;
    background: var(--ev-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--ev-border);
    border-radius: 16px;
    padding: 15px 25px;
    box-shadow: var(--ev-shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
}

/* Sticky Class (When scrolling) */
.ev-sticky-bar.is-sticky {
    position: fixed;
    top: 80px; /* Below header */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
}

/* Collapsed State (Mobile & Scroll) */
.ev-sticky-bar.collapsed {
    position: fixed;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    top: 30px; /* Small icon position */
    left: calc(100% - 45px);
    transform: translateX(-100%);
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
}

.ev-sticky-bar.collapsed:hover {
    box-shadow: 0 0 20px rgba(var(--ev-accent-rgb), 0.4);
    transform: translateX(-100%) scale(1.05);
}

/* Content visibility during collapse */
.ev-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    transition: opacity 0.3s;
}

.ev-sticky-bar.collapsed .ev-bar-content {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* Collapsed Icon */
.ev-collapsed-icon {
    display: none;
    font-size: 24px;
    color: var(--ev-accent);
    text-shadow: 0 0 10px rgba(var(--ev-accent-rgb), 0.5);
    animation: ev-pulse 2s infinite;
}

.ev-sticky-bar.collapsed .ev-collapsed-icon {
    display: block;
}

@keyframes ev-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Elements */
.ev-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ev-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.ev-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.ev-select, .ev-input {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    color: #333;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.ev-select:focus, .ev-input:focus {
    border-color: var(--ev-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--ev-accent-rgb), 0.1);
}

.ev-select option {
    background: #ffffff;
    color: #333;
}

.ev-input {
    width: 160px;
}

.ev-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ev-input-wrapper .ev-input {
    padding-right: 90px;
}

.ev-input-wrapper .ev-percent-sign {
    position: absolute;
    right: 10px;
    color: #666;
    font-size: 13px;
    pointer-events: none;
    font-weight: 600;
    display: flex;
    gap: 4px;
}

.kalan-sarj-text {
    display: inline;
}

.ev-btn {
    background: var(--ev-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.ev-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--ev-accent-rgb), 0.4);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .ev-sticky-bar {
        padding: 10px 12px;
        top: 10px;
        border-radius: 12px;
        gap: 8px;
    }
    
    .ev-bar-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ev-title {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 13px;
        order: -1;
        margin-bottom: -2px;
    }
    
    .ev-inputs {
        gap: 6px;
        flex: 1;
        min-width: 0;
    }
    
    .ev-select {
        flex: 2;
        font-size: 11px;
        padding: 8px 6px;
        max-width: none;
        min-width: 0;
    }
    
    .ev-input {
        flex: 1;
        width: 50px;
        font-size: 11px;
        padding: 8px 4px;
        min-width: 0;
    }

    .ev-input-wrapper .ev-input {
        padding-right: 16px;
    }

    .ev-input-wrapper .ev-percent-sign {
        right: 4px;
        font-size: 11px;
    }

    .kalan-sarj-text {
        display: none;
    }
    
    .ev-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Hide text on very small screens, show icon only */
    @media (max-width: 380px) {
        .ev-btn span { display: none; }
        .ev-btn i { margin: 0 !important; font-size: 14px; }
        .ev-input::placeholder { font-size: 10px; }
    }

    #ev-collapse-btn {
        display: none; /* Auto-collapse is better on mobile */
    }
}

/* Map Page Specifics */
#ev-map-container {
    width: 100%;
    height: 100vh;
    background: #f4f7f6;
}

.filter-bar {
    position: absolute;
    top: 90px; /* Moved down from 20px to avoid range indicator overlap */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    width: auto;
    max-width: 95%;
    scrollbar-width: none; /* Hide scrollbar for cleaner look */
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-chip:hover {
    background: #ffffff;
    border-color: var(--ev-accent);
    transform: translateY(-2px);
    transition: all 0.2s;
}

.filter-chip.active {
    background: #0062cc !important;
    color: #ffffff !important;
    border-color: #0056b3 !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4) !important;
    transform: scale(1.05) !important;
    z-index: 2;
}

/* Bottom Sheet */
.ev-bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 70vh; /* Allow a bit more but with internal scroll */
    min-height: 200px;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    z-index: 11000;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    color: #333;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.ev-bottom-sheet.active {
    bottom: 0;
}

#sheet-content {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px; /* space for scroll-bar if needed */
}

/* Custom scrollbar for sheet content */
#sheet-content::-webkit-scrollbar {
    width: 4px;
}
#sheet-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
}

.ev-handle {
    width: 40px;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    margin: -10px auto 20px;
}

/* Route Panel */
.route-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 20px;
    z-index: 2000;
    color: #333;
    display: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.route-panel.active { display: block; animation: slideInRight 0.3s ease; }

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.route-input-group {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-input-group input {
    background: transparent;
    border: none;
    color: #333;
    font-size: 13px;
    width: 100%;
    outline: none;
}

/* Tooltip */
.leaflet-tooltip-pane .tr-tooltip {
    background: #ffffff !important;
    border: 1px solid var(--ev-accent) !important;
    color: #333 !important;
    border-radius: 8px !important;
    padding: 8px !important;
    font-family: 'Inter', sans-serif !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
    opacity: 1 !important;
}

/* Routing Machine Hide Default */
.leaflet-routing-container { display: none !important; }

/* Marker Glow */
.marker-glow { animation: markerPulse 2s infinite; }
@keyframes markerPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 212, 216, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 212, 216, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 212, 216, 0); }
}
/* Station Markers */
.custom-div-icon {
    background: transparent;
    border: none;
}

.tr-station-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.tr-station-marker:hover {
    transform: scale(1.3) rotate(15deg);
    z-index: 1000 !important;
}

.tr-station-marker i {
    font-size: 10px;
}
