/* ==========================================
   DARJEELING HOMESTAY DIRECTORY
   STYLE.CSS (Optimized & Cleaned)
========================================== */

:root {
    --primary: #2E7D32;
    --secondary: #4CAF50;
    --accent: #FFC107;
    --light: #F5F7FA;
    --dark: #212529;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
    --radius: 18px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light);
    color: #444;
}

/* ==========================================
   OPTIMIZED NAVBAR & BRANDING
========================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1050;
    
    /* Slightly increased opacity so heavy blur isn't required */
    background: rgba(255, 255, 255, 0.85); 
    
    /* Optimized low-radius blur */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    /* Lighter box-shadow for smoother scroll */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    
    /* Explicit transitions only on transform/opacity for GPU efficiency */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    padding: 14px 0;

    /* Hardware acceleration */
    will-change: transform;
    transform: translateZ(0);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
} 

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--primary) !important;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.brand-name {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .5px;
}

.brand-name:hover {
    color: #157347;
}

.nav-link {
    position: relative;
    font-weight: 600;
    color: #222 !important;
    margin-left: 18px;
    padding: 8px 16px;
    border-radius: 30px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 991px) {
    .navbar-collapse {
        margin-top: 12px;
        padding: 15px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.92);
        
        /* Drastically reduced blur radius for smooth mobile rendering */
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);

        border: 1px solid rgba(255, 255, 255, 0.30);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    .nav-link {
        margin: 8px 0;
        padding: 12px 16px;
    }
}

/* ==========================================
   HERO SECTION
========================================== */

.hero {
    position: relative;
    min-height: 70vh;
    background: url("https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1600&q=80") center center/cover no-repeat;
}

.hero-overlay {
    background: rgba(0, 0, 0, .55);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
}

.hero p {
    font-size: 20px;
}

.search-box {
    max-width: 700px;
    margin: auto;
}

.input-group {
    border-radius: 50px;
    overflow: hidden;
}

.input-group-text {
    border: none;
}

.form-control {
    border: none !important;
    box-shadow: none !important;
}

/* ==========================================
   FILTER SECTION
========================================== */

.filter-section {
    background: #fff;
    padding: 25px 0;
    position: sticky;
    top: 72px;
    z-index: 100;
}

.form-select {
    border-radius: 12px;
    height: 48px;
}

.form-range {
    cursor: pointer;
}

/* ==========================================
   DIRECTORY & HOMESTAY CARDS
========================================== */

.directory-section {
    padding: 70px 0;
}

.directory-section h3 {
    font-weight: 700;
}

#resultCount {
    font-size: 20px;
}

.homestay-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .35s ease, box-shadow .35s ease;
    position: relative;
    height: 100%;
}

.homestay-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

.card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.homestay-card:hover img {
    transform: scale(1.08);
}

.wishlist {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    cursor: pointer;
    font-size: 22px;
    transition: transform .3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .15);
}

.wishlist:hover {
    transform: scale(1.1);
}

.price-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: var(--primary);
    color: #fff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E8F5E9;
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
}

.card-body {
    padding: 22px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-text {
    color: #666;
    line-height: 1.7;
}

.amenity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.amenity {
    background: #F1F8E9;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.btn-view {
    width: 100%;
    border-radius: 40px;
    padding: 12px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    transition: background .3s ease, transform .3s ease;
}

.btn-view:hover {
    background: #1B5E20;
    transform: translateY(-2px);
}

/* ==========================================
   UI STATES & FLOATING ACTIONS
========================================== */

#loading,
#noResult {
    padding: 80px 0;
}

.spinner-border {
    width: 3.5rem;
    height: 3.5rem;
}

#noResult i {
    opacity: .4;
}

#topBtn,
#floatingWishlist {
    position: fixed;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
}

#topBtn {
    bottom: 25px;
    display: none;
}

#floatingWishlist {
    bottom: 95px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
}

.guide-fab {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    z-index: 999;
    transition: transform .3s ease;
}

.guide-fab:hover {
    transform: scale(1.1);
    color: white;
}

/* ==========================================
   MODALS, TOASTS & SECTIONS
========================================== */

.modal-content {
    border-radius: 20px;
    overflow: hidden;
}

#previewImage {
    max-height: 85vh;
    object-fit: cover;
}

