/* styles.css - Custom styles for PPP CPA website */

/* ===== HERO SLIDER STYLES ===== */
.hero-slider {
    position: relative;
    z-index: 0;
}

.slider-track {
    z-index: 0;
}

.slide {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    z-index: 0;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide img {
    object-fit: cover;
}

/* Fallback gradient - shows when image fails to load */
.slide-fallback {
    pointer-events: none;
}

/* If image successfully loads, it will appear over the fallback */
.slide img[src] {
    z-index: 10;
}

/* If image fails to load (broken), it becomes invisible and fallback shows */
.slide img:not([src]),
.slide img[src=""] {
    opacity: 0;
    z-index: 0;
}

/* ===== SLIDER CONTROLS ===== */
.slider-control {
    cursor: pointer;
    user-select: none;
}

.slider-control:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* ===== SMOOTH SCROLLING ===== */
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;
    }
}

/* ===== FOCUS STYLES ===== */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ===== NAVBAR LINK UNDERLINE ANIMATION ===== */
.nav-link-underline {
    position: relative;
    display: inline-block;
}

.nav-link-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-link-underline:hover::after {
    width: 100%;
}

/* Active page indicator (optional - you can add 'active' class via JS) */
.nav-link-underline.active::after {
    width: 100%;
    background: linear-gradient(90deg, #0a1628, #1a2744);
}

/* ===== MODERN FLOATING NAVBAR STYLES ===== */
#mainHeader {
    background: transparent;
}

/* Modern Nav Pills */
.modern-nav-pill {
    position: relative;
    background: transparent !important;
    box-shadow: none !important;
    border-color: transparent !important;
    transition: color 0.25s ease;
}

/* HOVER: TEXT ONLY (BLUE), NO BACKGROUND */
.modern-nav-pill:hover,
.modern-nav-pill:focus {
    background: transparent !important;
    box-shadow: none !important;
    border-color: transparent !important;
    color: #2563eb !important; /* blue-600 */
}

/* ACTIVE: TEXT ONLY (BLUE), NO BACKGROUND */
.modern-nav-pill.active {
    background: transparent !important;   /* removed gradient highlight */
    color: #2563eb !important;
    font-weight: 700;
}

/* Modern Mobile Links */
.modern-mobile-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    color: #2563eb;
    font-weight: 700;
}

.modern-mobile-link.active .w-10 {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

.modern-mobile-link.active svg {
    color: white !important;
}

/* Floating container scroll effect */
#mainHeader .bg-white\/80 {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#mainHeader.scrolled .bg-white\/80 {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile menu slide animation */
#mobileMenu {
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ENHANCED HEADER EFFECTS ===== */
/* Smooth transitions and premium feel */

.cta-button {
    animation: ctaGlow 3s ease-in-out infinite;
}

.cta-button:hover {
    animation: none;
}

/* ===== MOBILE NAV HOVER EFFECT ===== */
.mobile-nav-hover {
    position: relative;
    padding-left: 1rem;
}

.mobile-nav-hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 60%;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}

.mobile-nav-hover:hover::before {
    width: 4px;
}

.mobile-nav-hover.active {
    background-color: rgba(37, 99, 235, 0.08);
    font-weight: 600;
    color: #0a1628;
}

.mobile-nav-hover.active::before {
    width: 4px;
    background: linear-gradient(180deg, #0a1628, #1a2744);
}

/* ===== MODERN MOBILE NAV STYLES ===== */
.mobile-nav-modern {
    position: relative;
    overflow: hidden;
}

.mobile-nav-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
}

.mobile-nav-modern:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
    color: #2563eb;
}

.mobile-nav-modern:hover::before {
    transform: scaleY(1);
}

.mobile-nav-modern.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.05));
    color: #2563eb;
    font-weight: 600;
}

.mobile-nav-modern.active::before {
    transform: scaleY(1);
    background: linear-gradient(180deg, #0a1628, #1a2744);
}

/* Mobile menu animation */
#mobileMenu {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CUSTOM ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroHeadingEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heroParagraphEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px);
        letter-spacing: 0.05em;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: normal;
    }
}

