/* Enhanced Interactive Elements */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced Card Interactions */
.card, .portfolio-item, .team-card, .mission-vision-card {
    transform: translateZ(0);
    will-change: transform;
}

.card:hover, .portfolio-item:hover, .team-card:hover {
    transform: translateY(-6px) scale(1.015);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Magnetic Button Effect */
.btn {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.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 ease, height 0.6s ease;
    z-index: 0;
}

.btn:hover::after {
    width: 320px;
    height: 320px;
}

.btn > * {
    position: relative;
    z-index: 1;
}

/* Text Reveal Animation */
.hero-title, .section-title, .page-hero-title {
    overflow: hidden;
}

.hero-title span, .section-title span {
    display: inline-block;
    animation: slideUpFade 0.8s ease forwards;
    opacity: 0;
    transform: translateY(100%);
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Parallax Scroll Effect */
.hero, .page-hero {
    background-attachment: scroll;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Gradient Text Animation */
.section-title, .page-hero-title, .hero-title {
    background-size: 200% auto;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* Hover Glow Effect */
.card, .portfolio-item, .btn-primary {
    position: relative;
}

.card::before, .portfolio-item::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #052D69, transparent, #052D69);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card:hover::before, .portfolio-item:hover::before {
    opacity: 1;
    animation: rotateBorder 3s linear infinite;
}

@keyframes rotateBorder {
    to { transform: rotate(360deg); }
}

/* Image Zoom on Hover */
.card-media, .portfolio-media, .service-image, .team-image {
    overflow: hidden;
}

.card-media img, .portfolio-media img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-media img, .portfolio-item:hover .portfolio-media img {
    transform: scale(1.15);
}

/* Stagger Animation for Grid Items */
.cards-grid > *:nth-child(1) { animation-delay: 0s; }
.cards-grid > *:nth-child(2) { animation-delay: 0.1s; }
.cards-grid > *:nth-child(3) { animation-delay: 0.2s; }

.portfolio-grid > *:nth-child(1) { animation-delay: 0s; }
.portfolio-grid > *:nth-child(2) { animation-delay: 0.05s; }
.portfolio-grid > *:nth-child(3) { animation-delay: 0.1s; }
.portfolio-grid > *:nth-child(4) { animation-delay: 0.15s; }
.portfolio-grid > *:nth-child(5) { animation-delay: 0.2s; }
.portfolio-grid > *:nth-child(6) { animation-delay: 0.25s; }

/* Form Input Focus Effects */
.form-input:focus, .form-textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 45, 105, 0.15), 0 0 0 4px rgba(5, 45, 105, 0.1);
}

.form-input, .form-textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Skeleton Animation */
@keyframes skeleton {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

/* Scroll Reveal Animation */
.animate-up, .animate-fade {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-up {
    transform: translateY(40px);
}

.animate-fade {
    transform: scale(0.95);
}

.in-view {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transform: scale(1) !important;
}

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::before {
    width: 240px;
    height: 240px;
}

/* Icon Hover Rotation */
.social-icon, .contact-icon, .mission-vision-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-icon:hover, .contact-item:hover .contact-icon {
    transform: rotate(360deg) scale(1.1);
}

/* Text Underline Animation */
.nav-link, .contact-link {
    position: relative;
}

.nav-link::after, .contact-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after, .contact-link:hover::after {
    width: 100%;
}

/* Card Flip Effect (Optional) */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

/* Shimmer Effect */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

/* Enhanced Hover States */
.card:hover .card-title, .portfolio-item:hover .portfolio-name {
    color: #052D69;
    transform: translateX(5px);
}

/* Smooth Transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #052D69;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 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;
    }
}

/* Mobile Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover, .portfolio-item:hover {
        transform: translateY(-4px);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

