/* Enhanced Animations for Sompalli & Co Website */

/* ==========================================================================
   Gradient Background Animations
   ========================================================================== */

   .gradient-bg {
    background: linear-gradient(-45deg, #0d47a1, #1976d2, #303f9f, #1e88e5);
    background-size: 400% 400%;
    animation: gradient-bg 15s ease infinite;
}

@keyframes gradient-bg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Navbar Animation Enhancements
   ========================================================================== */

.navbar .nav-link {
    position: relative;
    overflow: hidden;
}

.navbar .nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    opacity: 0;
}

.navbar .nav-link:hover::before {
    width: 100%;
    opacity: 1;
}

.navbar .dropdown-item {
    transform: translateX(0);
    transition: all 0.3s ease;
}

.navbar .dropdown-item:hover {
    transform: translateX(5px);
}

/* ==========================================================================
   Card Hover Effects
   ========================================================================== */

.card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    border-radius: var(--border-radius);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

.card:hover {
    transform: translateY(-10px);
}

.card:hover::after {
    opacity: 1;
}

/* Service Cards with Mouse Follow Effect */
.service-card {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: var(--y, 0);
    left: var(--x, 0);
    width: 0;
    height: 0;
    background: radial-gradient(circle closest-side, rgba(94, 146, 243, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.service-card:hover::before {
    width: 200%;
    height: 200%;
}

/* Team Member Cards */
.team .card img {
    transition: all 0.5s ease;
}

.team .card:hover img {
    transform: scale(1.1);
}

.team .social-links {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.team .card:hover .social-links {
    max-height: 50px;
}

.team .social-link {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.team .card:hover .social-link {
    transform: translateY(0);
    opacity: 1;
}

.team .card:hover .social-link:nth-child(1) { transition-delay: 0.1s; }
.team .card:hover .social-link:nth-child(2) { transition-delay: 0.2s; }
.team .card:hover .social-link:nth-child(3) { transition-delay: 0.3s; }
.team .card:hover .social-link:nth-child(4) { transition-delay: 0.4s; }

/* Testimonial Cards */
.testimonial {
    transition: all 0.4s ease;
}

.testimonial:hover {
    transform: scale(1.03);
}

.testimonial-image {
    transition: all 0.4s ease;
}

.testimonial:hover .testimonial-image {
    transform: scale(1.1);
    border-color: var(--accent-color);
}

/* ==========================================================================
   Button Animations
   ========================================================================== */

.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.7s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-glow {
    animation: button-glow 2s infinite alternate;
}

@keyframes button-glow {
    from { box-shadow: 0 0 5px rgba(255, 193, 7, 0.5); }
    to { box-shadow: 0 0 20px rgba(255, 193, 7, 0.8); }
}

.btn-pulse {
    animation: button-pulse 2s infinite;
}

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

/* ==========================================================================
   Text Animation Effects
   ========================================================================== */

/* Typing Effect */
.typing-effect {
    border-right: 3px solid;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(30, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color) }
}

/* Text Reveal */
.reveal-text {
    position: relative;
    overflow: hidden;
}

.reveal-text span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: reveal-text 0.8s forwards;
}

@keyframes reveal-text {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Apply different delays to each letter or word */
.reveal-text-char:nth-child(1) { animation-delay: 0.1s; }
.reveal-text-char:nth-child(2) { animation-delay: 0.15s; }
.reveal-text-char:nth-child(3) { animation-delay: 0.2s; }
.reveal-text-char:nth-child(4) { animation-delay: 0.25s; }
.reveal-text-char:nth-child(5) { animation-delay: 0.3s; }
/* Add more as needed */

/* Floating Animation for Icons */
.floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Highlight Text Animation */
.highlight-text {
    position: relative;
    display: inline-block;
}

.highlight-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: rgba(255, 193, 7, 0.3);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease;
}

.highlight-text:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ==========================================================================
   Section Animation Effects
   ========================================================================== */

/* Parallax Background */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Section Transitions */
.section-transition {
    position: relative;
    overflow: hidden;
}

.section-transition::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.1) 0%, transparent 50%);
    opacity: 0.5;
    z-index: -1;
}

/* Wave Separator */
.wave-separator {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.wave-separator svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Count-up Animation
   ========================================================================== */

.counter-value {
    visibility: hidden;
}

.counter-value.counted {
    visibility: visible;
}

/* ==========================================================================
   Scroll Indicator
   ========================================================================== */

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    opacity: 0;
    animation: fade-in 1s ease forwards;
    animation-delay: 2s;
}

@keyframes fade-in {
    to { opacity: 1; }
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: white;
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.scroll-text {
    margin-top: 10px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==========================================================================
   Responsive Animations
   ========================================================================== */

@media (max-width: 991.98px) {
    .parallax-bg {
        background-attachment: scroll;
    }
}
