/* Number label for competitor lines */
.competitor-number-label {
    z-index: 500;
    pointer-events: none;
}

html, body {
    background: #e5e7eb !important;
}

/* Map Page Specific Styles */
.map-header {
    text-align: center;
    padding: 20px;
    background-color: #2c2c2c;
    margin-bottom: 20px;
    border-radius: 5px;
    color: white;
}

.map-header h2 {
    color: white;
    margin-bottom: 10px;
}

.map-header p {
    color: #ccc;
    font-size: 14px;
}

/* Map Container */
#map {
    height: calc(100vh - 120px);
    width: 95%;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
    background-color: #000000 !important;
}

/* Custom Fuel Marker Styles */
.fuel-marker {
    background: transparent;
    border: none;
    text-align: center;
}

.fuel-icon {
    font-size: 24px;
    background-color: #1e3a8a;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid white;
    overflow: hidden;
}

.fuel-icon .brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.fuel-icon .brand-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============================================
   NEW: PRICE HALO EFFECTS
   ============================================ */

/* Competitor marker with price halo wrapper */
.competitor-marker-wrapper {
    position: relative;
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Price halo rings that pulse around competitors */
.price-halo {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
    animation: haloBreath 2s ease-in-out infinite;
}

/* Halos for cheaper competitors (red threat) */
.price-halo.halo-cheaper {
    background: radial-gradient(circle, rgba(211, 47, 47, 0.5) 0%, rgba(211, 47, 47, 0) 70%);
    box-shadow: 0 0 20px rgba(211, 47, 47, 0.6), 0 0 40px rgba(211, 47, 47, 0.4);
}

/* Halos for more expensive competitors (green opportunity) */
.price-halo.halo-expensive {
    background: radial-gradient(circle, rgba(56, 142, 60, 0.5) 0%, rgba(56, 142, 60, 0) 70%);
    box-shadow: 0 0 20px rgba(56, 142, 60, 0.6), 0 0 40px rgba(56, 142, 60, 0.4);
}

/* Small halo for small price differences (0-10 cents) */
.price-halo.halo-small {
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Medium halo for medium price differences (10-20 cents) */
.price-halo.halo-medium {
    width: 55px;
    height: 55px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Large halo for large price differences (20+ cents) */
.price-halo.halo-large {
    width: 70px;
    height: 70px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes haloBreath {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.5;
    }
}

/* ============================================
   NEW: FLOATING PRICE BADGES
   ============================================ */

/* Price badge that floats above competitor markers */
.price-badge {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffeb3b;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 14px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 235, 59, 0.3);
    white-space: nowrap;
    pointer-events: none;
    z-index: 600;
    animation: badgeBounce 0.6s ease-out;
    border: 1.5px solid rgba(255, 235, 59, 0.6);
}

.station-rating-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.competitor-distance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    margin-top: 3px;
}

.competitor-distance-row span {
    font-size: 11px;
}


/* Price badge with arrow pointing down to marker */
.price-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1a1a1a;
}

/* Cheaper price badge (red accent) */
.price-badge.badge-cheaper {
    border-color: rgba(255, 82, 82, 0.8);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 82, 82, 0.3), 0 0 12px rgba(255, 82, 82, 0.4);
}

.price-badge.badge-cheaper::after {
    border-top-color: #1a1a1a;
}

/* More expensive price badge (green accent) */
.price-badge.badge-expensive {
    border-color: rgba(102, 187, 106, 0.8);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(102, 187, 106, 0.3), 0 0 12px rgba(102, 187, 106, 0.4);
}

.price-badge.badge-expensive::after {
    border-top-color: #1a1a1a;
}

/* Price badge for Road Ranger stations (navy blue theme, no halo) */
.price-badge-rr {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), 
                0 0 0 2px rgba(59, 130, 246, 0.4), 
                0 0 12px rgba(30, 58, 138, 0.6);
}

.price-badge-rr::after {
    border-top-color: #1e3a8a;
}

@keyframes badgeBounce {
    0% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 0;
    }
    60% {
        transform: translateX(-50%) translateY(2px);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ============================================
   COMPETITOR MARKER STYLES (Enhanced)
   ============================================ */

.competitor-marker {
    background: transparent;
    border: none;
    text-align: center;
}

.competitor-icon {
    font-size: 16px;
    color: white;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid white;
    animation: competitorPulse 2s ease-in-out infinite;
    overflow: hidden;
    position: relative;
    z-index: 400;
    flex-shrink: 0;
}

.competitor-icon .brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1px;
    flex-shrink: 0;
}

