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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(10px, 3vw, 20px);
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: clamp(15px, 4vw, 30px);
    padding: clamp(10px, 3vw, 20px);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.search-container {
    margin-bottom: 20px;
}

#search {
    width: 100%;
    padding: clamp(8px, 2vw, 12px);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: clamp(14px, 4vw, 16px);
    -webkit-appearance: none;
    appearance: none;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.streets-list {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    max-height: 600px;
    overflow-y: auto;
}

.streets-list h2 {
    margin-bottom: 15px;
    color: #333;
}

#streetsList {
    list-style: none;
}

#streetsList li {
    padding: clamp(12px, 3vw, 15px);
    margin-bottom: 5px;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    touch-action: manipulation;
}

#streetsList li:hover {
    background-color: #e9ecef;
}

.map-container {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    height: 600px;
}

#map, #streetview {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#directions-panel {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

/* Tablet Breakpoint */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .streets-list {
        max-height: 300px;
    }
    
    .map-container {
        height: 70vh;
        grid-template-rows: 1fr 1fr;
    }

    #streetsList li {
        padding: 15px;  /* Larger touch target */
    }
}

/* Mobile Breakpoint */
@media (max-width: 480px) {
    .streets-list {
        max-height: 250px;
    }
    
    .map-container {
        height: 60vh;
        grid-template-rows: 1fr 1fr;
    }

    #directions-panel {
        max-height: 150px;
        font-size: 14px;
    }
}

/* Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .map-container {
        height: 80vh;
        grid-template-rows: 1fr;
        grid-template-columns: 1fr 1fr;
    }
    
    .streets-list {
        max-height: 200px;
    }
}

/* High-DPI Mobile Devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .map-container {
        border: 0.5px solid #ddd;
    }
}

/* Ensure minimum touch target size */
@media (hover: none) and (pointer: coarse) {
    #streetsList li,
    button,
    input[type="text"] {
        min-height: 44px;
    }
}
