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

body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 360px;
    height: 100%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.filters {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 16px;
    border-radius: 16px;
    border: none;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

/* Add specific colors for each category chip */
.chip[data-category="museums"] {
    background-color: #E53935;
    color: white;
}

.chip[data-category="cafes"] {
    background-color: #43A047;
    color: white;
}

.chip[data-category="galleries"] {
    background-color: #1E88E5;
    color: white;
}

.chip[data-category="buildings"] {
    background-color: #8E24AA;
    color: white;
}

.chip[data-category="secret"] {
    background-color: #FF8F00;
    color: white;
}

.chip[data-category="theatres"] {
    background-color: #F06292;
    color: white;
}

/* Add new category colors */
.chip[data-category="markets"] {
    background-color: #FF6D00;  /* Deep Orange */
    color: white;
}

.chip[data-category="restaurants"] {
    background-color: #D81B60;  /* Pink */
    color: white;
}

.chip[data-category="attractions"] {
    background-color: #00BFA5;  /* Teal */
    color: white;
}

/* Keep the "All" chip with original styling when not active */
.chip[data-category="all"] {
    background: #f5f5f5;
    color: #333;
}

/* Style for active state */
.chip.active {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* Style for active "All" button */
.chip[data-category="all"].active {
    background: #2196F3;
    color: white;
}

.places-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.place-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.place-card:hover {
    transform: translateY(-2px);
}

.place-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.place-card-content {
    padding: 16px;
}

.place-card h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.place-card p {
    color: #666;
    font-size: 14px;
}

/* Map Styles */
#map {
    flex: 1;
    height: 100%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    background: white;
    color: #333;
}

/* Place details modal (bottom style) */
#placeModal {
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

/* Floating modals (help and support) */
#helpModal,
#supportModal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    width: 500px;
    max-width: 90vw;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* Active states */
#placeModal.active {
    display: block;
    transform: translateY(0);
}

#helpModal.active,
#supportModal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal content adjustments */
#helpModal .modal-content,
#supportModal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    background: #f5f5f5;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    color: #333;
}

.place-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

.place-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: #333;
}

.place-info {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    color: #333;
}

/* Add to existing styles */
.custom-marker {
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-marker:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Enhanced Modal Styles */
.place-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.info-item .material-icons {
    color: #666;
}

.info-item h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.highlights-section, .facilities-section {
    margin: 24px 0;
}

.highlights-section ul {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.highlights-section li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: #333;
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.facility-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.website-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 16px;
}

.additional-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    color: #666;
}

/* Walking Mode Styles */
.walking-mode-control {
    z-index: 1000;
}

.walking-mode-button {
    width: 34px;
    height: 34px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: white;
}

.walking-marker {
    z-index: 1000 !important;
}

.walking-marker .material-icons {
    font-size: 30px;
    color: #2196F3;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.circle-label {
    z-index: 600;
}

.circle-label div {
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Add styles for the walking circles container */
.walking-circles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 400;  /* Below controls but above base map */
}

/* Walking Distances Panel Styles */
.walking-distances-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    height: 100%;
    background: white;
    z-index: 1100;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-out;
    transform: translateX(-100%);
}

.walking-distances-panel.active {
    transform: translateX(0);
}

.walking-times-header {
    padding: 16px;
    background: #2196F3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.walking-times-list {
    padding: 16px;
    overflow-y: auto;
    height: calc(100% - 60px);
}

.walking-time-group {
    margin-bottom: 24px;
}

.walking-time-group h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.walking-time-group .material-icons {
    font-size: 20px;
}

