/* --- Animations and Enhanced Design Elements --- */

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* Hero Section Animations */
.hero-section h1 {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.3s;
}

.hero-section .tagline {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.5s;
}

.hero-section .sub-headline {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.7s;
}

.hero-section .hero-cta {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.9s;
}

.hero-section .feature-card:nth-child(1) {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.1s;
}

.hero-section .feature-card:nth-child(2) {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.3s;
}

.hero-section .feature-card:nth-child(3) {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.5s;
}

.hero-section .feature-card:nth-child(4) {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.7s;
}

.hero-section .hero-scroll-indicator {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 2s;
}

/* Parallax Effect (disabled on iOS) */
.hero-section {
    position: relative;
    overflow: hidden;
}

/* Apply fixed background only on non-iOS devices */
@supports not (-webkit-touch-callout: none) {
    .hero-section {
        background-attachment: fixed;
    }
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(69, 82, 87, 0.8), rgba(69, 82, 87, 0.8)), url('images/hero-background-placeholder.jpg') no-repeat center center/cover;
    z-index: -1;
}

/* Apply fixed background only on non-iOS devices */
@supports not (-webkit-touch-callout: none) {
    .hero-section::before {
        background-attachment: fixed;
    }
}

/* Modern Design Elements */
.section-divider {
    height: 4px;
    width: 80px;
    background: linear-gradient(to right, var(--accent-color), var(--heading-text));
    margin: 0 auto 2em auto;
    border-radius: 2px;
    /* This will be the only line displayed */
}

.accent-shape {
    position: absolute;
    opacity: 0.04;
    z-index: -1;
}

.accent-shape.circle {
    border-radius: 50%;
    background-color: var(--accent-color);
}

.accent-shape.square {
    background-color: var(--heading-text);
    transform: rotate(45deg);
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

h1 {
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

/* Removed h2::after to eliminate extra lines */

/* Service Card Hover Effects */
.service-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.service-item h3 {
    position: relative;
    padding-bottom: 0.5em;
    transition: color 0.3s ease;
}

.service-item:hover h3 {
    color: var(--accent-color);
}

/* Button Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255,255,255,0.1);
    transition: width 0.3s ease;
    z-index: 1;
}

.btn:hover::after {
    width: 120%;
}

.btn span {
    position: relative;
    z-index: 2;
}

.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(176, 141, 87, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 5px 15px rgba(176, 141, 87, 0.2);
}

/* Scroll-to-top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--accent-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

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

.scroll-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Testimonial Carousel */
.testimonial-slider {
    position: relative;
    overflow: hidden;
    padding: 0 30px; /* Add more horizontal padding for the arrows */
}

/* Make sure just the track overflow is hidden, not the entire slider */
.testimonial-track {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    flex-wrap: nowrap;
}

.testimonial-item {
    flex: 0 0 100%;
    opacity: 0.7;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-item.active {
    opacity: 1;
    transform: scale(1);
}

.testimonial-controls {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.testimonial-dots {
    display: flex;
    gap: 8px;
}

.testimonial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonial-dot.active {
    background-color: var(--accent-color);
    transform: scale(1.2);
}

.testimonial-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--heading-text);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 5;
}

.testimonial-nav:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

.testimonial-prev {
    left: 5px;
}

.testimonial-next {
    right: 5px;
}

/* Enhanced Header with Sticky Nav */
#header {
    transition: all 0.3s ease;
}

#header.sticky {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--accent-color), var(--accent-hover));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Lazy Loading Animation */
.lazy-load {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Performance Optimizations */
img.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* Accessibility Focus Styles */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
    
    .testimonial-nav {
        width: 35px;
        height: 35px;
    }
}