body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

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

.info-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 300px;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
}

.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 20px;
    border-radius: 5px;
    max-width: 400px;
    z-index: 1001;
    display: none;
}

.tree-info {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 3px;
    display: none;
}

.tree-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.tree-item {
    padding: 8px;
    margin: 5px 0;
    background: #f0f0f0;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tree-item:hover {
    background: #e0e0e0;
}

.tree-item.dead {
    background: #ffebee;
    border-left: 3px solid #f44336;
}

.tree-item.alive {
    background: #e8f5e8;
    border-left: 3px solid #4caf50;
}

.user-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.user-info a {
    color: #228b22;
    text-decoration: none;
    margin-left: 10px;
}

.tree-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.star-rating {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star.active, .star:hover {
    color: #ffd700;
}

.review-form {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.existing-reviews {
    margin-top: 20px;
}

.review-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.review-rating {
    color: #ffd700;
}

.tree-images {
    margin: 20px 0;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.tree-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.upload-section {
    margin: 15px 0;
    padding: 15px;
    background: #f0f8f0;
    border-radius: 4px;
}

.btn {
    background: #228b22;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
}

.btn.admin-btn {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
    margin: 0;
}

.btn.full-width {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin: 0;
}

.btn:hover {
    background: #1e7b1e;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Authentication styles */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-tab.active {
    background: #228b22;
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

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

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group textarea {
    width: 100%;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
}

.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #228b22;
    text-decoration: none;
}

/* Admin styles */
.admin-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.admin-header {
    background: #228b22;
    color: white;
    padding: 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
}

.admin-nav {
    background: #f5f5f5;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.admin-nav a {
    margin-right: 15px;
    text-decoration: none;
    color: #228b22;
    font-weight: bold;
}

.pending-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.image-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.image-info {
    margin-bottom: 15px;
}

.image-info h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.image-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.image-actions {
    display: flex;
    gap: 10px;
}

.btn-approve {
    background: #28a745;
    color: white;
}

.btn-approve:hover {
    background: #218838;
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-reject:hover {
    background: #c82333;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #228b22;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Form styles */
.form-inline {
    flex: 1;
}

/* === NEW IMPROVEMENTS === */

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #228b22;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search and filter box */
.search-box {
    position: absolute;
    top: 80px;
    left: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 320px;
    min-width: 280px;
    max-width: calc(100vw - 300px); /* Leave space for user info */
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #228b22;
    box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.2);
}

.filter-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f5f5f5;
}

.filter-btn.active {
    background: #228b22;
    color: white;
    border-color: #228b22;
}

/* Notification system */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 3000;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification.show {
    opacity: 1;
    pointer-events: auto;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* User info improvements */
.user-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 14px;
    max-width: 250px;
}

.user-info a {
    color: #228b22;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
}

.user-info a:hover {
    text-decoration: underline;
}

/* Better tree marker icons */
.tree-marker-alive {
    background: radial-gradient(circle, #4CAF50 30%, #2E7D32 100%);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tree-marker-dead {
    background: radial-gradient(circle, #9E9E9E 30%, #424242 100%);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    .search-box {
        position: absolute;
        top: 80px;
        left: 10px;
        right: 10px;
        max-width: none;
        min-width: auto;
        width: calc(100% - 20px);
    }
    
    .user-info {
        position: absolute;
        top: 10px;
        right: 10px;
        left: auto;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .info-panel {
        position: absolute;
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        width: calc(100% - 20px);
    }
    
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }
    
    .search-box h4 {
        font-size: 14px;
    }
    
    .filter-buttons {
        justify-content: space-between;
    }
}
