/* Custom Styles for Ifwe Connect */

/* Prevent horizontal overflow */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Import Inter Font */
.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Preloader Styles */
#preloader {
    transition: opacity 0.5s ease-out;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

/* Animated Background */
.animated-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    opacity: 0.05;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Navigation Styles */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile Navigation Fixes */
@media (max-width: 768px) {
    #navbar {
        padding: 0;
    }
    
    #navbar > div {
        padding: 0.75rem 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure logo doesn't overflow on mobile */
    #navbar .flex.items-center.space-x-3 {
        flex-shrink: 1;
        min-width: 0;
        max-width: calc(100% - 60px);
    }
    
    #navbar .flex.items-center.space-x-3 span {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    
    /* Mobile menu button positioning */
    #mobileMenuBtn {
        flex-shrink: 0;
        margin-left: 0.5rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure the flex container doesn't overflow */
    #navbar .flex.items-center.justify-between {
        width: 100%;
        min-width: 0;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #navbar > div {
        padding: 0.5rem 0.75rem;
    }
    
    #navbar .flex.items-center.space-x-3 span {
        font-size: 1rem;
        max-width: 150px;
    }
    
    #navbar .flex.items-center.space-x-3 {
        max-width: calc(100% - 50px);
    }
}

/* Add top padding to hero section to account for fixed navbar */
#home {
    padding-top: 80px;
}

@media (max-width: 768px) {
    #home {
        padding-top: 70px;
    }
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

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

/* Button Hover Effects */
button, a {
    transition: all 0.3s ease;
}

/* Service Cards Hover Effect */
.service-card {
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Expertise Cards 3D Effect */
.expertise-card {
    perspective: 1000px;
}

.expertise-card > div {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.expertise-card:hover > div {
    transform: rotateY(5deg) rotateX(-5deg);
}

/* Case Cards Animation */
.case-card {
    transition: all 0.3s ease;
}

.case-card:hover {
    transform: translateY(-10px);
}

/* Partners Slider */
.partners-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.partners-track {
    animation: scroll 20s linear infinite;
}

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

.partners-slider:hover .partners-track {
    animation-play-state: paused;
}

/* Partner Logo Styles */
.partner-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    height: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px;
    transition: all 0.3s ease;
}

.partner-logo img {
    max-width: 100%;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: none;
    transition: all 0.3s ease;
    border-radius: 20%;
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.partner-logo:hover img {
    filter: none;
    transform: scale(1.05);
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Form Styles */
input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dark Mode Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

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

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #3b82f6, #8b5cf6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #2563eb, #7c3aed);
}

/* Gradient Text Animation */
@keyframes gradient-text {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-text-animated {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-text 3s ease infinite;
}

/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

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

/* Pulse Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Mobile Menu Animation */
#mobileMenu {
    transition: all 0.3s ease;
    transform-origin: top;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
    margin: 0 -1rem;
    padding: 0 1rem 1rem 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: calc(100% + 2rem);
    box-sizing: border-box;
}

.dark #mobileMenu {
    background: rgba(31, 41, 55, 0.95);
}

#mobileMenu.show {
    display: block;
    animation: slideDown 0.3s ease;
}

#mobileMenu a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dark #mobileMenu a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobileMenu a:last-child {
    border-bottom: none;
}

#mobileMenu a:hover {
    background: rgba(59, 130, 246, 0.1);
    padding-left: 0.5rem;
    border-radius: 6px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Testimonial Quote Style */
.testimonial-quote {
    position: relative;
}

.testimonial-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: -30px;
    font-size: 80px;
    color: rgba(59, 130, 246, 0.2);
    font-family: Georgia, serif;
}

/* Loading Skeleton */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% { background-color: #f3f4f6; }
    100% { background-color: #e5e7eb; }
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Typewriter Effect */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typewriter {
    overflow: hidden;
    border-right: .15em solid #3b82f6;
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40, end),
        blink .75s step-end infinite;
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
}

/* Card Flip Animation */
.card-flip {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover {
    transform: rotateY(180deg);
}

/* Gradient Border */
.gradient-border {
    position: relative;
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(45deg, #3b82f6, #8b5cf6) border-box;
    border: 3px solid transparent;
}

/* Success Message Animation */
@keyframes success-slide {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    90% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.success-message {
    animation: success-slide 3s ease-in-out;
}

/* Number Rolling Animation */
@keyframes roll {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
}

.roll-in {
    animation: roll 0.5s ease-out;
}

/* Wave Animation for Background */
@keyframes wave {
    0% { transform: translateX(0) translateZ(0) scaleY(1); }
    50% { transform: translateX(-25%) translateZ(0) scaleY(0.5); }
    100% { transform: translateX(-50%) translateZ(0) scaleY(1); }
}

.wave {
    animation: wave 10s linear infinite;
}

/* 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.3),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gradient-text-animated {
        font-size: 3rem;
    }
    
    .partners-track {
        animation-duration: 15s;
    }
    
    .glass-card {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

/* Print Styles */
@media print {
    #navbar, #backToTop, .floating-contact {
        display: none;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #e5e7eb;
    }
}

/* Custom Focus States */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth Transitions for All Interactive Elements */
a, button, input, textarea, select {
    transition: all 0.2s ease;
}

/* Loading State */
.loading {
    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 #3b82f6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    color: white;
}

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

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: #1f2937;
    color: white;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* Growth Chart Styles */
.growth-chart-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.growth-chart {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    max-height: 250px;
}

/* Chart animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 0.6;
        transform: scale(1);
    }
}

@keyframes drawLine {
    from {
        stroke-dashoffset: 2000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fillArea {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.growth-chart #dataPoints circle {
    transform-origin: center;
}

/* Responsive adjustments for chart */
@media (max-width: 768px) {
    .growth-chart {
        max-height: 200px;
    }
}

/* Accessibility Improvements */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glass-card {
        background: white;
        border: 2px solid black;
    }
    
    .dark .glass-card {
        background: black;
        border: 2px solid white;
    }
}

/* 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;
    }
}

/* Custom Selection Colors */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #1e3a8a;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.3);
    color: #1e3a8a;
}

/* Footer Link Hover Effect */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: white;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}
