/* style.css */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

#sidebar {
    position: fixed;
    top: 0;
    left: -250px; /* Hide sidebar initially */
    width: 250px;
    height: 100%;
    background-color: #f8f9fa;
    padding: 15px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1;
    transition: left 0.3s ease;
}

#sidebar.open {
    left: 0; /* Show sidebar when open */
}

#sidebar h2 {
    margin-top: 0;
    font-size: 20px;
    text-align: center;
}

#places-list {
    list-style: none;
    padding: 0;
}

#places-list li {
    padding: 10px;
    margin-bottom: 5px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#places-list li:hover {
    background-color: #e9ecef;
}

#map {
    position: absolute;
    top: 0;
    left: 0; /* Adjusted for responsive design */
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    transition: left 0.3s ease;
}

#sidebar.open ~ #map {
    left: 250px; /* Adjust map position when sidebar is open */
    width: calc(100% - 250px);
}

#toggle-button {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#toggle-button:hover {
    background-color: #0056b3;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 3; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 90%; /* Adjusted for mobile */
    max-width: 300px; /* Maximum width */
    border-radius: 5px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

#place-name {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

#place-type-select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

#confirm-type-btn {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#confirm-type-btn:hover {
    background-color: #218838;
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        width: 200px;
    }

    #sidebar.open ~ #map {
        left: 200px;
        width: calc(100% - 200px);
    }

    #toggle-button {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 100%;
        left: -100%;
    }

    #sidebar.open {
        left: 0;
    }

    #sidebar.open ~ #map {
        left: 0;
    }

    #map {
        width: 100%;
    }
}
