/* Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --secondary-dark: #6d28d9;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --secondary-dark: #6d28d9;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #f3f4f6;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-muted: #f3f4f6;
    
    /* Spacing */
    --container-padding: clamp(1rem, 5vw, 2rem);
    --section-spacing: clamp(3rem, 10vw, 6rem);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
}

/* Base styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
}

/* Improved Typography Contrast */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.2;
}

.text-gray-600 {
    color: var(--text-secondary) !important;
}

.text-gray-500 {
    color: var(--text-muted) !important;
}

/* Hero Section Styles */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: transform 0.3s ease-out;
}

/* Add a subtle zoom effect on load */
.hero-bg.is-loaded {
    transform: scale(1.05);
}

/* Add an overlay for better text readability */
.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* Ensure the background image is visible even before JS loads */
.hero-bg[style*="background-image"] {
    opacity: 1;
    visibility: visible;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    animation: fade-in-up 1s ease-out;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Enhanced CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1),
                0 10px 15px rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(37, 99, 235, 0.15),
                0 12px 18px rgba(37, 99, 235, 0.15);
    background: var(--primary-dark);
}

.cta-button:hover::before {
    transform: translateX(100%);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button i {
    margin-left: 0.75rem;
    transition: transform 0.3s ease;
}

.cta-button:hover i {
    transform: translateX(4px);
}

/* Video Background */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: -1;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0.7)
    );
    z-index: 1;
}

/* Animated Elements */
.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 500;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.6s ease-out forwards 0.3s;
}

.hero-badge i {
    margin-right: 0.5rem;
    color: var(--accent);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    opacity: 0;
    animation: fade-in 1s ease-out forwards 1s;
}

.scroll-indicator-line {
    width: 2px;
    height: 60px;
    background: white;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.scroll-indicator-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    animation: scroll-line 2s ease-out infinite;
}

@keyframes scroll-line {
    0% {
        transform: translateY(-100%);
    }
    50% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Loading Animation */
.hero-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.hero-loading.is-loaded {
    opacity: 0;
    pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero {
        min-height: calc(100vh - var(--header-height));
        padding: 4rem 1rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .cta-button {
        width: 100%;
        max-width: 300px;
    }

    .scroll-indicator {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000EE;
        --primary-dark: #000099;
        --text-muted: #595959;
    }
    
    .card {
        border: 1px solid black;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out forwards;
}

/* Scroll Animations */
.scroll-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.scroll-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header & Navigation Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    transition: transform 0.3s ease;
}

.header.is-hidden {
    transform: translateY(-100%);
}

.main-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-list {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    transform: scaleX(1);
}

/* Mobile Navigation */
.mobile-menu {
    transition: max-height 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu.is-open {
    max-height: 400px;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

.mobile-nav-link:hover {
    color: var(--primary);
    background-color: var(--bg-muted);
}

.mobile-nav-link.active {
    color: var(--primary);
    background-color: var(--bg-muted);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Service Cards */
.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Detailed Service Sections */
.service-detail {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.service-detail.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Testimonials */
.testimonial-card {
    transition: all 0.3s ease;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Testimonial Carousel */
.testimonial-carousel {
    position: relative;
    overflow: hidden;
}

.testimonial-slide {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.6s ease;
}

.testimonial-slide.active {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 640px) {
    .grid-cols-2-sm {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-cols-3-md {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-4-lg {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Images */
.img-responsive {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Improved Form Elements */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--text-muted);
    border-radius: var(--radius-md);
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Skip to Main Content */
.skip-to-main {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 0;
}

/* Loading States */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-muted) 25%,
        var(--bg-secondary) 50%,
        var(--bg-muted) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000EE;
        --primary-dark: #000099;
        --text-muted: #595959;
    }
    
    .card {
        border: 1px solid black;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Focus Styles */
.nav-link:focus,
.dropdown-trigger:focus,
.dropdown-item:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.nav-link:focus:not(:focus-visible),
.dropdown-trigger:focus:not(:focus-visible),
.dropdown-item:focus:not(:focus-visible) {
    outline: none;
}

/* Skip Navigation */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    text-decoration: none;
    transition: top 0.3s ease;
    z-index: 1001;
}

.skip-nav:focus {
    top: 0;
}

/* Interactive Elements */
.accordion-header {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 500px;
}

/* Navigation */
.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.nav-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer-link {
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.social-icon {
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    color: var(--primary);
}

/* Service Section Styles */
.service-section {
    padding: var(--section-spacing) 0;
    background: var(--bg-secondary);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.1);
}

.service-image {
    aspect-ratio: 16/9;
    width: 100%;
    object-fit: cover;
}

.service-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.service-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Service Accordion */
.service-accordion {
    margin-top: 1.5rem;
    border-top: 1px solid var(--bg-muted);
}

.accordion-item {
    border-bottom: 1px solid var(--bg-muted);
}

.accordion-header {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    user-select: none;
}

.accordion-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.accordion-item.is-open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-right: 2rem;
}

.accordion-item.is-open .accordion-content {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

/* Service CTAs */
.service-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.service-cta {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.service-cta-primary {
    background: var(--primary);
    color: white;
}

.service-cta-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.service-cta-secondary {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.service-cta-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

/* Service Case Study */
.service-case-study {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    position: relative;
}

.case-study-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.case-study-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.case-study-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.case-study-text {
    flex-grow: 1;
}

.case-study-quote {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.case-study-author {
    font-weight: 600;
    color: var(--text-primary);
}

.case-study-role {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Service Stats */
.service-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-muted);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .service-card {
        max-width: 100%;
    }

    .service-cta-group {
        flex-direction: column;
    }

    .service-cta {
        width: 100%;
    }

    .case-study-content {
        flex-direction: column;
        text-align: center;
    }

    .case-study-logo {
        margin: 0 auto;
    }
}

/* Contact Section */
#contact {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    position: relative;
    overflow: hidden;
}

#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(79, 70, 229, 0.95) 50%, rgba(124, 58, 237, 0.95) 100%);
    z-index: 1;
}

#contact > * {
    position: relative;
    z-index: 2;
}

#contact .bg-white {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
