/* ========================================
   HARMONY BUILDWORKS Components
   Reusable UI Components
   ======================================== */

/* ---------- NAVIGATION ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    z-index: 1000;
    /* Glassmorphism effect */
    background: rgba(15, 26, 43, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(163, 207, 192, 0.15);
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: var(--text-heading-3);
    font-weight: 700;
    color: var(--color-off-white);
    text-decoration: none;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.nav__logo-img {
    height: 45px;
    width: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(163, 207, 192, 0.3);
}

.nav__links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
}

.nav__link {
    font-size: var(--text-micro);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-off-white);
    text-decoration: none;
    position: relative;
    padding: var(--space-1) 0;
    transition: color var(--duration-fast) var(--ease-out-quart);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-taupe);
    transition: width var(--duration-fast) var(--ease-out-quart);
}

.nav__link:hover,
.nav__link.is-active {
    color: var(--color-taupe);
}

.nav__link:hover::after,
.nav__link.is-active::after {
    width: 100%;
}

.nav__menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
}

.nav__menu-btn span {
    width: 24px;
    height: 1px;
    background: var(--color-off-white);
    transition: all var(--duration-fast) var(--ease-out-quart);
}

@media (max-width: 768px) {
    .nav {
        padding: 0 var(--space-3);
    }

    .nav__logo {
        font-size: var(--text-body);
        gap: 0.5rem;
    }

    .nav__logo-img {
        height: 34px;
        width: 34px;
    }

    .nav__links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-5);
        background: var(--color-charcoal);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--duration-fast) var(--ease-out-quart),
            visibility var(--duration-fast);
    }

    .nav__links.is-open {
        opacity: 1;
        visibility: visible;
    }

    .nav__link {
        font-size: var(--text-heading-3);
        text-transform: uppercase;
        letter-spacing: 0.15em;
    }

    .nav__menu-btn {
        display: flex;
        z-index: 10000;
        position: relative;
    }

    .nav__menu-btn.is-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav__menu-btn.is-open span:nth-child(2) {
        opacity: 0;
    }

    .nav__menu-btn.is-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* ---------- PROJECT CARD ---------- */
.project-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out-expo);
}

.project-card:hover .project-card__image {
    transform: scale(1.05);
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 26, 43, 0.9), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-4);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out-quart);
}

.project-card:hover .project-card__overlay {
    opacity: 1;
}

@media (hover: none),
(max-width: 768px) {
    .project-card__overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(15, 26, 43, 0.85), transparent 70%);
    }

    .project-card__overlay {
        padding: var(--space-3);
    }
}

.project-card__category {
    font-size: var(--text-micro);
    color: var(--color-taupe);
    margin-bottom: var(--space-1);
}

.project-card__title {
    font-size: var(--text-heading-3);
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.project-card__location {
    font-size: var(--text-small);
    color: var(--color-grey);
}

/* ---------- TIMELINE ---------- */
.timeline {
    position: relative;
    padding: var(--space-16) 0;
}

.timeline__line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-grey-dark);
    transform: translateX(-50%);
}

.timeline__progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--color-taupe);
    transition: height 0.1s linear;
}

.timeline__item {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-12);
    opacity: 0.3;
    transition: opacity var(--duration-normal) var(--ease-out-quart);
}

.timeline__item.is-active {
    opacity: 1;
}

.timeline__item:nth-child(odd) {
    flex-direction: row-reverse;
    text-align: right;
}

.timeline__content {
    width: calc(50% - var(--space-8));
    padding: var(--space-4);
}

.timeline__year {
    font-family: var(--font-display);
    font-size: var(--text-display);
    font-weight: 900;
    color: var(--color-taupe);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.timeline__title {
    font-size: var(--text-heading-3);
    margin-bottom: var(--space-2);
}

.timeline__description {
    font-size: var(--text-body);
    color: var(--color-grey);
}

.timeline__dot {
    position: absolute;
    left: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-charcoal);
    border: 2px solid var(--color-grey-dark);
    transform: translateX(-50%);
    transition: all var(--duration-fast) var(--ease-out-quart);
    z-index: 1;
}

.timeline__item.is-active .timeline__dot {
    background: var(--color-taupe);
    border-color: var(--color-taupe);
    box-shadow: var(--glow-taupe);
}

@media (max-width: 768px) {
    .timeline {
        padding: var(--space-8) 0;
    }

    .timeline__line {
        left: var(--space-4);
    }

    .timeline__item,
    .timeline__item:nth-child(odd) {
        flex-direction: column;
        text-align: left;
        padding-left: var(--space-10);
    }

    .timeline__content {
        width: 100%;
        padding: var(--space-2) 0;
    }

    .timeline__year {
        font-size: var(--text-heading-1);
    }

    .timeline__title {
        font-size: var(--text-body-lg);
    }

    .timeline__description {
        font-size: var(--text-small);
    }

    .timeline__dot {
        left: var(--space-4);
        width: 12px;
        height: 12px;
    }

    .timeline__item {
        margin-bottom: var(--space-6);
    }
}

