/* ------------------ Navigation Links ------------------ */

html, body {
    scroll-behavior: auto; /* smooth scroll disable */
    overflow-anchor: none; /* auto scroll prevent */
    object-fit: cover;
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li a {
    text-decoration: none;
    color: white;
    font-weight: 300;
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 17px;
    line-height: 20px;
    margin-left: 15px;
    transition: color 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
    opacity: 0.9;
}

.custom-nav .nav-links li a {
    color: #000;
    opacity: 1;
    transform: translateY(3px);
}

.tag {
    position: relative;
    overflow: hidden;
    color: white;
}

.tag::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background-color: #A6A6A6;
    transition: width 0.3s ease;
}

.tag:hover::after {
    width: 100%;
    animation: heartbeat116 1.5s ease-in-out 0.3s infinite;
}

@keyframes heartbeat116 {
    0%, 100% { width: 100%; }
    50% { width: 60%; }
}

/* ------------------ Search Bar ------------------ */
.searchDiv {
    position: fixed; /* slides over content */
    top: 100%; /* below navbar */
    left: 0;
    width: 100%;
    max-width: 1000px;
    margin: auto;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    background: #fff;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.searchDiv.active {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
}

.searchDiv .searchDiv-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    border: 2px solid #bcd6e6cc;
    padding: 2px 8px;
    border-radius: 5px;
    background: #fff;
    border-radius: 50px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px;
}

/* Cancel button */
.close-btn {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
    color: red;
    display: flex;
    align-items: center;
}

/* ------------------ Mobile full-width search ------------------ */
@media (max-width: 768px) {
    .searchDiv {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        padding: 10px;
        transform: scaleY(1); /* always expanded on mobile */
    }

    .nav-links {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        gap: 18px;
        padding: 0 12px;
        margin: 0;
    }

    .nav-links li {
        display: inline-block;
    }
}
/* Desktop only: horizontal search overlay */
@media (min-width: 769px) {
    .nav-links {
        position: relative;
    }

    .searchDiv {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        transform-origin: center right; /* <-- changed from center left */
        height: 80px;
        width: 450px;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s cubic-bezier(.77,0,.18,1), opacity 0.3s ease;
        z-index: 1050;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        background: transparent;
    }

    .searchDiv.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) scaleX(1);
    }

    .searchDiv .search-box {
        width: 100%;
        margin: 0;
        background: white; /* transparent background */
        border: 2px solid rgba(255, 255, 255, 0.3); /* subtle white border */
        border-radius: 50px;
        padding: 3px 10px;
        backdrop-filter: blur(6px); /* adds soft glass effect */
    }

    .custom-nav .search-box {
        border-color: rgba(0, 0, 0, 0.2); /* switch to dark border on scroll */
    }

    .search-box input {
        color: black;
        background: transparent;
    }

    .search-box input::placeholder {
        color: rgba(255, 255, 255, 0.8);
    }

    .custom-nav .search-box input::placeholder {
        color: rgba(0, 0, 0, 0.7);
    }

    .close-btn {
        color: red;
        background: transparent;
        border: none;
    }

    /* Hide nav links behind overlay */
    .nav-links.hide-links li:not(:first-child) {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-5px);
        transition: all 0.3s ease;
    }

    .nav-links li {
        transition: all 0.3s ease;
    }

    .search-box .form-control:focus {
    background-color: transparent !important;
    box-shadow: none !important;
    border-color: transparent !important;
    outline: none !important;
    color: inherit !important;
}
}
/* Hide search link initially */
#scrollSearch.hidden {
    display: none !important;
}

/* Show when navbar becomes white */
.custom-nav #scrollSearch {
    display: inline-block !important;
}
/* Prevent background scroll when search is active */
/* body.search-open {
    overflow: hidden;
} */

/* Project search result list */
.project-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  list-style: none;
  margin-top: 4px;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
  z-index: 999;
}

/* Individual result item */
.project-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #e6e6e6;
  cursor: pointer;
  transition: background 0.2s ease;
}

.project-results li:last-child {
  border-bottom: none;
}

/* Hover effect */
.project-results li:hover {
  background-color: #f8f9fa;
}

/* Project name text */
.project-results li .project-name {
  font-size: 16px;
  color: #212529;
  font-weight: 500;
}

/* Right side (icon + label) */
.project-results li .project-meta {
  color: #6c757d;
  font-size: 14px;
}

.project-results li .project-meta i {
  color: #007bff;
  margin-right: 6px;
}

/* Scrollbar styling */
.project-results::-webkit-scrollbar {
  width: 6px;
}
.project-results::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

/* Desktop only */
@media (max-width: 991px) {
  .project-results {
    display: none;
  }
}
/* Mobile bottom nav: always white and fixed */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffffff; /* always white */
        box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
        border-top: 1px solid #e6e6e6;
        z-index: 1050;
    }

    .mobile-bottom-nav .mobile-nav-list {
        display: flex;
        justify-content: space-around;
        gap: 4px;
        padding: 8px 6px;
        margin: 0;
        list-style: none;
    }

    .mobile-bottom-nav .mobile-nav-list li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #333;
        font-size: 12px;
    }

    .mobile-bottom-nav .mobile-nav-list li a i {
        font-size: 18px;
        display: block;
        margin-bottom: 4px;
    }


    /* mobile contact rail (left vertical) */
    .mobile-contact-rail {
        position: fixed;
        left: 8px; /* left side */
        bottom: 120px; /* above bottom nav and other buttons */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        z-index: 1080;
        transition: transform 0.25s ease-in-out;
        transform: translateX(0);
    }

    /* collapsed state: rail hidden slightly off-screen to the left, leaving the toggle visible */
    .mobile-contact-rail.collapsed {
        transform: translateX(-36px);
    }

    .mobile-contact-rail .rail-toggle {
        background: #ffffff;
        border: 1px solid #e6e6e6;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        cursor: pointer;
        color: #000; /* solid black icon to make it visible */
        font-weight: 700;
        z-index: 1095;
    }

    /* Ensure the toggle remains visible when collapsed by nudging it outward */
    .mobile-contact-rail.collapsed .rail-toggle {
        transform: translateX(6px);
    }

    .mobile-contact-rail .rail-btn {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #ffffff;
        border: 1px solid #e6e6e6;
        color: #333;
        text-decoration: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }

    .mobile-contact-rail .rail-btn.whatsapp {
        color: #25D366; /* whatsapp green */
		font-size: 28px;
    }

    .mobile-contact-rail .rail-btn.phone {
        color: #0d6efd; /* blue for call */
		font-size: 25px
    }

    /* ensure scroll-to-top and contact icon also not overlapping */
    #scrollToTopBtn {
        bottom: 90px !important; /* moved down slightly */
        right: 20px !important;
        left: auto !important;
        z-index: 1000 !important;
    }

        /* Hide previous floating contact container on mobile entirely */
        #contact-icon,
        #contact-icon.custom {
            display: none !important; /* hide earlier floating contact container on mobile, use rail */
            visibility: hidden !important;
            pointer-events: none !important;
        }
}
