/* Global styling */
:root {
    --primary-color: #2E8B57; /* SeaGreen */
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.85);
    --text-color: #f5f5f5;
    --accent-color: #00ff88;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* App Header */
.app-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.floating-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(20, 30, 40, 0.35); /* Liquid glass dark */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background-color: #ff4757;
    box-shadow: 0 0 8px #ff4757;
}

@keyframes pulse {
    0% { opacity: 1; box-shadow: 0 0 8px var(--accent-color); }
    50% { opacity: 0.5; box-shadow: 0 0 2px var(--accent-color); }
    100% { opacity: 1; box-shadow: 0 0 8px var(--accent-color); }
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a1a; 
    z-index: 1; /* Below header */
}

/* Search Container */
.floating-search {
    position: absolute;
    top: 76px; /* 60px header + 16px gap */
    right: 24px;
    z-index: 1000;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#cart-search-input {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(20, 30, 40, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
    font-size: 14px;
    width: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#cart-search-input:focus {
    border-color: var(--accent-color);
}

#cart-search-btn {
    background: rgba(0, 255, 136, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 136, 0.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

#cart-search-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4);
}

/* Custom Cart Marker */
.cart-marker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cart-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3), inset 0 2px 6px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.cart-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply; /* Removes white background from generated images */
}



.cart-label {
    margin-top: 6px;
    background: rgba(20, 30, 40, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.25);
}

/* Smooth Movement Transition */
.leaflet-marker-icon.smooth-move {
    /* linear transition feels more natural for cart movement */
    transition: transform 1.5s linear !important; 
}

.leaflet-marker-icon.no-transition {
    /* Disable transition during map events to prevent floating marker effect */
    transition: none !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: rgba(25, 35, 45, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 24px;
    width: 300px;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: translateY(-20px);
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

.modal-header h2 {
    margin: 0 0 16px 0;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.modal-body p {
    margin: 8px 0;
    font-size: 1rem;
}
