/* MAPP77 Custom Styles */
/* Complements Tailwind CSS */

/* Custom Properties - High Contrast Palette */
:root {
    /* Deep Navy - Primary dark color */
    --navy-900: #0a1628;
    --navy-800: #0f2447;
    --navy-700: #1a365d;
    --navy-600: #2a4a7f;

    /* Teal Accent - Primary accent */
    --teal-600: #0284c7;
    --teal-500: #0891b2;
    --teal-400: #22d3ee;
    --teal-300: #67e8f9;

    /* Neutral Grays - High contrast */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Contrast ratios optimized for WCAG AA */
    --text-primary: #0f172a;      /* 16:1 on white */
    --text-secondary: #475569;    /* 7:1 on white */
    --text-on-dark: #ffffff;      /* 16:1 on navy-900 */
    --text-muted-dark: #cbd5e1;   /* 8:1 on navy-900 */
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Gradient Backgrounds */
.gradient-navy {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
}

.gradient-teal {
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-400) 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
}

/* Animated Background Pattern */
.bg-pattern {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(8, 145, 178, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(8, 145, 178, 0.06) 0%, transparent 40%);
}

/* DNA Helix Animation Background */
.dna-pattern {
    position: relative;
    overflow: hidden;
}

.dna-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2322d3ee' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-navy {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
    color: white;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-400) 100%);
    color: white;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--teal-400);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid var(--teal-400);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--teal-400);
    color: var(--navy-900);
}

.btn-white {
    background: white;
    color: var(--navy-800);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-white:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

/* Navigation */
.nav-link {
    position: relative;
    color: var(--gray-300);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--teal-400);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Section Styling */
.section-title {
    font-size: 2.5rem;
    color: var(--navy-900);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 600px;
}

/* Service Icon Boxes */
.icon-box {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-400) 100%);
    color: white;
    margin-bottom: 1rem;
}

/* Process Steps */
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-800);
    color: var(--teal-400);
    font-weight: 700;
    font-size: 1.25rem;
}

.step-connector {
    position: absolute;
    top: 24px;
    left: 48px;
    width: calc(100% - 48px);
    height: 2px;
    background: linear-gradient(90deg, var(--navy-800), var(--gray-300));
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 0.875rem;
}

/* Sticky Header */
.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-sticky.scrolled {
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: var(--navy-900);
    z-index: 1001;
    transition: right 0.3s ease;
    padding: 80px 24px 24px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

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

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

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

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

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

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Stagger delays for children */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stats Counter */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--teal-400);
    line-height: 1;
}

/* Testimonial Slider */
.testimonial-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer-link {
    color: var(--gray-400);
    transition: color 0.3s ease;
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    /* Typography scaling */
    .section-title {
        font-size: 1.875rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    /* Button adjustments */
    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 0.9375rem;
        width: 100%;
        justify-content: center;
    }

    /* Card spacing */
    .card {
        padding: 20px;
    }

    /* Icon box sizing */
    .icon-box {
        width: 56px;
        height: 56px;
    }

    /* Step connector hidden on mobile */
    .step-connector {
        display: none;
    }

    /* Form inputs */
    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Navigation sticky adjustments */
    .services-nav {
        -webkit-overflow-scrolling: touch;
    }

    /* Hero section padding */
    .hero-section {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    /* Reduce section padding on mobile */
    section {
        padding-top: 60px;
        padding-bottom: 60px;
    }
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.625rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Stack buttons vertically */
    .btn-group {
        flex-direction: column;
        gap: 12px;
    }

    /* Full width cards on mobile */
    .card {
        border-radius: 12px;
    }

    /* Badge sizing */
    .badge {
        font-size: 0.6875rem;
        padding: 4px 10px;
    }

    /* Step number sizing */
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .nav-link,
    .footer-link,
    button,
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .form-input,
    .form-select,
    .form-textarea {
        min-height: 48px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if needed */
}

/* Print styles */
@media print {
    .header-sticky,
    .mobile-menu,
    .mobile-overlay,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }

    body {
        color: black;
        background: white;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--navy-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--navy-600);
}

/* Loading animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--teal-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Canvas Background Sections */
section {
    position: relative;
}

section > canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

section > *:not(canvas) {
    position: relative;
    z-index: 1;
}

/* High Contrast Text Improvements */
.text-high-contrast {
    color: var(--text-primary);
}

.text-high-contrast-secondary {
    color: var(--text-secondary);
}

/* Enhanced Button Contrast */
.btn-primary {
    background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-500) 100%);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Section alternating backgrounds with subtle distinction */
.section-light {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.section-lighter {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Improved card shadows for depth */
.card-elevated {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 12px 24px rgba(0, 0, 0, 0.06);
}

/* Subtle grid pattern for white backgrounds */
.bg-grid-pattern {
    background-image:
        linear-gradient(rgba(8, 145, 178, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 145, 178, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Dot pattern for sections */
.bg-dot-pattern {
    background-image: radial-gradient(rgba(8, 145, 178, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Gradient overlay for visual interest */
.bg-gradient-subtle {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(8, 145, 178, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(34, 211, 238, 0.03) 0%, transparent 50%);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--teal-500);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--navy-900);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    transition: top 0.3s;
}

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

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--navy-900);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: rgba(8, 145, 178, 0.1);
    color: var(--teal-500);
}

/* Checklist styling */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.checklist-item::before {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--teal-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}
