/**
 * Custom CSS - Additional styles for Alfa TAX Theme
 * Entry animations and custom effects
 */

/* ==========================================================================
   Entry Animations - Scroll triggered
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Animation classes - Initial state (hidden) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-left {
    transform: translateX(-40px);
}

.animate-on-scroll.animate-right {
    transform: translateX(40px);
}

.animate-on-scroll.animate-scale {
    transform: scale(0.9);
}

/* Animation classes - Visible state */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Staggered animation delays for grid items */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }
.animate-on-scroll.delay-6 { transition-delay: 0.6s; }

/* Hero section specific animations */
.hero-content {
    animation: fadeInLeft 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
    opacity: 0;
}

.hero-image-wrapper {
    animation: fadeInRight 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
    opacity: 0;
}

.hero-badge {
    animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
    opacity: 0;
}

.hero-feature {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-feature:nth-child(1) { animation-delay: 0.5s; }
.hero-feature:nth-child(2) { animation-delay: 0.6s; }
.hero-feature:nth-child(3) { animation-delay: 0.7s; }

.hero-buttons {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

/* Section headers animation */
.section-header {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-header.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Card animations */
.card,
.service-card,
.team-card,
.feature-item,
.why-us-item,
.value-item,
.contact-info-item,
.faq-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

.card.is-visible,
.service-card.is-visible,
.team-card.is-visible,
.feature-item.is-visible,
.why-us-item.is-visible,
.value-item.is-visible,
.contact-info-item.is-visible,
.faq-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Grid item stagger effect */
.grid > *:nth-child(1) { transition-delay: 0s; }
.grid > *:nth-child(2) { transition-delay: 0.1s; }
.grid > *:nth-child(3) { transition-delay: 0.2s; }
.grid > *:nth-child(4) { transition-delay: 0.3s; }
.grid > *:nth-child(5) { transition-delay: 0.4s; }
.grid > *:nth-child(6) { transition-delay: 0.5s; }
.grid > *:nth-child(7) { transition-delay: 0.6s; }
.grid > *:nth-child(8) { transition-delay: 0.7s; }

/* Quote box animation */
.quote-box {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.quote-box.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.quote-item {
    position: relative;
}

.quote-item::before {
    content: '"';
    font-size: 4rem;
    line-height: 1;
    position: absolute;
    top: -10px;
    left: 10px;
    color: rgba(255, 255, 255, 0.1);
    font-family: Georgia, serif;
}

/* CTA Section animation */
.cta-content {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.cta-content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Location section image animation */
.location-image-wrapper {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.location-image-wrapper.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Map container animation */
.map-container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.map-container.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Page header animation */
.page-header h1,
.page-header p {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-header h1 {
    animation-delay: 0.1s;
}

.page-header p {
    animation-delay: 0.3s;
}

/* ==========================================================================
   Button effects
   ========================================================================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 400px;
    height: 400px;
}

/* Service card icon animation */
.service-card .card-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
}

/* Feature item hover */
.feature-item:hover .card-icon {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   Blog card animations
   ========================================================================== */
.blog-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

.blog-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.blog-card:hover {
    box-shadow: var(--shadow-xl);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-image {
    overflow: hidden;
}

.blog-card-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */
/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .animate-on-scroll,
    .card,
    .service-card,
    .team-card,
    .feature-item,
    .why-us-item,
    .value-item,
    .hero-content,
    .hero-image-wrapper,
    .section-header,
    .quote-box,
    .cta-content {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   Print styles
   ========================================================================== */
@media print {
    .top-bar,
    .site-header,
    .site-footer,
    .mobile-menu-toggle,
    .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .hero-section,
    .cta-section {
        background: none !important;
        color: #000 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
    }
    
    .animate-on-scroll,
    .card,
    .service-card {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   WordPress specific styles
   ========================================================================== */
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    margin-top: 0.5rem;
}

/* Gutenberg block styles */
.wp-block-quote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
}

.wp-block-quote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
    font-style: normal;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: var(--radius);
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    color: var(--color-gray-700);
    transition: all 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* Spacing utilities */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Yellow notice box for admin messages */
.bg-yellow-50 {
    background-color: #fefce8;
}

.border-yellow-200 {
    border-color: #fef08a;
}

.text-yellow-800 {
    color: #854d0e;
}
