/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', 'Noto Sans Bengali', Arial, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
}

/* ===== HEADER ===== */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a6b3c, #2d8a52);
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

#header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

#header p {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 2px;
}

#stats {
    font-size: 0.78rem;
    background: rgba(255,255,255,0.15);
    padding: 5px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ===== MAP ===== */
#map {
    position: fixed;
    top: 60px; bottom: 0; left: 0; right: 0;
    z-index: 1;
}

/* ===== LOADING SPINNER ===== */
#loading {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #2d8a52;
    font-weight: 600;
    transition: opacity 0.3s;
}

#loading.hidden { display: none; }

.spinner {
    width: 18px; height: 18px;
    border: 3px solid #e2e8f0;
    border-top-color: #2d8a52;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===== ADD MOSQUE BANNER ===== */
#add-mosque-banner {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    background: #fff8e1;
    border: 2px solid #f6c90e;
    color: #7d6608;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

#add-mosque-banner.hidden { display: none; }

#add-mosque-banner button {
    background: #f6c90e;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: #7d6608;
}

/* ===== LEGEND ===== */
#legend {
    position: fixed;
    bottom: 100px;
    left: 12px;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#legend div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
}

.legend-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.legend-dot.biryani { background: #e53e3e; box-shadow: 0 0 6px rgba(229,62,62,0.6); }
.legend-dot.unverified { background: #ed8936; }
.legend-dot.none { background: #a0aec0; }
.legend-dot.me { background: #4299e1; }

/* ===== FLOATING BUTTONS ===== */
#btn-locate {
    position: fixed;
    bottom: 160px;
    right: 14px;
    z-index: 1000;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#btn-locate:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }

#fab-add-mosque {
    position: fixed;
    bottom: 105px;
    right: 14px;
    z-index: 1000;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: #f6c90e;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(246,201,14,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#fab-add-mosque:hover { transform: scale(1.1); }

#fab-report {
    position: fixed;
    bottom: 24px;
    right: 14px;
    z-index: 1000;
    background: linear-gradient(135deg, #1a6b3c, #2d8a52);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 14px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(26,107,60,0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#fab-report:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(26,107,60,0.6); }

/* ===== MODALS ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal.hidden { display: none; }

.modal-content {
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 36px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a6b3c;
    margin-bottom: 8px;
}

.modal-hint {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin: 12px 0 6px;
}

.modal-content input[type="text"],
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    border-color: #2d8a52;
}

.modal-content textarea {
    min-height: 80px;
    resize: vertical;
}

.selected-mosque-box {
    background: #f0fff4;
    border: 2px solid #c6f6d5;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #276749;
    font-weight: 600;
    min-height: 42px;
}

.btn-primary {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, #1a6b3c, #2d8a52);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; }

.btn-cancel {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: #f7fafc;
    color: #718096;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover { background: #edf2f7; }

/* ===== MAP POPUP ===== */
.mosque-popup {
    min-width: 220px;
    max-width: 300px;
    font-family: inherit;
}

.mosque-popup h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a6b3c;
    margin-bottom: 4px;
}

.mosque-popup .mosque-address {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 10px;
}

.report-card {
    background: #f7fafc;
    border-radius: 10px;
    padding: 10px;
    margin: 8px 0;
    border-left: 3px solid #2d8a52;
}

.report-card p {
    font-size: 0.82rem;
    color: #4a5568;
    margin-bottom: 4px;
}

.trust-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    margin: 6px 0;
    overflow: hidden;
    position: relative;
}

.trust-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #2d8a52, #48bb78);
    transition: width 0.5s ease;
}

.trust-label {
    font-size: 0.72rem;
    color: #718096;
    margin-bottom: 6px;
}

.vote-buttons {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.vote-buttons button {
    flex: 1;
    padding: 6px 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.vote-yes { background: #c6f6d5; color: #276749; }
.vote-no { background: #fed7d7; color: #822727; }
.vote-yes:hover, .vote-no:hover { opacity: 0.8; }

.no-report {
    font-size: 0.8rem;
    color: #a0aec0;
    font-style: italic;
    margin: 8px 0;
}

.popup-report-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: linear-gradient(135deg, #1a6b3c, #2d8a52);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.popup-report-btn:hover { opacity: 0.9; }

/* ===== CUSTOM MAP MARKERS ===== */
.marker-biryani, .marker-unverified, .marker-default {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.marker-biryani {
    background: radial-gradient(circle, #ff6b6b, #e53e3e);
    font-size: 24px;
    animation: pulse-red 1.5s infinite;
}

.marker-unverified {
    background: radial-gradient(circle, #fbb040, #ed8936);
    font-size: 20px;
}

.marker-default {
    background: radial-gradient(circle, #a0aec0, #718096);
    font-size: 18px;
}

@keyframes pulse-red {
    0%   { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7); }
    70%  { box-shadow: 0 0 0 14px rgba(229, 62, 62, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0); }
}

/* ===== USER LOCATION DOT ===== */
.user-location-dot {
    width: 18px;
    height: 18px;
    background: #4299e1;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(66,153,225,0.6);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(66,153,225,0.5); }
    70% { box-shadow: 0 0 0 12px rgba(66,153,225,0); }
    100% { box-shadow: 0 0 0 0 rgba(66,153,225,0); }
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 4000;
    background: #1a202c;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: #276749; }
.toast.error { background: #822727; }
.toast.info { background: #2b6cb0; }

/* ===== CURSOR FOR ADD MODE ===== */
body.add-mosque-mode #map {
    cursor: crosshair !important;
}

body.add-mosque-mode #map .leaflet-interactive {
    cursor: crosshair !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    #header h1 { font-size: 1rem; }
    #stats { font-size: 0.72rem; }
    #fab-report { font-size: 0.85rem; padding: 12px 18px; }
    #legend { font-size: 0.7rem; padding: 8px 10px; }
    .modal-content { padding: 20px 16px 32px; }
}