/* ---------- TESTIMONIAL CLOUD ---------- */
.testimonial-cloud {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.testimonial-item {
    position: absolute;
    max-width: 400px;
    padding: var(--space-4);
    background: rgba(21, 34, 56, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-grey-dark);
    border-radius: 4px;
    opacity: 0.7;
    cursor: default;
    transition: opacity var(--duration-fast) var(--ease-out-quart),
        transform var(--duration-fast) var(--ease-out-quart);
}

@media (max-width: 768px) {
    .testimonial-item {
        position: relative;
        max-width: 100%;
        width: 100%;
        padding: var(--space-3);
        opacity: 1;
        background: rgba(21, 34, 56, 0.8);
    }

    .testimonial-item__quote {
        font-size: var(--text-body);
        line-height: 1.6;
        margin-bottom: var(--space-2);
    }

    .testimonial-item__avatar {
        width: 32px;
        height: 32px;
    }

    .testimonial-item__name {
        font-size: var(--text-micro);
    }
}

.testimonial-item:hover {
    opacity: 1;
    transform: scale(1.02);
    z-index: 10;
}

.testimonial-item__quote {
    font-size: var(--text-body-lg);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: var(--space-3);
    color: var(--color-off-white);
}

.testimonial-item__author {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.testimonial-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.testimonial-item__avatar svg {
    width: 70%;
    height: 70%;
}

.testimonial-item__info {
    display: flex;
    flex-direction: column;
}

.testimonial-item__name {
    font-size: var(--text-small);
    font-weight: 600;
}

.testimonial-item__role {
    font-size: var(--text-micro);
    color: var(--color-grey);
}

/* ---------- SPLIT LAYOUT ---------- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.split-layout__left {
    position: relative;
    overflow: hidden;
}

.split-layout__left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter var(--duration-slow) var(--ease-out-expo);
}

.split-layout__left:hover img {
    filter: grayscale(50%);
}

.split-layout__right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-12);
    background: var(--color-charcoal-light);
}

@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .split-layout__left {
        min-height: 40vh;
    }

    .split-layout__right {
        padding: var(--space-8);
    }
}

@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .split-layout__left {
        min-height: 25vh;
    }

    .split-layout__right {
        padding: var(--space-4) var(--space-3);
    }

    .connect {
        min-height: auto;
    }

    .connect__form-section {
        max-width: 100%;
    }

    .connect__submit {
        padding: var(--space-2);
        font-size: var(--text-small);
    }
}

/* ---------- GLOBAL MAP ---------- */
.global-map {
    position: relative;
    padding: var(--space-8) 0;
    background: var(--color-charcoal-medium);
}

.global-map__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.global-map__hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    opacity: 0.7;
    transition: opacity var(--duration-fast) var(--ease-out-quart);
}

.global-map__hub:hover {
    opacity: 1;
}

.global-map__hub.is-origin {
    opacity: 1;
}

.global-map__hub.is-origin .global-map__dot {
    background: var(--color-taupe);
    box-shadow: var(--glow-taupe);
}

.global-map__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-grey);
}

.global-map__name {
    font-size: var(--text-micro);
    color: var(--color-grey);
}

.global-map__connector {
    width: 100px;
    height: 1px;
    background: linear-gradient(to right, var(--color-taupe), var(--color-grey-dark));
}

/* ---------- FOOTER ---------- */
.footer {
    padding: var(--space-8) 0;
    border-top: 1px solid var(--color-grey-dark);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer__copy {
    font-size: var(--text-small);
    color: var(--color-grey);
}

.footer__links {
    display: flex;
    gap: var(--space-4);
}

.footer__link {
    font-size: var(--text-micro);
    color: var(--color-grey);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out-quart);
}

.footer__link:hover {
    color: var(--color-taupe);
}

@media (max-width: 768px) {
    .footer {
        padding: var(--space-4) 0;
    }

    .footer__content {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .footer__links {
        gap: var(--space-3);
    }
}

/* ---------- WHATSAPP FAB ---------- */
.whatsapp-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: whatsapp-pulse 2s ease-in-out infinite;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
    animation: none;
}

@keyframes whatsapp-pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6);
    }
}

@media (max-width: 768px) {
    .whatsapp-fab {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 48px;
        height: 48px;
    }

    .whatsapp-fab svg {
        width: 24px;
        height: 24px;
    }
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.lightbox__image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    cursor: default;
}

.lightbox.is-active .lightbox__image {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.lightbox__close:hover {
    opacity: 1;
}