/* General Layout */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
    color: #333;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
}

/* Menu Bar */
#menu-bar {
    height: 60px;
    background-color: #f3f7fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

#button-container {
    display: flex;
    gap: 15px;
}

#button-container button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.1s;
}

#button-container button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

#button-container button.active {
    background-color: #2980b9;
    transform: translateY(1px);
}

.basemap-selector {
    position: relative;
}

#basemap-select {
    padding: 10px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%233498db' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.3s;
}

#basemap-select:hover,
#basemap-select:focus {
    border-color: #3498db;
    outline: none;
}

#logo-container {
    margin-right: auto;
}

#logo {
    height: 50px;
    width: auto;
}

/* Map Container */
#map-container {
    position: relative;
    height: calc(100vh - 60px);
    width: 100%;
}

#map {
    height: 100%;
    width: 100%;
    transition: opacity 0.5s ease;
}

/* Layer Control Panel */
#layer-control {
    position: absolute;
    top: 70px;
    right: 10px;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

#layer-control h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #2c3e50;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

#layer-control .layer-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

#layer-control .layer-item:last-child {
    border-bottom: none;
}

#layer-control .layer-item.styling-active {
    background-color: #f0f4f8;
    border-left: 4px solid #3498db;
}

#layer-control .layer-item span {
    flex: 1;
}

#layer-control .layer-item button {
    margin-left: 5px;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#layer-control .layer-item .up-btn,
#layer-control .layer-item .down-btn {
    background-color: #3498db;
    color: white;
    border: none;
}

#layer-control .layer-item .up-btn:hover,
#layer-control .layer-item .down-btn:hover {
    background-color: #2980b9;
}

#layer-control .layer-item .up-btn:disabled,
#layer-control .layer-item .down-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#layer-control .layer-item .on-btn {
    color: white;
    border: none;
}

#layer-control .layer-item .on-btn:hover {
    background-color: #27ae60;
}

#layer-control .layer-item .off-btn {
    color: white;
    border: none;
}

#layer-control .layer-item .off-btn:hover {
    background-color: #c0392b;
}

#layer-control .layer-item .style-btn {
    background-color: #f39c12;
    color: white;
    border: none;
}

#layer-control .layer-item .style-btn:hover {
    background-color: #e67e22;
}

#layer-control .layer-item .delete-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
}

#layer-control .layer-item .delete-btn:hover {
    background-color: #7f8c8d;
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.modal-content .close:hover {
    color: #e74c3c;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #555;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.modal-content ul li {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.modal-content ul li:last-child {
    border-bottom: none;
}

.modal-content ul li label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.modal-content ul li input[type="checkbox"] {
    margin-right: 10px;
}

.modal-content button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin: 5px;
    transition: background-color 0.3s, transform 0.1s;
}

.modal-content button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

/* Style Modal Specific Styles */
#style-modal .modal-content .style-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

#style-modal .modal-content label {
    display: flex;
    align-items: center;
    gap: 10px;
}

#style-modal .modal-content select {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 14px;
}

#style-modal .modal-content input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    cursor: pointer;
}

#style-modal .modal-content input[type="range"] {
    width: 150px;
}

#style-modal .modal-content input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

#style-modal .modal-content .category-styling-options {
    margin-top: 10px;
}

#style-modal .modal-content .category-values {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

#style-modal .modal-content .category-style-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

#style-modal .modal-content .category-style-item:last-child {
    border-bottom: none;
}

#style-modal .modal-content .category-style-item h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #2c3e50;
}

#style-modal .modal-content .category-style-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
}

#style-modal .modal-content .cancel-style-btn {
    background-color: #e74c3c;
}

#style-modal .modal-content .cancel-style-btn:hover {
    background-color: #c0392b;
}

/* Draw Modal Specific Styles */
#draw-modal .modal-content button {
    margin: 5px;
}

/* Drawing Control Buttons */
.draw-controls {
    display: flex;
    gap: 5px;
}

.draw-cancel-btn,
.draw-finish-btn {
    padding: 5px 10px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.draw-finish-btn {
    background-color: #2ecc71;
}

.draw-cancel-btn:hover {
    background-color: #c0392b;
}

.draw-finish-btn:hover {
    background-color: #27ae60;
}

/* Popup for Saving/Deleting Drawn Shapes */
.leaflet-popup-content {
    padding: 5px;
}

.leaflet-popup-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.leaflet-popup-content select,
.leaflet-popup-content input {
    width: 100%;
    margin-bottom: 5px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.leaflet-popup-content button {
    padding: 5px 10px;
    margin: 0 5px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.leaflet-popup-content button:hover {
    background-color: #2980b9;
}

/* Tooltip Styling for Feature Names */
.leaflet-tooltip {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 600px) {
    #menu-bar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    #button-container {
        margin-top: 10px;
        flex-wrap: wrap;
    }

    #layer-control {
        width: 250px;
        top: 60px;
    }

    .basemap-selector {
        margin-top: 10px;
    }

    .modal-content {
        width: 90%;
    }

    .draw-controls {
        flex-direction: column;
        gap: 2px;
    }

    #style-modal .modal-content input[type="range"] {
        width: 100px;
    }
}

