/* ============================================
   Animations & Transitions
   ============================================ */

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Utility Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

/* Animate on Scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Forms should always be visible and interactive */
.contact-form.animate-on-scroll,
.contact-form.animate-on-scroll form,
.contact-form.animate-on-scroll .form-group,
.contact-form.animate-on-scroll input,
.contact-form.animate-on-scroll textarea,
.contact-form.animate-on-scroll select,
.contact-form.animate-on-scroll button {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10 !important;
}

/* Page Hero Section */
.page-hero-section {
    padding: 180px 0 80px;
    background: linear-gradient(135deg, rgba(154, 203, 223, 0.1) 0%, rgba(59, 90, 105, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.page-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="100" fill="%239acbdf" opacity="0.1"/><circle cx="800" cy="300" r="150" fill="%233b5a69" opacity="0.1"/><circle cx="400" cy="700" r="120" fill="%239acbdf" opacity="0.1"/></svg>');
    animation: float 20s ease-in-out infinite;
}

.page-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.page-hero-subtitle {
    font-size: 1.3rem;
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Filter Section */
.filter-section {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.8rem;
    border: 2px solid var(--color-border);
    background: white;
    color: var(--color-text);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
    box-shadow: 0 4px 15px rgba(59, 90, 105, 0.3);
}

/* Case Card Enhancements */
.case-card {
    position: relative;
    overflow: hidden;
}

.case-image {
    position: relative;
    overflow: hidden;
}

.case-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 90, 105, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.case-card:hover .case-overlay {
    opacity: 1;
}

.case-overlay-btn {
    padding: 1rem 2rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.case-card:hover .case-overlay-btn {
    transform: translateY(0);
}

.case-overlay-btn:hover {
    background: white;
    color: var(--color-secondary);
    transform: translateY(-3px) scale(1.05);
}

.case-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.tech-badge {
    padding: 0.4rem 1rem;
    background: rgba(154, 203, 223, 0.15);
    color: var(--color-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(154, 203, 223, 0.3);
    transition: all 0.3s ease;
}

.case-card:hover .tech-badge {
    background: rgba(154, 203, 223, 0.25);
    transform: translateY(-2px);
}

/* Service Card Enhancements */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(154, 203, 223, 0.1), transparent);
    transition: left 0.6s ease;
}

.service-card:hover::before {
    left: 100%;
}

.service-icon {
    position: relative;
    overflow: hidden;
}

.service-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.service-card:hover .service-icon::after {
    width: 200px;
    height: 200px;
}

/* Industry Card Enhancements */
.industry-card {
    position: relative;
    overflow: hidden;
}

.industry-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(154, 203, 223, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.industry-card:hover::before {
    width: 300px;
    height: 300px;
}

.industry-icon {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.industry-card:hover .industry-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Contact Form Enhancements */
.contact-form {
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    box-shadow: 0 0 0 3px rgba(154, 203, 223, 0.2);
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Text Animations */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Industry Link */
.industry-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.industry-link:hover {
    color: var(--color-primary);
    gap: 0.8rem;
}

/* Form Message */
.form-message {
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    animation: slideInRight 0.5s ease-out;
}

.success-message {
    background: #10b981;
    color: white;
    border-left: 4px solid #059669;
}

.error-message {
    background: #ef4444;
    color: white;
    border-left: 4px solid #dc2626;
}

.form-message i {
    font-size: 1.3rem;
}

/* Case Meta */
.case-meta {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.case-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.case-meta i {
    color: var(--color-primary);
}

/* Contact Item Links */
.contact-text a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-text a:hover {
    color: var(--color-primary);
}

/* Form Field Error */
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #ef4444 !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.field-error {
    animation: fadeIn 0.3s ease;
}

/* Button Loading State */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Smooth Page Transitions */
.page-hero-section,
.section {
    animation: fadeIn 0.6s ease-out;
}

/* Enhanced Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(59, 90, 105, 0.25);
}

.hover-lift:active {
    transform: translateY(-5px) scale(0.98);
}

/* Icon Animations */
.service-icon i,
.industry-icon i {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon i,
.industry-card:hover .industry-icon i {
    transform: scale(1.1) rotate(5deg);
}

/* Link Arrow Animation */
.case-link i,
.service-link i,
.industry-link i {
    transition: transform 0.3s ease;
}

.case-link:hover i,
.service-link:hover i,
.industry-link:hover i {
    transform: translateX(5px);
}

/* Card Image Hover Effect */
.case-image {
    transition: transform 0.5s ease;
}

.case-card:hover .case-image {
    transform: scale(1.1);
}

/* Stagger Animation Delay */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }
.animate-on-scroll:nth-child(7) { transition-delay: 0.7s; }
.animate-on-scroll:nth-child(8) { transition-delay: 0.8s; }

/* Better Animation Timing */
.cases-grid .animate-on-scroll,
.services-grid .animate-on-scroll,
.industries-grid .animate-on-scroll,
.testimonials-grid .animate-on-scroll {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text Reveal Animation */
.text-reveal {
    opacity: 0;
    white-space: normal !important; /* Ensure spaces are preserved */
    word-spacing: normal !important;
    letter-spacing: normal !important;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

.text-reveal span {
    display: inline-block;
    white-space: normal;
    margin: 0; /* No margin - spaces will be handled by text nodes */
}

/* Preserve spaces between words - text nodes handle this naturally */
.text-reveal::before,
.text-reveal::after {
    content: none;
}

/* Typing Text Animation */
.typing-text {
    position: relative;
}

.typing-text::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Fade In Delay Classes */
.fade-in-delay-1 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.3s;
}

.fade-in-delay-2 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.6s;
}

.fade-in-delay-3 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.9s;
}

/* Count Up Animation */
.count-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.count-up.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Button Pulse Animation */
.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 90, 105, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 90, 105, 0);
    }
}

/* Hero Title Animation */
.hero-title-animated {
    overflow: hidden;
}

.hero-title-animated span {
    display: inline-block;
}

/* Character Animation */
.hero-title-animated span span {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Scroll Animations */
@media (prefers-reduced-motion: no-preference) {
    .animate-on-scroll {
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .animate-on-scroll.animated {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Hover Effects for Better UX */
.case-card,
.service-card,
.industry-card,
.testimonial,
.recognition-item,
.team-member {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.case-card:active,
.service-card:active,
.industry-card:active {
    transform: translateY(-3px) scale(0.98);
}

/* Smooth Focus States */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Loading Skeleton Animation */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

/* Smooth Page Load */
body {
    animation: fadeIn 0.5s ease-out;
}

/* Loading State */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Improved Button Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

/* Enhanced Card Animations */
.case-card,
.service-card,
.industry-card {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* Text Selection */
::selection {
    background: var(--color-primary);
    color: white;
}

::-moz-selection {
    background: var(--color-primary);
    color: white;
}

