/* ===== Custom Styles for Karen Acosta Real Estate ===== */

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

/* ===== Navbar ===== */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(7, 11, 20, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f2c94c;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.open .mobile-link {
    animation: fadeSlideDown 0.4s ease forwards;
    opacity: 0;
}

#mobileMenu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu button animation */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero-eyebrow {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.hero-headline {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.5s forwards;
}

.hero-subtext {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.7s forwards;
}

.hero-cta {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.9s forwards;
}

.hero-decor {
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

.hero-decor-1 { animation-delay: 0.5s; }
.hero-decor-2 { animation-delay: 0.8s; }
.hero-decor-3 { animation-delay: 1.1s; }

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

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

/* ===== Scroll Reveal ===== */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal-up.visible,
    .reveal-left.visible,
    .reveal-right.visible {
        opacity: 1;
        transform: none;
    }
}

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e8a510, #f2c94c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* ===== Area Cards ===== */
.area-card {
    position: relative;
    cursor: pointer;
}

.area-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 16px;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.area-card:hover::after {
    border-color: rgba(242, 201, 76, 0.5);
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    font-family: 'Playfair Display', serif;
    color: rgba(242, 201, 76, 0.15);
    line-height: 1;
}

/* ===== Buttons ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* ===== Form ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 165, 16, 0.15);
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #d9e0ef;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b3c1df;
}

/* ===== Selection ===== */
::selection {
    background: rgba(232, 165, 16, 0.3);
    color: #0d1423;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.5rem;
    }
    
    .hero-headline .italic {
        font-size: 2rem;
    }
    
    .hero-headline .block:last-child {
        font-size: 2.25rem;
    }
}
