/**
 * Custom Styles for Almeida Andrade Engenharia Theme
 * 
 * @package Almeida_Andrade
 */

/* ============================================
   CUSTOM ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ken-burns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

.scroll-animate {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ============================================
   HEADER TRANSITIONS
   ============================================ */
.header-transparent {
    background-color: transparent;
}

.header-solid {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.header-solid .nav-link {
    color: #1e293b;
}

.header-solid .nav-link:hover {
    color: #4a90c2;
}

.header-solid .nav-link.active {
    color: #4a90c2;
}

.header-solid .lang-switcher {
    border-color: rgba(26, 58, 92, 0.1);
    background-color: rgba(26, 58, 92, 0.05);
}

.header-solid .lang-btn:not(.active) {
    color: #1e293b;
}

/* Mobile menu button colors */
#mobile-menu-btn #menu-icon {
    color: white;
}

.header-solid #mobile-menu-btn #menu-icon {
    color: #1e293b;
}

#mobile-menu-btn #close-icon {
    color: #1e293b;
}

/* ============================================
   HERO SECTION & SLIDER
   ============================================ */
.hero-gradient {
    background: linear-gradient(135deg, rgba(26, 58, 92, 0.8) 0%, rgba(44, 95, 138, 0.6) 100%);
}

/* Hero Slider */
.hero-slider {
    position: relative;
}

.hero-slide {
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out, visibility 0.7s;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.hero-slide.prev {
    transform: translateX(-100%);
}

/* Ken Burns effect on active slide */
.hero-slide.active img {
    animation: ken-burns 20s ease-in-out infinite alternate;
}

/* Hero Content Animations */
.hero-slide.active .hero-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-slide.active .hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-slide.active .flex {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Slider Controls - aparecem ao passar mouse no desktop */
#hero-prev,
#hero-next {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#home:hover #hero-prev,
#home:hover #hero-next,
#hero-prev:hover,
#hero-next:hover {
    opacity: 1 !important;
}

/* No mobile, setas sempre visíveis se houver múltiplos banners */
@media (max-width: 768px) {
    #hero-prev,
    #hero-next {
        opacity: 0.7 !important;
    }
    
    #hero-prev:active,
    #hero-next:active {
        opacity: 1 !important;
    }
}

/* Slider Indicators */
.hero-indicator {
    transition: all 0.3s ease;
}

.hero-indicator.active {
    background-color: rgba(255, 255, 255, 0.9);
    width: 2rem;
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */
#mobile-menu-overlay {
    clip-path: circle(0% at 100% 0%);
    transition: clip-path 0.5s ease-in-out;
}

#mobile-menu-overlay.active {
    clip-path: circle(150% at 100% 0%);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.glass-effect {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Fixed Header height offsets */
section {
    scroll-margin-top: 80px;
}

/* ============================================
   PORTFOLIO HOVER EFFECTS
   ============================================ */
.portfolio-overlay {
    background: linear-gradient(to top, rgba(26, 58, 92, 0.9) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus,
.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: initial;
    margin: initial;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   WORDPRESS ADMIN BAR FIX
   ============================================ */
body.admin-bar #main-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #main-header {
        top: 46px;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    /* Desabilitar ken-burns no mobile para performance */
    .hero-slide.active img {
        animation: none !important;
    }
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
