* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    flex: 1;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Hamburger Menu Button */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1002;
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.menu-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-items li {
    border-bottom: 1px solid #eee;
}

.menu-items a {
    display: block;
    padding: 18px 20px;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.menu-items a:hover {
    background: #f5f5f5;
    color: #2a5298;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close:hover {
    color: #333;
}

#modalBody h2 {
    color: #1e3c72;
    margin-top: 0;
    margin-bottom: 20px;
}

#modalBody h3 {
    color: #2a5298;
    margin-top: 20px;
    margin-bottom: 10px;
}

#modalBody p {
    line-height: 1.6;
    margin-bottom: 15px;
}

#modalBody ul {
    line-height: 1.8;
    margin-left: 20px;
}

#modalBody a {
    color: #2a5298;
    text-decoration: none;
}

#modalBody a:hover {
    text-decoration: underline;
}

/* Form Styles */
.contribute-form {
    margin: 20px 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a5298;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.form-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.form-success p {
    margin: 10px 0;
}

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

.stat-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #2a5298;
    font-size: 2rem;
}

.stat-card p {
    margin: 0;
    color: #666;
}


/* Search Container */
.search-container {
    background: white;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#searchInput {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #2a5298;
}

.stats {
    padding: 10px 20px;
    background: #f0f7ff;
    border-radius: 8px;
    font-weight: 600;
    color: #1e3c72;
}

/* Map */
#map {
    height: calc(100vh - 250px);
    min-height: 500px;
    z-index: 1;
}

/* Info Panel */
.info-panel {
    position: fixed;
    right: 20px;
    top: 180px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 1000;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    transition: all 0.3s ease;
    display: none; /* Hidden by default */
}

.info-panel.visible {
    display: block;
}

.info-panel.hidden {
    display: none;
}

.info-content h3 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.info-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.info-content ul {
    list-style: none;
    padding-left: 0;
}

.info-content ul li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-content ul li:last-child {
    border-bottom: none;
}

/* Mosque Details in Info Panel */
.mosque-detail {
    margin: 10px 0;
}

.mosque-detail label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.mosque-detail .value {
    color: #333;
    font-size: 1rem;
    margin-bottom: 10px;
}

.mosque-detail a {
    color: #2a5298;
    text-decoration: none;
}

.mosque-detail a:hover {
    text-decoration: underline;
}

/* Custom Marker Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    pointer-events: none;
}

.leaflet-popup-content {
    margin: 15px;
    line-height: 1.6;
    min-width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
}

.custom-popup {
    pointer-events: auto;
}

.custom-popup .leaflet-popup-content-wrapper {
    pointer-events: none;
}

.custom-popup .leaflet-popup-close-button {
    pointer-events: auto;
}

.custom-popup .leaflet-popup-tip-container {
    pointer-events: none;
}

.popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2a5298;
}

.popup-info {
    font-size: 0.9rem;
}

.popup-info p {
    margin: 5px 0;
}

.popup-info strong {
    color: #555;
}

.popup-more-info {
    margin-top: 10px;
    padding: 12px 15px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.popup-more-info:hover {
    background: #1e3c72;
}

.popup-more-info:active {
    transform: scale(0.98);
    background: #34A853;
}

/* Footer */
footer {
    background: #1e3c72;
    color: white;
    padding: 15px 0;
    text-align: center;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    header {
        padding: 15px 0;
    }
    
    .search-container {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }
    
    #searchInput {
        width: 100%;
    }
    
    .info-panel {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        margin: 10px;
        border-radius: 8px;
    }
    
    #map {
        height: calc(100vh - 200px);
        min-height: 400px;
    }
    
    .modal-content {
        max-height: 90vh;
        padding: 20px;
        margin: 10px;
    }
    
    .modal-close {
        top: 5px;
        right: 10px;
    }
    
    footer {
        margin-top: 0;
        padding: 10px 0;
    }
}

/* Marker Cluster Custom Styles */
.marker-cluster-small {
    background-color: rgba(42, 82, 152, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(42, 82, 152, 0.95);
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster-medium {
    background-color: rgba(30, 60, 114, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(30, 60, 114, 0.95);
    color: white;
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster-large {
    background-color: rgba(20, 40, 80, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(20, 40, 80, 0.95);
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mosque Icon Styling */
.custom-marker {
    background: none !important;
    border: none !important;
}

.mosque-icon {
    font-size: 32px;
    display: block;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.6));
    cursor: pointer;
    transition: transform 0.2s ease;
}

.custom-marker:hover .mosque-icon {
    transform: scale(1.2);
}

/* Loading Indicator */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(42, 82, 152, 0.3);
    border-radius: 50%;
    border-top-color: #2a5298;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
