/* Animation and Effects CSS */

/* Enhanced Hero Section Transitions */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease-in-out; 
    z-index: 2; /* Slides are above the overlay */
}

.slide.active {
    opacity: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 3; /* Higher than slides */
    max-width: 700px; 
    width: 90%;
    text-align: center;
    color: var(--text-light);
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.8s ease-in-out, 
                transform 0.8s ease-in-out, 
                visibility 0s linear 0.8s;
}

.hero-content.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.8s ease-in-out, 
                transform 0.8s ease-in-out,
                visibility 0s linear;
}

/* Parallax effect for page heroes */
.page-hero {
    background-attachment: scroll; /* Changed from fixed to scroll */
    background-size: cover;
    background-position: center center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.page-hero .container {
    position: relative;
    z-index: 1;
    animation: fadeIn 1.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Service & Feature Items Hover Effects */
.service-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.12), 0 10px 10px rgba(0,0,0,0.08);
    background-color: #fcfcfc;
}

.service-icon, .feature-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.feature-item:hover .feature-icon {
    color: var(--accent-blue-darker);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--accent-blue-darker);
}

.back-to-top i {
    font-size: 1.2rem;
}

/* Enhance buttons with transitions */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.cta-button:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Header shadow and transition */
header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background-color: rgba(52, 152, 219, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Text reveal animations */
.text-reveal {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    animation: text-reveal 1.5s ease forwards;
}

@keyframes text-reveal {
    0% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

/* Image hover effects */
.image-gallery-grid img {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.image-gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Service & Feature Items Hover Effects */
.service-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.12), 0 10px 10px rgba(0,0,0,0.08);
    background-color: #fcfcfc;
}

.service-icon, .feature-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.feature-item:hover .feature-icon {
    color: var(--accent-blue-darker);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--accent-blue-darker);
}

.back-to-top i {
    font-size: 1.2rem;
}

/* Enhance buttons with transitions */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.cta-button:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Header shadow and transition */
header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background-color: rgba(52, 152, 219, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Text reveal animations */
.text-reveal {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    animation: text-reveal 1.5s ease forwards;
}

@keyframes text-reveal {
    0% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

/* Image hover effects */
.image-gallery-grid img {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.image-gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