.walking-places {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.walking-place-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.walking-place-card:hover {
    transform: translateY(-2px);
}

.walking-place-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.walking-place-info {
    flex: 1;
}

.walking-place-info h5 {
    margin-bottom: 4px;
    font-size: 16px;
}

.walking-place-info p {
    font-size: 14px;
    color: #666;
}

.walking-distance {
    font-size: 12px;
    color: #2196F3;
    margin-top: 4px;
}
.leaflet-left {
    left: 5px;
    }
    .modal-close-button {
        width: 100%;
        padding: 12px;
        background: #2196F3;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        }

/* Update responsive styles */
@media (max-width: 768px) {
    /* Fix text colors and backgrounds */
    .sidebar {
        background: white;
    }

    .explore-header {
        background: #2196F3;
        color: white;
    }

    .filter-select select {
        background-color: white;
        color: #333;
    }

    /* Fix modal styles for mobile */
    .modal {
        background: white;
    }

    .modal-header {
        background: #f5f5f5;
        color: #333;
    }

    .modal-body {
        color: #333;
        grid-template-columns: 1fr; /* Single column for mobile */
    }

    /* Fix mobile popup styles */
    .mobile-place-popup {
        background: white;
        color: #333;
    }

    /* Add sticky close button for mobile modal */
    .modal-close-bottom {
        display: block;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 16px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        text-align: center;
    }

    .modal-close-button {
        width: 100%;
        padding: 12px;
        background: #2196F3;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
    }

    .modal-close-button:active {
        background: #1976D2;
    }

    /* Ensure content doesn't hide behind sticky button */
    .modal-body {
        padding-bottom: 80px;
    }

    /* Adjust container for mobile */
    .app-container {
        flex-direction: column;
        height: 100vh;
        position: relative;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.95);
    }

    #map {
        width: 100%;
        height: 100vh;
        position: absolute;
        top: 0;
        left: 0;
    }
    .leaflet-left {
        left: 5px !important;
        top: 200px !important; /* Move below the header and filters */
        z-index: 1001;
    }

    .leaflet-control {
        margin-left: 0;
        clear: both;
    }

    /* Ensure buttons are visible */
    .home-button,
    .location-button,
    .walking-mode-button {
        background-color: white !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        margin-bottom: 5px;
    }

    /* Increase touch target size */
    .leaflet-touch .leaflet-bar a {
        width: 44px;
        height: 44px;
        line-height: 44px;
    }

    /* Adjust header for mobile */
    .explore-header {
        padding: 8px 12px;
    }

    /* Compact filter area */
    .filters {
        padding: 8px;
        background: rgba(255, 255, 255, 0.95);
    }

    /* Hide places list on mobile */
    .places-list {
        display: none;
    }

    /* Ensure modals appear above map */
    .modal {
        z-index: 2000;
    }

    /* Ensure mobile popup appears above map */
    .mobile-place-popup {
        z-index: 1500;
    }

    /* Hide filter chips and show select on mobile */
    .filter-chips {
        display: none !important;
    }

    .filter-select {
        display: block !important;
        padding: 8px 12px;
    }

    .filter-select select {
        height: 40px;
        background-color: #f5f5f5;
        border: 1px solid #ddd;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        font-size: 16px; /* Larger font for mobile */
    }

    /* Remove any inline display: none from the select element */
    #categorySelect {
        display: block !important;
    }
}

/* Landscape mode adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .app-container {
        flex-direction: row;
    }

    .sidebar {
        width: auto;
        max-width: 320px;
    }

    #map {
        width: 100%;
        position: relative;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .explore-header {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .header-buttons {
        width: 100%;
        justify-content: center;
    }

    .place-info-grid {
        grid-template-columns: 1fr;
    }

    .facilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 320px;
    }

    .place-card img {
        height: 140px;
    }
}

/* High-DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .walking-marker .material-icons,
    .circle-label div {
        font-weight: 400;
    }
}

/* Ensure touch targets are large enough */
@media (hover: none) and (pointer: coarse) {
    .chip,
    .walking-place-card,
    .place-card,
    .modal-header button {
        min-height: 44px;
    }

    .facility-item,
    .info-item {
        padding: 8px 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modal,
    .sidebar,
    .walking-distances-panel {
        background: #1a1a1a;
        color: #fff;
    }

    .place-card,
    .walking-place-card {
        background: #2d2d2d;
    }

    .place-info {
        background: #333;
    }

    .modal-header,
    .walking-times-header {
        background: #2196F3;
    }
}

/* Keep modal images but make them smaller */
@media (max-width: 768px) {
    .modal .place-image {
        height: 160px;
    }
}

/* New category color */
.chip[data-category="filming"] {
    background-color: #7B1FA2;  /* Deep Purple */
    color: white;
}

/* Add styles for the home button */
.home-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: white;
    border-bottom: 1px solid #ccc;
}

.home-button:hover {
    background-color: #f4f4f4;
}

.home-button .material-icons {
    font-size: 20px;
    color: #666;
}

/* Ensure proper positioning */
.leaflet-control .home-button {
    cursor: pointer;
}

/* Add styles for the explore header */
.explore-header {
    padding: 20px 16px;
    background: #2196F3;
    color: white;
}

.explore-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
}

/* Adjust existing filters padding */
.filters {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

/* Header buttons styles */
.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-btn .material-icons {
    font-size: 18px;
}

/* Help modal styles */
.help-content {
    padding: 20px;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2196F3;
    margin-bottom: 8px;
}

.help-section p {
    margin-left: 32px;
    color: #666;
}

/* Support form styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    background: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #1976D2;
}

/* Add styles for the filter select dropdown */
.filter-select {
    display: none;
}

.filter-select select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px auto;
    cursor: pointer;
}

/* Update mobile popup styles */
.mobile-place-popup {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 350px;
    z-index: 2500; /* Increased z-index to appear above other elements */
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-place-popup.active {
    display: block;
    opacity: 1;
}

.mobile-place-popup h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.mobile-place-popup p {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.mobile-place-popup .popup-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-place-popup .view-details {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

/* Location button styles */
.location-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: white;
    border-bottom: 1px solid #ccc;
}

.location-button:hover {
    background-color: #f4f4f4;
}

.location-button .material-icons {
    font-size: 20px;
    color: #666;
}

.location-button.active {
    background-color: #2196F3;
}

.location-button.active .material-icons {
    color: white;
}

/* Position after home button */
.leaflet-control .location-button {
    cursor: pointer;
}

/* Add color for toilet category chip */
.chip[data-category="toilets"] {
    background-color: #00ACC1;  /* Cyan */
    color: white;
}

/* Add these styles for the submit button states */
.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}