.competitor-icon .brand-initials {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 9px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

@keyframes competitorPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.fuel-marker.highlighted .fuel-icon {
    width: 40px;
    height: 40px;
    font-size: 32px;
    background-color: #2563eb;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6);
    z-index: 1000;
}

/* Pulse Animation */
.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.8);
    }
}

/* Competitor Panel */
.competitor-panel {
    position: fixed;
    top: 50%;
    right: -320px;
    transform: translateY(-50%);
    width: 280px;
    max-height: 80vh;
    background: #2c2c2c;
    color: white;
    border-radius: 8px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    padding: 16px;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.3s ease;
    display: none;
    border: 1px solid #444;
}

.competitor-panel::-webkit-scrollbar {
    width: 8px;
}

.competitor-panel::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.competitor-panel::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.competitor-panel::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.competitor-panel.show {
    right: 20px;
}

.competitor-panel.visible {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    text-align: center;
}

.close-btn:hover {
    background-color: #444;
    color: white;
}

.competitor-panel h3 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 18px;
    padding-right: 30px;
}

.competitor-panel #station-address {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 14px;
    line-height: 1.3;
}

#competitors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.competitor-card {
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

/* Red for competitors with lower prices (undercutting) */
.competitor-card.competitor-lower {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    border-left: 4px solid #ff5252;
}

/* Green for competitors with higher prices */
.competitor-card.competitor-higher {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    border-left: 4px solid #66bb6a;
}

/* Neutral for same price */
.competitor-card.competitor-equal {
    background: linear-gradient(135deg, #616161 0%, #424242 100%);
    border-left: 4px solid #9e9e9e;
}

.competitor-card:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

.competitor-name {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 4px;
}

.competitor-price {
    font-size: 20px;
    font-weight: bold;
    margin: 5px 0;
    color: #ffeb3b;
}

.competitor-difference {
    font-size: 12px;
    font-weight: bold;
    margin: 3px 0;
    opacity: 0.95;
}

.competitor-distance {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 3px;
}

.no-competitors {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
    color: #aaa;
}

/* Responsive Design */
@media (max-width: 768px) {
    #map {
        width: 95%;
        height: 500px;
    }

    .competitor-panel {
        width: 90%;
        right: -100%;
        left: 5%;
        top: auto;
        bottom: 20px;
        transform: none;
        max-height: 60vh;
    }

    .competitor-panel.show {
        right: 5%;
        left: 5%;
        bottom: 20px;
    }

    .competitor-panel.visible {
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ============================================
   PROGRESS COUNTER & CHECKED STATIONS
   ============================================ */

/* Progress Counter */
.progress-counter {
    position: fixed;
    bottom: 220px;
    left: 20px;
    z-index: 1000;
    background: #2c2c2c;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    min-width: 200px;
}

/* Notes Section */
.notes-section {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: #2c2c2c;
    padding: 16px 8px 16px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    width: 320px;
    max-height: 180px;
    display: flex;
    flex-direction: column;
}

.notes-section-title {
    color: #aaa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    margin-left: 0;
    padding-right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.notes-station-name {
    color: #4ade80 ;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
    margin-left: 0;
    padding-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-textarea {
    width: 100%;
    margin-left: 0;
    min-height: 80px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    padding: 8px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.notes-textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.notes-textarea::placeholder {
    color: #666;
}

.notes-hint {
    color: #666;
    font-size: 11px;
    font-style: italic;
}

.notes-section.hidden {
    display: none;
}

.clear-note-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.clear-note-btn:hover {
    color: #dc2626;
}

.progress-counter-title {
    color: #aaa;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.progress-counter-stats {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.progress-counter-stats .checked {
    color: #4ade80;
}

.progress-counter-stats .total {
    color: #aaa;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-counter-hint {
    color: #888;
    font-size: 11px;
    font-style: italic;
    margin-top: 3px;
}

.progress-counter-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.progress-btn {
    flex: 1;
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.progress-btn.danger {
    background: #dc2626;
}

.progress-btn.danger:hover {
    background: #ef4444;
}

/* Checked station marker style */
.fuel-marker.checked .fuel-icon {
    border: 3px solid #4ade80 !important;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3), 0 4px 16px rgba(74, 222, 128, 0.4) !important;
}

.fuel-marker.checked::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4ade80;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* Store number badge - always visible on bottom left */
.store-number-badge {
    position: absolute;
    bottom: -6px;
    left: -6px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 0 4px;
    white-space: nowrap;
}
