/**
 * Ganpati Visarjan Portal - Stylesheet
 * Vibrant Devotional Palette & Modern UI
 */

:root {
    --primary-orange: #ea580c;
    --primary-hover: #c2410c;
    --marigold-gold: #f59e0b;
    --festive-red: #dc2626;
    --eco-green: #10b981;
    --ocean-blue: #0284c7;
    --dark-slate: #0f172a;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --border-subtle: #e2e8f0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-color: var(--body-bg);
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Navbar */
.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--dark-slate) !important;
}
.navbar-brand .om-symbol {
    color: var(--primary-orange);
    font-size: 1.5rem;
    line-height: 1;
}
.nav-link {
    font-weight: 500;
    color: #475569 !important;
    transition: all 0.2s ease;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-orange) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #7c2d12 0%, #c2410c 50%, #ea580c 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.6;
    pointer-events: none;
}
.hero-title {
    font-weight: 900;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-search-box {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 35px -10px rgba(0,0,0,0.25);
    padding: 0.75rem;
}

/* Cards */
.location-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--card-bg);
}
.location-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.08);
}
.location-card-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #e2e8f0;
}
.location-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.location-card:hover .location-card-img-wrapper img {
    transform: scale(1.05);
}
.card-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    backdrop-filter: blur(6px);
    background: rgba(15, 23, 42, 0.85) !important;
    font-weight: 600;
}
.card-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

/* Map Containers */
#masterMap {
    height: 520px;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: 1px solid var(--border-subtle);
    z-index: 1;
}
#detailMap {
    height: 380px;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    z-index: 1;
}
#adminMapPicker {
    height: 320px;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    z-index: 1;
}

/* Map Markers and Popups */
.leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}
.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
    min-width: 240px;
}
.map-popup-card {
    border: none;
}
.map-popup-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}
.map-popup-body {
    padding: 12px 14px;
}
.custom-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 2px solid #ffffff;
    transition: transform 0.2s;
}
.custom-map-pin:hover {
    transform: scale(1.15);
}

/* Emergency & Helpline Strip */
.emergency-strip {
    background: linear-gradient(90deg, #b91c1c, #dc2626);
    color: #ffffff;
}
.emergency-btn {
    background: #ffffff;
    color: #dc2626;
    font-weight: 700;
    border-radius: 2rem;
    padding: 0.35rem 1.25rem;
    transition: all 0.2s;
}
.emergency-btn:hover {
    background: #fef2f2;
    color: #991b1b;
}

/* Helpline Numbers Box */
.helpline-card {
    border-left: 4px solid var(--festive-red);
    background: #fff5f5;
    border-radius: 0.75rem;
    padding: 1rem;
}
.helpline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #fecaca;
}
.helpline-item:last-child {
    border-bottom: none;
}

/* Facility Chips */
.facility-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: #f1f5f9;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.facility-chip i {
    color: var(--primary-orange);
    font-size: 1rem;
}

/* Eco-Friendly Banner */
.eco-banner {
    background: linear-gradient(135deg, #065f46 0%, #059669 100%);
    color: #ffffff;
    border-radius: 1rem;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}
.eco-banner::after {
    content: '♻️';
    position: absolute;
    right: 20px;
    bottom: -15px;
    font-size: 9rem;
    opacity: 0.15;
    pointer-events: none;
}

/* Admin Styles */
.admin-sidebar {
    min-height: calc(100vh - 60px);
    background: #0f172a;
    color: #cbd5e1;
}
.admin-sidebar .nav-link {
    color: #94a3b8 !important;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    color: #ffffff !important;
    background: rgba(234, 88, 12, 0.2);
    border-left: 3px solid var(--primary-orange);
}
.admin-stat-card {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.admin-stat-card:hover {
    transform: translateY(-3px);
}

/* Photo Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.gallery-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    height: 160px;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.08);
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    margin-top: auto;
}
footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}
footer a:hover {
    color: #fb923c;
}

/* ==============================================================================
 * Native Mobile App UI & Location Share Facility
 * ============================================================================== */

/* Mobile Touch & Optimization */
@media (max-width: 768px) {
    body {
        /* Extra padding so bottom nav doesn't cover content */
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 12px)) !important;
        -webkit-tap-highlight-color: transparent;
    }

    /* Make cards feel like native app list items */
    .location-card {
        border-radius: 1.25rem !important;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    }
    .hero-section {
        border-radius: 0 0 1.75rem 1.75rem;
    }
    .hero-search-box {
        border-radius: 1.25rem;
    }
}

/* Fixed Native Bottom Navigation Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1045;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #64748b;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-orange);
}

.mobile-bottom-nav .nav-item.active i {
    transform: translateY(-2px);
}

.mobile-bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 5px;
    height: 5px;
    background-color: var(--primary-orange);
    border-radius: 50%;
}

/* Elevated Center Live Map Icon in Bottom Nav */
.mobile-bottom-nav .nav-item-map {
    position: relative;
    top: -12px;
}

.mobile-bottom-nav .map-icon-bubble {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.45);
    border: 3px solid #ffffff;
    transition: transform 0.2s;
}

.mobile-bottom-nav .nav-item-map:active .map-icon-bubble {
    transform: scale(0.92);
}

.mobile-bottom-nav .nav-item-map i {
    font-size: 1.35rem;
    margin-bottom: 0;
    color: #ffffff;
}

.mobile-bottom-nav .nav-item-map span {
    color: var(--primary-orange);
    font-weight: 700;
    margin-top: 2px;
}

/* Native App-Style Location Share Bottom Sheet Modal */
.share-bottom-sheet .modal-dialog {
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
}

.share-bottom-sheet .modal-content {
    border-radius: 1.75rem 1.75rem 0 0;
    border: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    padding-bottom: env(safe-area-inset-bottom, 15px);
}

.share-sheet-handle {
    width: 44px;
    height: 5px;
    background-color: #cbd5e1;
    border-radius: 3px;
    margin: 10px auto 16px;
}

.share-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 0.5rem;
    border-radius: 1rem;
    text-decoration: none;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    font-size: 0.8rem;
    font-weight: 600;
}

.share-option-btn:hover, .share-option-btn:active {
    background: #f1f5f9;
    transform: translateY(-2px);
    color: #0f172a;
}

.share-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.share-icon-whatsapp { background: #25D366; }
.share-icon-telegram { background: #0088cc; }
.share-icon-copy { background: #475569; }
.share-icon-native { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.share-icon-gmaps { background: #4285F4; }

/* Sticky Mobile Quick Action Bar on Detail Page */
.mobile-sticky-action-bar {
    position: fixed;
    bottom: 64px; /* Sits right above the bottom navigation bar */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid #e2e8f0;
    padding: 0.65rem 1rem;
    z-index: 1039;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

/* Card Quick Share Button */
.btn-card-share {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.btn-card-share:hover, .btn-card-share:active {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
    transform: scale(1.08);
}

/* Toast alert notification */
.share-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    display: none;
    align-items: center;
    gap: 0.5rem;
    animation: toastPop 0.3s ease;
}

@keyframes toastPop {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

