@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Reset and Base Styles */
:root {
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Changed to auto to prevent conflicts with JS smooth scroll */
    width: 100%;
    overflow-x: hidden;
}

/* Prevent scroll issues on mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 16px;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Prevent pull-to-refresh on mobile */
    body {
        overscroll-behavior-y: contain;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        position: relative;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Prevent accidental scrolling triggers */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        max-width: 100%;
    }
    
    /* Ensure main content scrolls properly */
    main {
        position: relative;
        overflow-x: hidden;
        min-height: 100vh;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Make all images responsive */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* Make all containers responsive */
    .container, section, div {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Make all images responsive by default */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Make background images responsive */
[style*="background-image"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Prevent scroll jank - only on transform elements */
.card, .portfolio-item, .service-card, .stat-item {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
}

body {
    font-family: var(--font-primary);
    color: #000000;
    line-height: 1.6;
    padding-top: 0;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%, #ffffff 100%);
    background-size: 400% 400%;
    animation: gradientShift 25s ease infinite;
    min-height: 100vh;
    position: relative;
    font-size: 16px;
}

/* Mobile Base Font Size Improvement */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    body {
        font-size: 17px;
        line-height: 1.7;
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Mobile Button Improvements */
    .btn {
        padding: 16px 28px !important;
        font-size: 17px !important;
        min-height: 50px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }
    
    .btn-primary,
    .btn-outline,
    .btn-white,
    .btn-light {
        font-size: 17px !important;
        padding: 16px 28px !important;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 16px;
    }
    
    body {
        font-size: 18px;
        line-height: 1.8;
    }
    
    /* Small Mobile Button Improvements */
    .btn {
        padding: 15px 24px !important;
        font-size: 16px !important;
        min-height: 48px;
    }
    
    .btn-primary,
    .btn-outline,
    .btn-white,
    .btn-light {
        font-size: 16px !important;
        padding: 15px 24px !important;
        min-height: 48px;
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(5, 45, 105, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(5, 45, 105, 0.1) 0%, transparent 60%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 247, 255, 0.95) 100%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundPulse 30s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

body > * {
    position: relative;
    z-index: 1;
}

button,
input,
textarea,
select {
    font-family: var(--font-primary);
}

/* Sections */
.section {
    padding: 45px 0;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(5, 45, 105, 0.2), transparent);
}

.section-muted {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(5, 45, 105, 0.05) 50%, rgba(0, 0, 0, 0.02) 100%);
    position: relative;
}

.section-muted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(5, 45, 105, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 247, 255, 0.9) 100%);
    pointer-events: none;
    animation: subtlePulse 8s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive container fixes */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #000 0%, #052D69 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.section-subtitle {
    color: #666;
    margin-top: 6px;
    font-size: clamp(13px, 1.6vw, 15px);
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(5, 45, 105, 0.18);
}

.btn::before {
    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::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #052D69 0%, #0a4da3 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(5, 45, 105, 0.25);
    position: relative;
    overflow: hidden;
    border: none;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a4da3 0%, #052D69 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(5, 45, 105, 0.35);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 45, 105, 0.3);
}

.btn-outline {
    border: 2px solid #052D69;
    color: #052D69;
    background: transparent;
    position: relative;
    box-shadow: 0 2px 8px rgba(5, 45, 105, 0.15);
}

.btn-outline::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #052D69;
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline:hover {
    color: #fff;
    border-color: #052D69;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(5, 45, 105, 0.3);
}

.btn-outline:hover::after {
    left: 0;
}

.btn-light {
    background: #ffffff;
    color: #052D69;
    border: 2px solid rgba(5, 45, 105, 0.2);
    box-shadow: 0 3px 10px rgba(5, 45, 105, 0.15);
}

.btn-light:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(5, 45, 105, 0.25);
    border-color: #052D69;
    color: #052D69;
}

.btn-link {
    color: #052D69;
    background: transparent;
    border: none;
    padding: 12px 0;
    position: relative;
}

.btn-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #052D69;
    transition: width 0.3s ease;
}

.btn-link:hover {
    color: #052D69;
}

.btn-link:hover::after {
    width: 100%;
}

.btn-white {
    background-color: #ffffff;
    color: #052D69;
    border: 2px solid #ffffff;
    padding: 14px 32px;
    font-size: 16px;
}

.btn-white:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Simple scroll animations - Start hidden, animate on scroll */
.animate-up { 
    opacity: 0; 
    transform: translateY(30px); 
    transition: opacity .6s cubic-bezier(0.4, 0, 0.2, 1), transform .6s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-fade { 
    opacity: 0; 
    transition: opacity .6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When JS adds in-view class, ensure visibility */
.in-view { 
    opacity: 1 !important; 
    transform: translateY(0) !important; 
}

/* Interactive Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(5, 45, 105, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(5, 45, 105, 0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #052D69;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: #ffffff;
}

.loader-logo {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 30px;
    animation: loaderPulse 2s ease-in-out infinite;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.loader-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.8));
    border-radius: 2px;
    width: 0%;
    animation: loaderProgress 2s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes loaderPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes loaderProgress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #052D69;
    z-index: 10000;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 10px rgba(5, 45, 105, 0.5);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #052D69;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(5, 45, 105, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #000000;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(5, 45, 105, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .section-title {
        font-size: 28px;
    }
    .section {
        padding: 55px 0;
    }
}

@media (max-width: 768px) {
    .section { 
        padding: 50px 0; 
        width: 100%;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 16px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .section-header {
        margin-bottom: 30px;
        text-align: center;
        width: 100%;
        padding: 0;
    }
    
    .section-title {
        font-size: clamp(24px, 7vw, 32px) !important;
        line-height: 1.3;
        margin-bottom: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .section-subtitle {
        font-size: clamp(15px, 4vw, 18px) !important;
        line-height: 1.6;
        padding: 0 10px;
        word-wrap: break-word;
    }
    
    /* Ensure all buttons are touch-friendly */
    .btn {
        min-width: 120px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Prevent horizontal scrolling */
    body, html, main, section, div {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .section { 
        padding: 40px 0; 
        width: 100%;
    }
    
    .container {
        padding: 0 14px;
        width: 100%;
    }
    
    .section-header {
        margin-bottom: 24px;
        padding: 0;
    }
    
    .section-title {
        font-size: clamp(22px, 8vw, 28px) !important;
        margin-bottom: 10px;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .section-subtitle {
        font-size: clamp(14px, 4.5vw, 17px) !important;
        padding: 0 8px;
        word-wrap: break-word;
    }
    
    .loader-logo {
        font-size: 32px;
        letter-spacing: 2px;
    }
    
    .loader-progress {
        width: 200px;
        max-width: 80%;
    }
    
    .back-to-top {
        width: 48px;
        height: 48px;
        bottom: 20px;
        right: 20px;
        font-size: 18px;
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Ensure buttons are large enough for touch */
    .btn {
        min-height: 44px;
        min-width: 100px;
        padding: 14px 24px !important;
        font-size: 16px !important;
    }
}

