﻿/* ==========================================================
   SITE MASTER CSS (CLEANED & CONSOLIDATED + THEME FIX)
   ========================================================== */

/* ==========================================================
   1. GLOBAL BASE
   ========================================================== */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    padding-top: 50px;
    padding-bottom: 3rem;
    color: rgb(var(--bs-tertiary-color-rgb));
    background-color: var(--bs-body-bg);
}

h1, h2, h3, h4 {
    font-weight: 600;
}

/* ==========================================================
   2. HELPERS / BOOTSTRAP OVERRIDES
   ========================================================== */

.bi {
    vertical-align: -.125em;
    fill: currentColor;
}

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    user-select: none;
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

/* ==========================================================
   3. NAVBAR (VERTICAL CENTER FIXED)
   ========================================================== */

.navbar {
    min-height: unset !important;
    padding: 0.2rem 0 !important;
    transition: padding 0.2s ease;
    display: flex;
    align-items: center; /* 🔥 säker baseline centrering */
}

    .navbar .container,
    .navbar .container-fluid {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: flex;
        align-items: center; /* 🔥 fixar vertikal centrering */
    }

/* Brand */
.navbar-brand {
    font-size: 1rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}

    .navbar-brand img {
        max-height: 32px;
        width: auto;
    }

/* NAV WRAPPERS */
.navbar-collapse,
.navbar-nav {
    display: flex;
    align-items: start; /* 🔥 fixar hela nav-raden */
    margin-top: 0.4rem;
}

    /* Nav links */
    .navbar-nav .nav-link {
        position: relative;
        padding: 0.4rem 0.75rem;
        font-size: 0.95rem;
        line-height: 1;
        margin: 0;
        border-radius: 6px;
        transition: all 0.2s ease;
        display: inline-flex;
        /*display: flex;*/
        align-items: center; /* 🔥 text exakt center */
        
    }

        /* Hover / active */
        .navbar-nav .nav-link:hover {
            background-color: rgba(var(--bs-secondary-rgb), 0.15);
            color: var(--bs-emphasis-color);
        }

        .navbar-nav .nav-link.active {
            background-color: rgba(var(--bs-secondary-rgb), 0.25);
            font-weight: 500;
        }

        .navbar-nav .nav-link::after {
            content: "";
            position: absolute;
            left: 10%;
            bottom: 4px;
            width: 80%;
            height: 2px;
            background: currentColor;
            transform: scaleX(0);
            transition: transform 0.25s ease;
        }

        .navbar-nav .nav-link:hover::after,
        .navbar-nav .nav-link.active::after {
            transform: scaleX(1);
        }

/* Buttons */
.navbar .btn {
    padding: 0.2rem 0.55rem !important;
    font-size: 0.9rem;
    line-height: 1;
    display: inline-flex;
    align-items: center; /* 🔥 center fix */
    margin-top: 0.4rem;
}

/* Dropdown / language */
.navbar .dropdown-toggle {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

/* ==========================================================
   🎯 THEME BUTTON (BOOTSTRAP DOCS STYLE)
   ========================================================== */

.navbar .bd-mode-toggle .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.65rem !important;
    border-radius: 8px;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.25);
    color: var(--bs-emphasis-color);
    transition: all 0.2s ease;
    box-shadow: none !important;
}

    .navbar .bd-mode-toggle .btn:hover {
        background-color: rgba(var(--bs-primary-rgb), 0.18);
        border-color: rgba(var(--bs-primary-rgb), 0.35);
    }

[data-bs-theme="dark"] .navbar .bd-mode-toggle .btn {
    background-color: rgba(13, 110, 253, 0.12);
    border: 1px solid rgba(13, 110, 253, 0.25);
}

    [data-bs-theme="dark"] .navbar .bd-mode-toggle .btn:hover {
        background-color: rgba(13, 110, 253, 0.18);
        border-color: rgba(13, 110, 253, 0.35);
    }

/* Dropdown menu */
.navbar .dropdown-menu {
    z-index: 2000;
}

@media (min-width: 992px) {
    .navbar .dropdown-menu {
        position: absolute;
    }
}

/* ==========================================================
   3.1 MOBILE NAVBAR
   ========================================================== */

.navbar-collapse {
    padding-bottom: 0.75rem;
}

@media (max-width: 991.98px) {

    .navbar-collapse {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .navbar-nav {
        width: 100%;
    }

        .navbar-nav .nav-link {
            width: 100%;
            text-align: left;
        }

    .navbar .btn,
    .navbar .dropdown,
    .navbar .dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    .navbar-collapse > * {
        margin-bottom: 0.5rem;
    }

    .navbar .dropdown-menu {
        position: static;
        width: 100%;
    }

    .navbar-collapse::-webkit-scrollbar {
        width: 6px;
    }

    .navbar-collapse::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.25);
        border-radius: 10px;
    }
}

/* Dark mode nav */
[data-bs-theme="dark"] .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
}

