/* ============================================
   CONSERVATIONTRIBUTE - COMPLETE STYLES v4.4
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   MAP CONTAINER
   ============================================ */

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   CONTROL BUTTONS
   ============================================ */

.controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.controls button {
    background: #2E7D32;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 180px;
}

.controls button:hover {
    background: #1B5E20;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.controls button:active {
    transform: translateY(0);
}

/* Mobile larger touch targets */
.touch-device .controls button {
    padding: 16px 24px;
    font-size: 1rem;
}

/* ============================================
   GEOCODER SEARCH BOX POSITIONING
   ============================================ */

.geocoder-container {
    position: relative;
    margin-top: 10px !important;
}

.mapboxgl-ctrl-geocoder {
    width: 240px;
    max-width: none;
}

/* ============================================
   MARKERS & CLUSTERS
   ============================================ */

.temp-marker {
    font-size: 30px;
    cursor: move;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.mini-popup {
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.modal-content.minimized {
    transform: translateY(calc(100% - 60px));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-controls {
    display: flex;
    gap: 10px;
}

.modal-controls button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-controls button:hover {
    opacity: 1;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
}

.modal-body {
    padding: 1.5rem;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2E7D32;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   LOCATION SELECTION
   ============================================ */

.location-info {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

.coords-display {
    font-family: monospace;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.location-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.location-btn {
    flex: 1;
    padding: 10px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-btn:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* ============================================
   PHOTO UPLOAD
   ============================================ */

.photo-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.photo-upload-area:hover {
    border-color: #4CAF50;
    background: #f0f8f0;
}

.photo-preview {
    position: relative;
}

.photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
}

.upload-text {
    color: #999;
    font-size: 1rem;
}

.clear-photo-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 2rem;
}

.save-btn, .cancel-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn {
    background: #4CAF50;
    color: white;
}

.save-btn:hover {
    background: #45a049;
}

.cancel-btn {
    background: #f5f5f5;
    color: #666;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* ============================================
   LIST VIEW
   ============================================ */

.filter-controls {
    margin-bottom: 20px;
}

.filter-controls select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
}

.tributes-list {
    max-height: 60vh;
    overflow-y: auto;
}

.tribute-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.tribute-item:hover {
    background: #f0f8f0;
    transform: translateX(5px);
}

.tribute-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tribute-header h3 {
    margin: 0;
    color: #2E7D32;
}

.tribute-type-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.tribute-thumb {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin: 10px 0;
}

.tribute-thumb.lazy {
    background: #f0f0f0;
}

.tribute-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tribute-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.tribute-actions button:first-child {
    background: #2196F3;
    color: white;
}

.tribute-actions button:last-child {
    background: #f44336;
    color: white;
}

.no-tributes {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

/* ============================================
   PHOTO POPUP
   ============================================ */

.photo-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.photo-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.photo-popup-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.photo-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.photo-navigation {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
}

.photo-nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
}

.photo-nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   PARCEL POPUP
   ============================================ */

.parcel-popup {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 20px;
    max-width: 300px;
    z-index: 1500;
}

.parcel-popup-content h3 {
    margin: 0 0 15px 0;
    color: #2E7D32;
}

.parcel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

#parcelInfo p {
    margin: 8px 0;
    font-size: 0.9rem;
}

#parcelInfo strong {
    color: #2E7D32;
}

/* ============================================
   TRIBUTE POPUP
   ============================================ */

.tribute-popup h3 {
    margin: 0 0 8px 0;
    color: #2E7D32;
}

.tribute-popup .tribute-type {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.tribute-popup img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin: 10px 0;
    cursor: pointer;
}

.popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.popup-actions button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.popup-actions button:first-child {
    background: #4CAF50;
    color: white;
}

.popup-actions button:last-child {
    background: #f44336;
    color: white;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 640px) {
    .controls {
        bottom: 20px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .controls button {
        min-width: auto;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .modal-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
    }
    
    .location-buttons {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .mapboxgl-ctrl-geocoder {
        width: 200px;
    }
}

/* ============================================
   MAPBOX CONTROL ADJUSTMENTS
   ============================================ */

.mapboxgl-ctrl-top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}