body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
}

#map {
    height: 100vh;
    width: 100%;
    background: #f8f8f8;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 40px;
}

.header h1 {
    margin: 0;
    font-size: 20px;
}

/* Layer Control */
.layer-control {
    position: fixed;
    top: 70px;
    right: 10px;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 999;
}

.layer-control label {
    display: block;
    margin: 5px 0;
    cursor: pointer;
    font-size: 14px;
}

.layer-control input[type="radio"] {
    margin-right: 5px;
}

/* Markers */
.user-dot {
    width: 24px !important;
    height: 24px !important;
    background: #4A90E2;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.playground-marker {
    font-size: 32px !important;
    text-align: center;
    line-height: 32px !important;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
}

.draggable-marker {
    font-size: 48px !important;
    text-align: center;
    line-height: 48px !important;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.5));
    z-index: 1001 !important;
    cursor: move;
    //animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Buttons and Controls */
#addBtn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#addBtn:hover {
    background: #357ABD;
    transform: translateX(-50%) translateY(-2px);
}

/* Instruction Box */
.instruction-box {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    text-align: center;
    max-width: 300px;
    display: none;
}

/* Form Popup */
.form-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 300px;
    display: none;
}

.form-popup input,
.form-popup textarea {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-popup textarea {
    height: 100px;
    resize: vertical;
}

/* Leaflet Overrides */
.leaflet-popup-content {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.leaflet-popup-content button {
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
}

.leaflet-popup-content button:hover {
    background: #357ABD;
}

/* Cluster Styling */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}

.playground-marker.user-added {
    /* Optioneel: andere styling voor gebruiker-toegevoegde speeltuinen */
    filter: drop-shadow(2px 2px 2px rgba(74, 144, 226, 0.5));
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .layer-control {
        top: auto;
        bottom: 80px;
        right: 10px;
    }

    #addBtn {
        width: calc(100% - 40px);
        max-width: 300px;
        font-size: 16px;
        padding: 12px 20px;
    }

    .instruction-box {
        width: calc(100% - 40px);
        max-width: none;
        bottom: 90px;
        padding: 15px;
    }

    .form-popup {
        width: calc(100% - 40px);
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Small Height Screens */
@media (max-height: 600px) {
    .instruction-box {
        bottom: 70px;
        max-height: 150px;
        overflow-y: auto;
    }

    #addBtn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .layer-control {
        padding: 5px;
    }

    .layer-control label {
        font-size: 12px;
        margin: 3px 0;
    }
}

/* Ensure map controls stay visible */
.leaflet-top {
    top: 70px !important;
}

.leaflet-control-zoom {
    margin-top: 60px !important;
}

/* Loading State */
.loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #4A90E2;
    border-top-color: transparent;
    border-radius: 50%;
    animation: loading 1s linear infinite;
}

@keyframes loading {
    to {
        transform: rotate(360deg);
    }
}

/* Popup Styling */
.popup-content {
    text-align: center;
}

.popup-content button,
.instruction-box button,
.form-popup button {
    margin-top: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #4A90E2;
    color: white;
    transition: background-color 0.3s ease;
}

.popup-content button:hover,
.instruction-box button:hover,
.form-popup button:hover {
    background: #357ABD;
}

/* Cancel/Delete buttons */
button.secondary,
button[onclick*="cancel"] {
    background: #f1f1f1;
    color: #333;
}

button.secondary:hover,
button[onclick*="cancel"]:hover {
    background: #e1e1e1;
}

/* Form popup specifieke styling */
.form-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1002;
    width: 300px;
    display: none;
}

.form-popup h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.form-popup input,
.form-popup textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
}

.form-popup textarea {
    height: 100px;
    resize: vertical;
    min-height: 60px;
}

.form-popup label {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

/* Instruction box specifieke styling */
.instruction-box {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1001;
    text-align: center;
    max-width: 300px;
    display: none;
    font-size: 14px;
    line-height: 1.5;
}

.instruction-box .buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

/* Mobile aanpassingen voor popups */
@media (max-width: 768px) {
    .form-popup {
        width: calc(100% - 40px);
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .instruction-box {
        width: calc(100% - 40px);
        max-width: none;
        padding: 15px;
        bottom: 90px;
    }

    .instruction-box .buttons {
        flex-direction: column;
    }

    .instruction-box button {
        width: 100%;
        margin: 5px 0;
    }
}

/* Extra kleine schermen */
@media (max-height: 500px) {
    .instruction-box {
        bottom: 70px;
        padding: 10px;
    }

    .form-popup {
        padding: 15px;
    }

    .form-popup textarea {
        height: 60px;
    }
}

.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    width: auto;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification-content {
    position: relative;
}

.notification-message {
    display: block;
    color: #2C3E50;
    font-size: 14px;
    font-weight: 500;
}

.notification-progress {
    position: absolute;
    bottom: -16px;
    left: -24px;
    width: calc(100% + 48px);
    height: 3px;
    background: #4A90E2;
    border-radius: 0 0 8px 8px;
    transform-origin: left;
    animation: progress 3s linear forwards;
}

@keyframes progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 768px) {
    .notification {
        width: 90%;
        padding: 12px 20px;
    }
}