/* ==========================================================
   3.2 NAV SCROLLER
   ========================================================== */

.nav-scroller {
    position: relative;
    height: 3rem;
    overflow-y: hidden;
}

    .nav-scroller .nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }

/* ==========================================================
   4. COMPONENTS
   ========================================================== */

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    user-select: none;
}

.bd-mode-toggle .bi {
    width: 1em;
    height: 1em;
}

/* BACK TO TOP */
#backToTop {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ==========================================================
   5. HERO
   ========================================================== */

.hero-section {
    position: relative;
    height: 75vh;
    background: url('../Images/pexels-zhuhehuai-538627.jpg') center/cover no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.35));
}

.hero-content {
    position: absolute;
    bottom: 30%;
    width: 100%;
    text-align: center;
    color: white;
}

/* ==========================================================
   6. FEATURETTES
   Stora presentationsblock med text + bild
   ========================================================== */
.featurette-divider {
    margin: 5rem 0;
}

.featurette-heading {
    letter-spacing: -.05rem;
}

@media (min-width: 40em) {
    .carousel-caption p {
        margin-bottom: 1.25rem;
        font-size: 1.25rem;
        line-height: 1.4;
    }

    .featurette-heading {
        font-size: 50px;
    }
}

@media (min-width: 62em) {
    .featurette-heading {
        margin-top: 7rem;
    }
}

/* ==========================================================
   7. CAROUSEL
   Bilder, captions, indikatorer och kontroller
   ========================================================== */
.carousel {
    margin-bottom: 4rem;
    position: relative;
}

.carousel-item {
    position: relative;
    height: 75vh;
    min-height: 350px;
}

    .carousel-item::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 1;
    }

/* Carousel bilder */
.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Caption-box styling */
.carousel-caption {
    bottom: 20%;
    z-index: 2;
    text-align: inherit; /* ärvs från text-start, text-center, text-end */
}

.caption-box {
    background: rgba(var(--bs-body-bg-rgb),0.75);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border: 1px solid rgba(var(--bs-body-color-rgb),0.1);
    border-radius: 10px;
    max-width: 500px;
    color: var(--bs-body-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

    .caption-box h1,
    .caption-box p {
        color: var(--bs-body-color);
    }

/* Caption alignment */
.carousel-caption.text-start .caption-box {
    margin-right: auto;
}

.carousel-caption.text-center .caption-box {
    margin-left: auto;
    margin-right: auto;
}

.carousel-caption.text-end .caption-box {
    margin-left: auto;
}

/* Carousel controls - synliga i dark/light mode */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: rgba(255,255,255,0.7);
    border-radius: 50%;
    background-size: 1.5rem 1.5rem;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.7));
}

.carousel-control-prev,
.carousel-control-next {
    z-index: 15;
}

/* Carousel indikatorer */
.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.3);
}

    .carousel-indicators button.active {
        background-color: rgba(255,255,255,1);
        border-color: rgba(0,0,0,0.5);
    }

    .carousel-indicators button:hover {
        background-color: rgba(255,255,255,0.9);
    }

.carousel-item {
    height: 75vh;
    position: relative;
}

    .carousel-item::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.35);
    }

/* ==========================================================
   8. CARDS (PREMIUM VERSION)
   ========================================================== */

.cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.property-card,
.area-card {
    flex: 1 1 300px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bs-body-bg);
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    position: relative;
}

    /* hover = clean zoom + subtle lift shadow */
    .property-card:hover,
    .area-card:hover {
        transform: scale(1.035);
        box-shadow: 0 18px 40px rgba(0,0,0,0.18);
    }

    /* image zoom (premium feel) */
    .property-card img,
    .area-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

    /* zoom only image on hover (smoother UX) */
    .property-card:hover img,
    .area-card:hover img {
        transform: scale(1.08);
    }

    /* optional subtle gradient overlay for depth */
    .property-card::after,
    .area-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.08));
        pointer-events: none;
    }

    /* optional smooth content spacing feel */
    .property-card > *,
    .area-card > * {
        position: relative;
        z-index: 1;
    }

/* === CARD HEIGHT FIX (layout only, påverkar ej design) === */

.property-card {
    display: flex;
    flex-direction: column;
}

    .property-card .card-body {
        display: flex;
        flex-direction: column;
    }

    .property-card .btn {
        margin-top: auto;
    }

    .property-card .description {
        min-height: 48px;
    }

/* ==========================================================
   9. AUTH
   ========================================================== */

.auth-page {
    min-height: 100vh;
    background: url('../Images/pexels-zhuhehuai-538627.jpg') center/cover no-repeat;
}

.auth-overlay {
    background: rgba(0,0,0,0.55);
    min-height: 100vh;
}

/* ==========================================================
   10. CTA
   ========================================================== */

.cta-section {
    background: #2c3e50;
    color: white;
    padding: 60px;
}

/* ==========================================================
   11. UTILITIES
   ========================================================== */

@keyframes bounce {
    0%, 100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 10px);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}
