/* === Reset & Basis ========================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    color: #1f2937;
}

/* === Hauptkarte (Vollbild, direkt Leaflet) ================= */
#main-map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* === Upload-Button ========================================= */
#upload-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    padding: 0.9rem 1.4rem;
    font-size: 1.05rem;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
}

#upload-btn:hover {
    transform: scale(1.05);
}

/* === Modal ================================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 1rem;
    padding: 1.8rem;
    width: 92%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

h2 {
    margin-bottom: 0.8rem;
}

h3 {
    margin: 1.2rem 0 0.3rem;
}

.hint {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* === Dropzone ============================================== */
#dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.6rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    margin: 0.8rem 0;
    transition: all 0.2s;
}

#dropzone.dragover {
    border-color: #f59e0b;
    background: #fffbeb;
}

#dropzone input {
    display: none;
}

/* === Vorschau ============================================== */
#preview-container {
    text-align: center;
    margin: 0.8rem 0;
}

#preview-img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 0.5rem;
}

.btn-small {
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: #e5e7eb;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
}

/* === Standort ============================================== */
#location-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#location-buttons button {
    padding: 0.45rem 1rem;
    background: #e5e7eb;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

#location-buttons button:hover {
    background: #d1d5db;
}

#mini-map {
    height: 240px;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
}

.coord-row {
    display: flex;
    gap: 0.8rem;
}

.coord-row label {
    flex: 1;
    font-size: 0.85rem;
    color: #6b7280;
}

.coord-row input {
    width: 100%;
    padding: 0.45rem;
    margin-top: 0.2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.4rem;
}

#status-msg {
    min-height: 1.4rem;
    font-size: 0.9rem;
    margin: 0.4rem 0;
    color: #059669;
}

/* === Optionale Felder ====================================== */
details {
    margin: 1rem 0;
}

details summary {
    cursor: pointer;
    color: #6b7280;
    font-size: 0.9rem;
}

details label {
    display: block;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #6b7280;
}

details input,
details textarea {
    width: 100%;
    padding: 0.45rem;
    margin-top: 0.15rem;
    border: 1px solid #d1d5db;
    border-radius: 0.4rem;
}

/* === Submit-Button ========================================= */
#submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.05rem;
    cursor: pointer;
    margin-top: 0.8rem;
    transition: background 0.2s;
}

#submit-btn:hover:not(:disabled) {
    background: #059669;
}

#submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* === Popup-Styling ========================================= */
.leaflet-popup-content img {
    display: block;
    max-width: 100%;
    border-radius: 6px;
}

.leaflet-popup-content h4 {
    margin: 8px 0 4px;
    font-size: 1rem;
}

.leaflet-popup-content p {
    margin: 4px 0;
    font-size: 0.9rem;
}

.photo-marker {
    border-radius: 50%;
    border: 3px solid #f59e0b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

/* === Responsive ============================================ */
.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.2rem;
    }

    #mini-map {
        height: 200px;
    }

    .coord-row {
        flex-direction: column;
        gap: 0.4rem;
    }
}