@keyframes heroButtonsEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-3px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-animate-heading {
    animation: heroHeadingEntrance 1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.hero-animate-paragraph {
    animation: heroParagraphEntrance 0.9s cubic-bezier(0.33, 0.66, 0.44, 1) forwards;
}

.hero-animate-buttons {
    animation: heroButtonsEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== UTILITY CLASSES ===== */
.reveal-up {
    will-change: opacity, transform;
}

/* ===== SERVICE TILES ===== */
.service-tile {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-tile:hover {
    transform: translateY(-8px);
}

.service-tile-image {
    position: relative;
    overflow: hidden;
}

.service-tile-image img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-tile-fallback {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.service-tile-image img[src] {
    position: relative;
    z-index: 1;
}

/* Hide fallback when image loads successfully */
.service-tile-image img:not([style*="display: none"]) ~ .service-tile-fallback {
    opacity: 0;
}

/* Smooth scroll offset for anchor links */
html {
    scroll-padding-top: 80px;
}

.scroll-mt-20 {
    scroll-margin-top: 5rem;
}

/* ===== HORIZONTAL APPROACH FLOW STYLES ===== */
/* Approach flow items */
.approach-flow-item {
    animation: fadeInScale 0.6s ease-out forwards;
    opacity: 0;
}

.approach-flow-item:nth-child(1) { animation-delay: 0.1s; }
.approach-flow-item:nth-child(3) { animation-delay: 0.2s; }
.approach-flow-item:nth-child(5) { animation-delay: 0.3s; }
.approach-flow-item:nth-child(7) { animation-delay: 0.4s; }
.approach-flow-item:nth-child(9) { animation-delay: 0.5s; }
.approach-flow-item:nth-child(11) { animation-delay: 0.6s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Approach cards - smaller and compact */
.approach-flow-card {
    width: 170px;
    min-width: 170px;
}

/* Arrows animation */
.approach-arrow {
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateX(4px);
    }
}

/* Mobile - wrap cards */
@media (max-width: 768px) {
    .approach-flow-card {
        width: 140px;
        min-width: 140px;
    }
}

/* ===== CTA FORM STYLES ===== */
#ctaContactForm input:focus {
    transform: translateY(-2px);
}

#ctaContactForm input::placeholder {
    font-weight: 400;
}

/* Enhanced button hover effect */
#ctaContactForm button[type="submit"]:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

#ctaContactForm button[type="submit"]:active {
    transform: translateY(0) !important;
}

/* Success message animation */
#ctaSuccessMessage {
    animation: slideInFromTop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form error states */
#ctaContactForm input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

/* Privacy text icon alignment */
#ctaContactForm p svg {
    vertical-align: text-top;
}

/* Hero accent text special effects */
.hero-accent-text {
    display: inline-block;
    position: relative;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

@keyframes accentGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
    }
    50% {
        text-shadow: 0 0 30px rgba(96, 165, 250, 0.5), 0 0 40px rgba(96, 165, 250, 0.2);
    }
}

.hero-animate-heading .hero-accent-text {
    animation: accentGlow 3s ease-in-out infinite;
    animation-delay: 1s;
}

/* Hero CTA Button animations */
@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -2px rgba(37, 99, 235, 0.2);
    }
    50% {
        box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4), 0 10px 10px -5px rgba(37, 99, 235, 0.3);
    }
}

.hero-cta-primary {
    animation: ctaPulse 2s ease-in-out infinite;
    animation-delay: 1.5s;
}

.hero-cta-primary:hover {
    animation: none;
}

.hero-cta-secondary {
    position: relative;
    overflow: hidden;
}

.hero-cta-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hero-cta-secondary:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== FORM STYLES ===== */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.error,
select.error,
textarea.error {
    border-color: #ef4444;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.hero-slider,
.slide {
    will-change: opacity;
}

/* Prevent layout shift during image load */
.slide img {
    display: block;
}

/* ===== PRINT STYLES ===== */
@media print {
    .slider-control,
    #mobileMenuBtn,
    #mobileMenu {
        display: none !important;
    }
    
    header {
        position: static !important;
    }
    
    body {
        padding-top: 0 !important;
    }
}


/* ================================
   NAVBAR FIX: remove blue outline/border on click
   (only for navbar links, keep global focus for rest)
================================= */
.modern-nav-pill:focus,
.modern-nav-pill:focus-visible,
.modern-nav-pill:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Optional: same for mobile menu links */
.modern-mobile-link:focus,
.modern-mobile-link:focus-visible,
.modern-mobile-link:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* =========================================================
   NEW FIX: when hovering other nav items, active item (Home) should
   go back to normal color until hover ends (uses :has()).
   ========================================================= */

/* Keep active blue by default */
#mainHeader nav .modern-nav-pill.active {
    color: #2563eb !important; /* blue-600 */
}

/* When hovering ANY nav pill, revert active (unless it's the one hovered) */
#mainHeader nav:has(.modern-nav-pill:hover) .modern-nav-pill.active:not(:hover) {
    color: #334155 !important; /* slate-700 */
    font-weight: 600;          /* closer to normal */
}

/* Mobile: same behavior */
#mobileMenu:has(.modern-mobile-link:hover) .modern-mobile-link.active:not(:hover) {
    color: #334155 !important;
}
