/* ============================================
   BizVenture4 Custom Styles
   ADA Compliant | WCAG 2.1 AA
   ============================================ */

/* Screen Reader Only Class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 1rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

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

/* Prevent Horizontal Scroll on Mobile */
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Ensure all sections don't overflow */
section {
    overflow-x: hidden;
}

/* Fix container overflow */
.container {
    overflow-x: hidden;
}

/* Focus Visible for Keyboard Navigation (ADA Compliance) */
*:focus-visible {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

/* Remove outline for mouse users but keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode Support (ADA Compliance) */
@media (prefers-contrast: high) {
    body {
        background: #ffffff;
        color: #000000;
    }
}

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

/* Custom Animations */
@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);
    }
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

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

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* Initial state for animated elements */
.gsap-reveal {
    opacity: 0;
    transform: translateY(50px);
}

/* Hero Section Specific */
.hero-section {
    position: relative;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero-tagline {
    animation: fadeInUp 1s ease-out 0.6s forwards;
    opacity: 0;
}

.cta-button {
    animation: fadeInUp 1s ease-out 0.8s forwards;
    opacity: 0;
}

/* Navigation Styles */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4a90e2;
    transition: width 0.3s ease;
}

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

/* Button Styles */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn-primary:hover::before,
.btn-primary:focus::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.why-card {
    transition: all 0.3s ease;
}

.why-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Process Steps */
.process-step {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.process-step:hover {
    border-left-color: #4a90e2;
}

/* Service Card Styles */
.service-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.service-card:hover {
    border-color: #4a90e2;
    box-shadow: 0 25px 50px -12px rgba(74, 144, 226, 0.25);
}

/* Form Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Ensure sufficient color contrast (ADA Compliance) */
.text-gray-600 {
    color: #525252;
}

.text-gray-700 {
    color: #404040;
}

.text-gray-400 {
    color: #a1a1a1;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Accessibility: Increase tap target size for mobile */
@media (max-width: 768px) {
    button,
    a.btn-primary,
    .cta-button {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Print Styles (ADA Compliance) */
@media print {
    nav,
    footer,
    .cta-button {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a5f;
}

/* Selection Color */
::selection {
    background: #4a90e2;
    color: white;
}

::-moz-selection {
    background: #4a90e2;
    color: white;
}

/* Responsive Typography */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1440px) {
    html {
        font-size: 18px;
    }
}

/* Mobile Overflow Prevention */
@media (max-width: 768px) {
    /* Prevent all horizontal overflow on mobile */
    * {
        max-width: 100%;
    }

    /* Fix image overflow */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Ensure hero section doesn't overflow */
    .hero-section {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Fix container padding on small screens */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Prevent table overflow */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Fix wide content */
    pre, code {
        overflow-x: auto;
        max-width: 100%;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    /* Tighter padding for very small screens */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Smaller font sizes to prevent overflow */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}
