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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, #0d4b3c 0%, #1a6b4a 50%, #2d8659 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 300;
}

/* Search Section */
.search-section {
    background: white;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 500;
}

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

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #1a6b4a;
}

.btn-search {
    padding: 0.75rem 1.5rem;
    background: #1a6b4a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.btn-search:hover {
    background: #0d4b3c;
}

.filter-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-row select {
    padding: 0.6rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.filter-row select:focus {
    outline: none;
    border-color: #1a6b4a;
}

.btn-reset {
    padding: 0.6rem 1.2rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reset:hover {
    background: #c0392b;
}

.result-count {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Content Section */
.content-section {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    width: 100%;
}

.map-container {
    position: sticky;
    top: 140px;
    height: calc(100vh - 180px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

.list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Mosque Card */
.mosque-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #1a6b4a;
}

.mosque-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.mosque-card.active {
    border-left-color: #e74c3c;
    box-shadow: 0 6px 20px rgba(26, 107, 74, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.card-header h3 {
    font-size: 1.15rem;
    color: #0d4b3c;
    font-weight: 700;
}

.card-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: #e8f5e9;
    color: #1a6b4a;
    font-weight: 600;
    white-space: nowrap;
}

.card-city {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.4rem;
}

.card-city::before {
    content: '📍 ';
}

.card-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: #888;
}

.card-meta span::before {
    margin-right: 0.25rem;
}

.btn-detail {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #1a6b4a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-detail:hover {
    background: #0d4b3c;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 2rem;
}

.modal-body h2 {
    font-size: 1.6rem;
    color: #0d4b3c;
    margin-bottom: 0.25rem;
}

.modal-city {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.modal-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #e8f5e9;
    color: #1a6b4a;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-section {
    margin-bottom: 1.25rem;
}

.modal-section h4 {
    font-size: 0.95rem;
    color: #1a6b4a;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid #e8f5e9;
    padding-bottom: 0.3rem;
}

.modal-section p {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.7;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.info-item {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
}

.info-item .label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    margin-top: 0.2rem;
}

.modal-map {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    margin-top: 0.75rem;
    border: 1px solid #ddd;
}

.btn-google-maps {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.6rem 1.2rem;
    background: #4285F4;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-google-maps:hover {
    background: #3367D6;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    grid-column: 1 / -1;
}

.no-results h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: #1a1a2e;
    color: #aaa;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    font-size: 0.85rem;
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
}

.popup-content h4 {
    color: #0d4b3c;
    margin-bottom: 0.25rem;
}

.popup-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.popup-content .popup-link {
    display: inline-block;
    margin-top: 0.4rem;
    color: #1a6b4a;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .content-section {
        grid-template-columns: 1fr;
    }

    .map-container {
        position: relative;
        top: 0;
        height: 350px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .filter-row select {
        min-width: 140px;
    }
}

@media (max-width: 500px) {
    header {
        padding: 1.2rem 1rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .search-box {
        flex-direction: column;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row select {
        min-width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}
