/* -------------------------------------- */
/* BASE STYLES AND LAYOUT SYNCHRONIZATION */
/* -------------------------------------- */

/* Import the Inter font for a modern look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    /* Define color palette using Tailwind-like colors for consistency */
    --primary-color: #3b82f6; /* Blue 500 */
    --secondary-color: #1f2937; /* Gray 800 */
    --background-color: #f3f4f6; /* Gray 100 */
}

* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Prevent body scroll */
    background-color: var(--background-color);
}

/* Main container (app-container) replaces body flex rules */
.app-container {
    display: flex;
    height: 100vh;
}

/* --------------------- */
/* SIDEBAR AND RESULTS */
/* --------------------- */

.sidebar {
    width: 380px; /* Fixed width for desktop */
    min-width: 300px; /* Minimum size */
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
}

.search-area {
    padding: 1rem;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.search-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.search-button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #2563eb; 
}

/* Store List Container (uses id="store-list") */
#store-list {
    padding: 0.5rem;
}

/* Individual Store Cards */
.store-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.store-card:hover {
    background-color: #eff6ff; 
    transform: translateY(-2px);
}

.store-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.store-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Styles for distance */
.distance-info {
    text-align: right;
    white-space: nowrap;
}


/* --------------------- */
/* MAP CONTAINER */
/* --------------------- */

#map {
    height: 100%;
    flex-grow: 1;
    min-width: 300px;
}

/* --------------------- */
/* ADVANCED MARKER STYLING */
/* --------------------- */

.pin-label {
    background-color: var(--primary-color);
    color: white;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%; /* Make it a circle */
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

/* --------------------- */
/* RESPONSIVE DESIGN (MOBILE) */
/* --------------------- */

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100dvh; 
    }

    .sidebar {
        width: 100%;
        max-height: 50vh; /* Limit sidebar height on small screens */
        order: 2; /* Move sidebar to bottom on mobile */
    }

    #map {
        width: 100%;
        height: 50vh;
        order: 1; /* Keep map on top on mobile */
    }
}