.toast {
    border-radius: 14px;
}

#about {
    background: #ffffff;
}

#about h2,
#contact .card-title,
footer h4,
footer h5 {
    font-weight: 700;
}

#about p {
    color: #666;
    line-height: 1.9;
}

#contact .card {
    border-radius: 20px;
    box-shadow: var(--shadow);
}

#contact p {
    margin-bottom: 15px;
}

footer {
    background: #1c1c1c;
}

footer a {
    transition: color .3s ease;
}

footer a:hover {
    color: var(--accent) !important;
}

footer hr {
    border-color: rgba(255, 255, 255, .15);
}

/* ==========================================
   ANIMATIONS & SCROLLBAR
========================================== */

.fade-up {
    animation: fadeUp .8s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zoom {
    animation: zoom .4s ease;
}

@keyframes zoom {
    from {
        transform: scale(.9);
    }
    to {
        transform: scale(1);
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: #eee;
}

/* ==========================================
   UTILITIES
========================================== */

.shadow-hover {
    transition: box-shadow .3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, .15);
}

.rounded-xl {
    border-radius: 20px;
}

.text-primary-green {
    color: var(--primary);
}

.bg-primary-green {
    background: var(--primary);
}

.cursor-pointer {
    cursor: pointer;
}

.object-cover {
    object-fit:cover;
}

.transition {
    transition: all .3s ease;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */

@media (max-width: 992px) {
    .hero,
    .hero-overlay {
        min-height: 60vh;
    }

    .hero-overlay {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 18px;
    }

    .filter-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .brand-name {
        font-size: 1.45rem;
    }

    .brand-logo {
        width: 45px;
        height: 45px;
    }

    .hero,
    .hero-overlay {
        min-height: 55vh;
    }

    .hero-overlay {
        padding: 30px 15px;
    }

    .hero h1 {
        font-size: 34px;
        line-height: 1.3;
    }

    .hero p {
        font-size: 16px;
    }

    .search-box {
        margin-top: 25px;
    }

    .filter-section {
        padding: 18px 15px;
    }

    .directory-section {
        padding: 40px 0;
    }

    .card-image {
        height: 220px;
    }

    .card-title {
        font-size: 22px;
    }

    .card-body {
        padding: 18px;
    }

    #topBtn {
        width: 50px;
        height: 50px;
        right: 18px;
        bottom: 18px;
    }

    #floatingWishlist {
        width: 50px;
        height: 50px;
        right: 18px;
        bottom: 80px;
    }
}

@media (max-width: 576px) {
    .hero,
    .hero-overlay {
        min-height: 50vh;
    }

    .hero-overlay {
        padding: 25px 15px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 15px;
    }

    .search-box .form-control {
        font-size: 15px;
    }

    .search-box .input-group {
        border-radius: 14px;
    }

    .filter-section {
        padding: 15px;
        border-radius: 15px;
    }

    .directory-section h3 {
        font-size: 24px;
    }

    .card-image {
        height: 200px;
    }

    .wishlist {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .price-badge {
        font-size: 13px;
        padding: 6px 14px;
    }

    .location-badge {
        font-size: 12px;
    }

    .amenity {
        font-size: 12px;
        padding: 5px 10px;
    }

    .btn-view {
        padding: 11px;
    }

    footer {
        text-align: center;
    }

    footer .col-lg-4,
    footer .col-lg-3,
    footer .col-lg-2,
    footer .col-md-6 {
        margin-bottom: 30px;
    }
}

@media (max-width: 380px) {
    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .card-title {
        font-size: 20px;
    }
}

@media (max-width: 991px) {
    .navbar-collapse {
        margin-top: 12px;
        padding: 15px;
        
        /* 1. Use a solid or semi-transparent fallback background instead of heavy multi-layer blurring */
        background: rgba(255, 255, 255, 0.92);
        
        /* 2. Reduce the blur radius drastically (e.g., from 25px to 5px) to ease GPU strain */
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);

        border: 1px solid rgba(255, 255, 255, 0.30);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

        /* 3. Force GPU acceleration layer */
        transform: translateZ(0);
        will-change: transform, opacity;
    }

    .nav-link {
        margin: 8px 0;
        padding: 12px 16px;
    }
}
