/* Custom styles for loan landing page */

/* Smooth scrolling with performance optimization */
html {
    scroll-behavior: smooth;
    /* Prevent scroll jitter */
    -webkit-overflow-scrolling: touch;
    /* Prevent horizontal scroll */
    overflow-x: hidden;
}

body {
    /* Optimize scrolling performance */
    will-change: scroll-position;
    /* Prevent horizontal scroll */
    overflow-x: hidden;
}

/* Navbar styles */
#navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

/* Counter animation */
.counter {
    display: inline-block;
}

/* FAQ toggle animation */
.faq-toggle {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.faq-toggle i {
    transition: transform 0.3s ease;
}

.faq-toggle.active i {
    transform: rotate(180deg);
}

/* FAQ content animation */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-content:not(.hidden) {
    max-height: 500px;
}

/* Override hidden class for FAQ content */
.faq-content.hidden {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Form focus effects */
input:focus,
select:focus,
textarea:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Button hover effects */
button:not(.faq-toggle) {
    position: relative;
    overflow: hidden;
}

button:not(.faq-toggle)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:not(.faq-toggle):hover::before {
    width: 300px;
    height: 300px;
}

/* Ripple effect styles */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e3a8a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero section with enhanced parallax */
#home {
    position: relative;
    overflow: hidden;
}

/* Enhanced text shadows for better readability */
#home h2, #home p, #home span {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Stronger shadow for gradient text */
#home .text-transparent {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

/* Form glow effect on hero section */
#home .bg-white {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(255, 255, 255, 0.1);
}

/* Remove text shadow for specific form elements */
#home .bg-white p {
    text-shadow: none !important;
}

/* Better button visibility */
#home a.bg-orange-500, #home a.bg-green-500 {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Parallax background image */
.parallax-bg {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Float animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.03);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 8s ease-in-out infinite;
    animation-delay: 1s;
}

/* Service card hover effect */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* Mobile menu animation - removed as we use inline styles */

/* Ensure mobile menu is visible only on mobile devices */
@media (min-width: 768px) {
    #mobile-menu {
        display: none !important;
    }
}

/* Fix navbar and mobile menu on mobile */
@media (max-width: 767px) {
    #navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 50;
        /* Ensure navbar height is only as tall as its content */
        height: auto;
    }
    
    /* Ensure mobile menu doesn't affect navbar height when closed */
    #mobile-menu {
        /* Remove any default spacing */
        margin: 0;
        padding: 0;
    }
    
    /* Remove any default margins/paddings that might affect height */
    #mobile-menu {
        margin: 0;
        padding: 0;
    }
}

/* Testimonial card */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 60px;
    color: #e5e7eb;
    font-family: Georgia, serif;
}

/* Progress bar for form */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #1e3a8a;
    width: 0;
    transition: width 0.3s ease;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

/* Scroll to top button */
#scroll-to-top {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1e3a8a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

/* Background patterns */
.bg-pattern {
    background-image: 
        repeating-linear-gradient(
            45deg,
            #f0f0f0,
            #f0f0f0 10px,
            transparent 10px,
            transparent 20px
        );
}

/* Enhanced hover effects for cards */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

.group:hover .group-hover\:translate-x-2 {
    transform: translateX(0.5rem);
}

/* Gradient text */
.text-transparent {
    -webkit-background-clip: text;
    background-clip: text;
}

/* Premium gradient text effect */
.premium-gradient-text {
    position: relative;
    display: inline-block;
    font-weight: 900;
    letter-spacing: 0.05em;
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.premium-gradient-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #dc2626 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(10px);
    opacity: 0.7;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: blur(10px);
        opacity: 0.7;
    }
    to {
        filter: blur(20px);
        opacity: 0.9;
    }
}

.premium-gradient-text::after {
    content: attr(data-text);
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: -2;
    color: rgba(0, 0, 0, 0.2);
    filter: blur(3px);
}

/* Image hover zoom effect */
.group:hover img {
    transform: scale(1.1);
}

/* Smooth transitions for all interactive elements */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Custom shadow effects */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Pulse animation for stats */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Enhanced FAQ animations */
.faq-toggle {
    transition: all 0.3s ease;
}

.faq-toggle:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.faq-toggle.active {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Testimonial card hover effects */
.testimonial-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timeline connection styles */
.timeline-dot {
    position: relative;
    z-index: 10;
}

.timeline-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #f97316);
    transform: translateY(-50%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding-top: 80px;
    }
    
    /* Hide floating elements on mobile for performance */
    .animate-float,
    .animate-float-delayed {
        display: none !important;
    }
    
    /* Prevent horizontal scroll on mobile */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* Ensure all sections don't overflow */
    section {
        overflow-x: hidden !important;
    }
    
    /* Disable AOS animations that might cause overflow */
    [data-aos] {
        transform: none !important;
        opacity: 1 !important;
    }
    
    /* Disable hover scale effects on mobile */
    .hover\:scale-105:hover,
    .hover\:scale-110:hover,
    .group:hover .group-hover\:scale-105 {
        transform: none !important;
    }
    
    /* Ensure floating buttons don't cause overflow */
    .fixed.bottom-6 {
        right: 1rem !important;
        bottom: 1rem !important;
    }
    
    /* Reset transform animations except for navigation elements */
    *:not(#sidebar):not([class*="translate"]) {
        -webkit-transform: none !important;
        -ms-transform: none !important;
        transform: none !important;
    }
}