:root {
    --primary-green: #4a8f5c;
    --dark-green: #2e7d32;
    --light-green: #bff4cd;
    --primary-red: #c62828;
    --border-color: #ddd;
}

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

main {
    height: 100%;
}

#map {
    height: 100vh;
    width: 100vw;
}

/* Header */
.header {
    position: absolute;
    top: 10px;
    left: 50px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.93);
    padding: 8px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 {
    margin: 0;
    font-family: 'Climate Crisis', display, sans-serif;
    font-size: 1.4em;
    color: var(--primary-green);
}

.header select {
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

/* Controls */
.controls {
    position: absolute;
    bottom: 30px;
    right: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons */
button {
    background-color: var(--primary-green);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-family: 'Chocolate Classical Sans', system-ui, sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

button:hover {
    background-color: var(--dark-green);
}

#cancel-btn {
    background-color: #888;
}

#cancel-btn:hover {
    background-color: #666;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    width: 90%;
    max-width: 460px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-top: 0;
    color: var(--primary-green);
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover, .close-btn:focus {
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.form-group input[type="file"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95em;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.modal-hint {
    color: #666;
    font-size: 0.88em;
    margin-top: 0;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 3000;
    background: #fff;
    padding: 10px 15px;
    border-radius: 0 0 5px 0;
}

.skip-link:focus {
    left: 0;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
}

.notification {
    padding: 11px 16px;
    border-radius: 6px;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
    font-size: 0.93em;
}

.notification.hide { opacity: 0; }
.notification.success { background-color: var(--primary-green); }
.notification.error   { background-color: var(--primary-red); }
.notification.warning { background-color: #e65100; }
.notification.info    { background-color: #1565c0; }

/* Placement mode */
.placement-hint {
    position: fixed;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.92em;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    animation: hint-in 0.18s ease;
}

@keyframes hint-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#add-report-btn[aria-pressed="true"] {
    background-color: var(--primary-red);
}
#add-report-btn[aria-pressed="true"]:hover {
    background-color: #a00000;
}

/* Report popup */
.report-popup {
    font-family: system-ui, sans-serif;
    min-width: 160px;
}
.popup-type {
    color: var(--dark-green);
    display: block;
    font-size: 1em;
}
.popup-meta {
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}
.popup-desc {
    margin: 6px 0 0;
    font-size: 0.9em;
}
.popup-media {
    max-width: 100%;
    margin-top: 6px;
    border-radius: 4px;
    display: block;
}
.popup-comments {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
    font-size: 0.82em;
}
.popup-loading,
.popup-no-comments {
    color: #bbb;
}
.popup-comments-heading {
    font-weight: bold;
    color: #555;
    margin-bottom: 4px;
}
.popup-comment-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #f5f5f5;
}
.popup-comment-time {
    color: #bbb;
    white-space: nowrap;
    flex-shrink: 0;
}
.popup-edit-btn {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.82em;
    padding: 4px 12px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: none;
}
.popup-edit-btn:hover {
    background: var(--dark-green);
}

/* Mobile */
@media (max-width: 600px) {
    .header { left: 10px; right: 10px; top: 8px; }
    .header h1 { font-size: 1.1em; }
    .controls { bottom: 20px; right: 12px; }
    .placement-hint { font-size: 0.85em; padding: 8px 14px; white-space: normal; max-width: 80vw; }
}
