body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: Arial, sans-serif;
}
#map-container {
    flex: 3;
    height: 50vh;
}
#map {
    height: 100%;
    cursor: pointer;
}
#sidebar {
    flex: 1;
    background-color: #f8f9fa;
    padding: 15px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    min-width: auto;
}

/* Media query for tablets and larger screens */
@media (min-width: 768px) {
    body {
        flex-direction: row;
    }
    #map-container {
        height: 100%;
    }
    #sidebar {
        min-width: 250px;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }
}
#polygon-list, #marker-list {
    list-style-type: none;
    padding: 0;
}
#polygon-list li, #marker-list li {
    padding: 10px;
    margin-bottom: 5px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background-color 0.2s;
}
#polygon-list li:hover, #marker-list li:hover {
    background-color: #e9ecef;
}
/* Custom marker styling */
.custom-marker {
    cursor: pointer;
}
.polygon-item, .marker-item {
    display: flex;
    flex-direction: column;
}
.polygon-header, .marker-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}
.polygon-name, .marker-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1em;
}
.polygon-actions, .marker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.marker-coordinates {
    margin-bottom: 5px;
    font-size: 0.9em;
}

@media (min-width: 768px) {
    .polygon-header, .marker-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }
    .polygon-name, .marker-name {
        flex-grow: 1;
        margin-bottom: 0;
        font-size: 1em;
    }
    .marker-coordinates {
        margin-bottom: 0;
        font-size: 0.8em;
    }
}
.edit-btn, .save-btn, .cancel-btn, .delete-btn, .export-btn,
.edit-marker-btn, .save-marker-btn, .cancel-marker-btn, .delete-marker-btn, .export-marker-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 2px;
}
.edit-btn {
    background-color: #6c757d;
    color: white;
}
.save-btn {
    background-color: #28a745;
    color: white;
}
.export-btn {
    background-color: #17a2b8;
    color: white;
}
.cancel-btn, .delete-btn {
    background-color: #dc3545;
    color: white;
}

@media (min-width: 768px) {
    .edit-btn, .save-btn, .cancel-btn, .delete-btn, .export-btn,
    .edit-marker-btn, .save-marker-btn, .cancel-marker-btn, .delete-marker-btn, .export-marker-btn {
        padding: 3px 8px;
        font-size: 0.8em;
        margin: 0;
    }
    .polygon-actions, .marker-actions {
        gap: 5px;
    }
}
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}
.form-group label {
    font-size: 0.9em;
    color: #495057;
}
.form-group input, .form-group select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

@media (min-width: 768px) {
    .form-group {
        gap: 3px;
        margin-bottom: 0;
    }
    .form-group label {
        font-size: 0.8em;
    }
    .form-group input, .form-group select {
        padding: 5px;
        font-size: 14px;
    }
}
.edit-instructions {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 5px;
}
h2 {
    margin-top: 0;
    color: #495057;
}
.instructions {
    font-size: 1em;
    color: #495057;
    margin-bottom: 20px;
    line-height: 1.5;
}
.instructions h3 {
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 1.2em;
}
.instructions p, .instructions li {
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .instructions {
        font-size: 0.9em;
        color: #6c757d;
    }
    .instructions h3 {
        font-size: 1.1em;
        margin-top: 12px;
        margin-bottom: 6px;
    }
    .instructions p, .instructions li {
        margin-bottom: 5px;
    }
}
.toggle-btn {
    display: inline-block;
    padding: 10px 16px;
    margin-bottom: 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
    width: 100%;
    text-align: center;
}
.toggle-btn:hover {
    background-color: #0069d9;
}
.toggle-btn.inactive {
    background-color: #6c757d;
}
.toggle-btn.inactive:hover {
    background-color: #5a6268;
}

@media (min-width: 768px) {
    .toggle-btn {
        width: auto;
        padding: 8px 16px;
        font-size: 0.9em;
    }
}
#current-points-container {
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#current-points-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1em;
}
#current-points-list {
    font-size: 0.9em;
}
#current-points-list .empty-message {
    font-style: italic;
    color: #6c757d;
}
.point-item {
    padding: 10px;
    margin-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}
.point-item:last-child {
    border-bottom: none;
}
.point-coordinates {
    color: #495057;
    font-size: 0.95em;
}
.delete-point-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 10px;
}

@media (min-width: 768px) {
    .point-item {
        padding: 5px;
        margin-bottom: 3px;
    }
    .point-coordinates {
        font-size: 0.9em;
    }
    .delete-point-btn {
        font-size: 1em;
        padding: 2px 5px;
    }
}

/* Icon Selection Styles */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
}

.icon-option:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.icon-option.active {
    border-color: #007bff;
    background-color: #e3f2fd;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

.default-marker {
    width: 25px;
    height: 25px;
    background-color: #007bff;
    border-radius: 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toilet-icon, .disabled-toilet-icon, .parking-icon, .disabled-parking-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.disabled-toilet-icon, .disabled-parking-icon {
    font-size: 20px;
    gap: 2px;
}

.icon-option span {
    font-size: 12px;
    text-align: center;
    color: #666;
    font-weight: 500;
}

.icon-option.active span {
    color: #007bff;
    font-weight: 600;
}

/* Custom marker styles for map */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.emoji-marker {
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/*.polygon-number-label {*/
/*    display: none;*/
/*}*/