/* ============================================
   NGO MAP POPUP & INTERACTION STYLES
   Extracted from inline JavaScript for better performance
   Note: @keyframes spin moved to static/css/animations.css
   ============================================ */

/* Enhanced popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
    max-width: 350px;
    overflow: hidden;
}

/* Force text visibility in popups */
.leaflet-popup-content a,
.leaflet-popup-content button {
    text-decoration: none !important;
}

.leaflet-popup-content .popup-btn * {
    color: inherit !important;
}

.leaflet-popup-close-button {
    background: rgba(255,255,255,0.9) !important;
    color: #333 !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    top: 8px !important;
    right: 8px !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease !important;
}

.leaflet-popup-close-button:hover {
    background: #fff !important;
    transform: scale(1.1) !important;
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
    padding: 0;
}

/* Enhanced Popup Components */
.enhanced-popup {
    font-family: inherit;
    overflow: hidden;
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    margin: 0;
}

.popup-header-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.popup-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.popup-title-section {
    flex: 1;
    min-width: 0;
}

.popup-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

.popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.verified-badge {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.status-badge.ongoing {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.status-badge.completed {
    background: rgba(108, 117, 125, 0.9);
    color: white;
}

.category-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.distance-badge {
    background: rgba(23, 162, 184, 0.9);
    color: white;
}

.popup-content {
    padding: 12px;
    background: white;
}

.popup-location,
.popup-ngo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #6c757d;
}

.popup-description {
    margin: 8px 0;
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.4;
}

.popup-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin: 0;
}

.popup-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-shadow: none;
    line-height: 1.2;
}

.primary-btn {
    background: #007bff !important;
    color: white !important;
    flex: 1;
    justify-content: center;
    font-weight: 600;
    text-shadow: none;
    border: none;
}

.primary-btn:hover {
    background: #0056b3 !important;
    color: white !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.primary-btn:visited,
.primary-btn:focus,
.primary-btn:active {
    color: white !important;
    text-decoration: none !important;
}

.secondary-btn {
    background: #28a745 !important;
    color: white !important;
}

.secondary-btn:hover {
    background: #1e7e34 !important;
    color: white !important;
    transform: translateY(-1px);
}

.secondary-btn:visited,
.secondary-btn:focus,
.secondary-btn:active {
    color: white !important;
    text-decoration: none !important;
}

.tertiary-btn {
    background: #6c757d !important;
    color: white !important;
    width: 40px;
    justify-content: center;
}

.tertiary-btn:hover {
    background: #545b62 !important;
    color: white !important;
    transform: translateY(-1px);
}

.tertiary-btn:visited,
.tertiary-btn:focus,
.tertiary-btn:active {
    color: white !important;
    text-decoration: none !important;
}

/* Project-specific styling */
.project-popup .popup-header {
    background: linear-gradient(135deg, #fd746c 0%, #ff9068 100%);
}

/* NGO-specific styling */
.ngo-popup .popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Responsive popup */
@media (max-width: 480px) {
    .leaflet-popup-content-wrapper {
        max-width: 280px;
    }

    .popup-header {
        padding: 12px;
    }

    .popup-content {
        padding: 12px;
    }

    .popup-actions {
        padding: 12px;
        flex-wrap: wrap;
    }

    .popup-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* Smooth transitions for filters */
.filter-group, .btn-group {
    transition: all 0.3s ease;
}

/* Enhanced button styling */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .map-search-box {
        width: calc(100% - 30px);
        left: 15px;
        right: 15px;
    }

    .map-filters {
        flex-direction: column;
        gap: 8px !important;
    }

    .filter-group .form-select {
        min-width: 100px;
    }

    .btn-group {
        flex-wrap: wrap;
    }
}

/* Share Modal Styles */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.share-modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    margin: 20px;
}

.share-modal-title {
    margin: 0 0 16px 0;
}

.share-modal-text {
    margin: 0 0 16px 0;
    color: #666;
}

.share-modal-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 16px;
}

.share-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
