/* ==========================================
   CUSTOM CSS - Panorama Residences
   ========================================== */

/* --- Smooth scrolling --- */
html {
    scroll-behavior: smooth;
}

/* --- Selection color --- */
::selection {
    background-color: #C4B5A0;
    color: #2C2C2C;
}

/* ==========================================
   NAVBAR
   ========================================== */
#navbar {
    backdrop-filter: blur(0px);
}

#navbar.scrolled {
    background-color: rgba(250, 248, 245, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .navbar-logo {
    color: #2C2C2C;
}

#navbar.scrolled .nav-link {
    color: rgba(44, 44, 44, 0.6);
}

#navbar.scrolled .nav-link:hover {
    color: #2C2C2C;
}

#navbar.scrolled .nav-link:last-child {
    border-color: #6B4F3A;
    color: #6B4F3A;
}

#navbar.scrolled .nav-link:last-child:hover {
    background-color: #6B4F3A;
    color: white;
}

#navbar.scrolled .hamburger-line {
    background-color: #2C2C2C;
}

/* --- Hamburger animation --- */
.menu-open .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-open .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* --- Mobile menu visible --- */
#mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================
   HERO CAROUSEL
   ========================================== */
.hero-carousel {
    position: absolute;
    inset: 0;
}

.hero-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ken Burns on active slide */
.hero-slide.active img {
    animation: heroKenBurns 8s ease-in-out forwards;
}

@keyframes heroKenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.06);
    }
}

/* Hero dots */
.hero-dot.active {
    background-color: white;
    transform: scale(1.3);
}

.scroll-indicator {
    animation: fadeInUp 1s ease 1.5s both;
}

/* ==========================================
   SCROLL REVEAL ANIMATIONS
   ========================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal > *:nth-child(1) { transition-delay: 0s; }
.reveal > *:nth-child(2) { transition-delay: 0.1s; }
.reveal > *:nth-child(3) { transition-delay: 0.2s; }

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

/* ==========================================
   GALLERY
   ========================================== */
.gallery-tab.active {
    background-color: rgba(107, 79, 58, 0.4);
    border-color: rgba(196, 181, 160, 0.6);
    color: white;
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.15);
}

/* ==========================================
   DISCOVER CAROUSEL
   ========================================== */
.discover-carousel {
    aspect-ratio: 21/9;
}

@media (max-width: 767px) {
    .discover-carousel {
        aspect-ratio: 16/9;
    }
}

.carousel-track {
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
}

.carousel-dot.active {
    background-color: white;
    transform: scale(1.3);
}

/* ==========================================
   FLOOR PLAN TABS
   ========================================== */
.plan-tab.active {
    background-color: rgba(107, 79, 58, 0.15);
    border-color: rgba(107, 79, 58, 0.4);
    color: #2C2C2C;
    font-weight: 500;
}

/* ==========================================
   LIGHTBOX
   ========================================== */
#lightbox {
    display: none;
}

#lightbox.open {
    display: flex;
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#lightbox-image {
    transition: transform 0.3s ease;
}

#lightbox-image img {
    max-height: 80vh;
    width: auto;
    height: auto;
}

/* ==========================================
   MAP
   ========================================== */
.map-container {
    position: relative;
}

.map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(196, 181, 160, 0.2);
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   FORM
   ========================================== */
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 1px rgba(196, 181, 160, 0.3);
}

#contact-form select option {
    background-color: #6B4F3A;
    color: white;
}

#form-status.success {
    color: #5C6B4A;
}

#form-status.error {
    color: #c0392b;
}

/* ==========================================
   SCROLL MARGIN FOR NAVBAR
   ========================================== */
section[id] {
    scroll-margin-top: 5rem;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 767px) {
    .hero-slide.active img {
        animation: none;
    }
}

/* --- Print styles --- */
@media print {
    #navbar,
    #lightbox,
    .scroll-indicator,
    #mobile-menu {
        display: none !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    section {
        break-inside: avoid;
    }
}
