*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a202c;
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(circle at 20% 30%, #ffffff 0%, #f7fafc 25%, #edf2f7 60%, #e2e8f0 100%);
}

/* Enhanced animated gradient overlay */
.background-gradient {
    position: fixed;
    inset: -50%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08), transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.06), transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(147, 197, 253, 0.05), transparent 60%),
        radial-gradient(circle at 80% 90%, rgba(96, 165, 250, 0.07), transparent 50%),
        linear-gradient(135deg, #f0f9ff 0%, #ffffff 30%, #fafafa 60%, #eff6ff 100%);
    z-index: -2;
    animation: floatGradient 25s ease-in-out infinite alternate;
}

@keyframes floatGradient {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
    100% {
        transform: translate3d(-40px, 30px, 0) scale(1.08) rotate(5deg);
    }
}

/* Floating particles animation */
.particles {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
    animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 15%;
    animation-delay: 0s;
    animation-duration: 22s;
}

.particle:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    left: 80%;
    animation-delay: 3s;
    animation-duration: 28s;
}

.particle:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 70%;
    animation-delay: 7s;
    animation-duration: 25s;
}

.particle:nth-child(4) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 10s;
    animation-duration: 20s;
}

.particle:nth-child(5) {
    width: 90px;
    height: 90px;
    top: 50%;
    left: 50%;
    animation-delay: 5s;
    animation-duration: 24s;
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate3d(100px, -100px, 0) scale(1.3);
        opacity: 0.6;
    }
}

/* Navbar styling */
.navbar {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.logo-brand {
    background: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: transform 0.3s ease;
}

.logo-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    color: #4b5563 !important;
    font-weight: 500;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active-section-link {
    color: #2563eb !important;
    background-color: rgba(59, 130, 246, 0.08);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 999px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.lang-switcher {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.lang-btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn.active {
    color: #fff !important;
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    border-color: transparent !important;
    transform: scale(1.02);
}

/* Glass card with enhanced effects */
.glass-card {
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    background-color: rgba(255, 255, 255, 0.88);
    border-radius: 24px;
    border: 1px solid rgba(209, 213, 219, 0.6);
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    position: relative;
    overflow: hidden;
    animation: cardFadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: center bottom;
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0.96);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.glass-card:hover::before {
    left: 100%;
}

.page-section.active-section .glass-card {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

@keyframes cardFadeUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* Hero card special styling */
.hero-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.85) 100%);
}

/* Centered logos grid */
.logos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

.brand-logo-card {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.brand-logo-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 25px 60px rgba(15, 23, 42, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.2) inset;
}

.brand-logo-card img {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.brand-logo-card:hover img {
    transform: scale(1.1);
}

.upay-logo {
    max-height: 50px !important;
}

/* Calculator logo */
.calculator-logo {
    max-height: 80px;
    transition: transform 0.4s ease;
    animation: logoFloat 3s ease-in-out infinite;
}

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

/* Feature boxes */
.feature-box {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s ease;
}

.feature-box:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: block;
    margin-bottom: 8px;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
}

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

/* Result box with glow effect */
.result-box {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.06));
    border: 2px solid rgba(134, 239, 172, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.result-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #10b981, #34d399, #6ee7b7, #34d399, #10b981);
    background-size: 300% 300%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    animation: borderGlow 3s ease infinite;
    transition: opacity 0.4s ease;
}

.result-box:hover::before {
    opacity: 0.6;
}

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

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.3s ease;
    animation: resultPulse 2s ease-in-out infinite;
}

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

/* Custom form controls */
.custom-input,
.custom-select {
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    padding: 14px 20px;
    height: auto;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(255, 255, 255, 0.9);
}

.custom-input:focus,
.custom-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    background-color: #ffffff;
}

/* Enhanced buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    border-radius: 14px;
    padding: 14px 32px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Pulse button animation */
.pulse-btn {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
}

/* Page transitions */
.page-section {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-section.d-none {
    opacity: 0;
    transform: translateY(20px);
}

.page-section.active-section {
    opacity: 1;
    transform: translateY(0);
}

.calculator-card {
    animation-delay: 0.1s;
}

/* Footer styling */
.footer-section {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
    margin-top: 60px;
}

/* Social media icons */
.social-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    .social-links {
        justify-content: flex-end;
    }
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.3rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.social-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: all 0.4s ease;
}

.social-icon:hover {
    transform: translateY(-4px) scale(1.1);
}

.social-icon.facebook {
    background: linear-gradient(135deg, rgba(59, 89, 152, 0.1), rgba(59, 89, 152, 0.05));
    color: #3b5998;
}

.social-icon.facebook::before {
    background: linear-gradient(135deg, #3b5998, #8b9dc3);
}

.social-icon.facebook:hover {
    background: linear-gradient(135deg, #3b5998, #4c66a8);
    color: white;
    box-shadow: 0 8px 25px rgba(59, 89, 152, 0.4);
}

.social-icon.github {
    background: linear-gradient(135deg, rgba(51, 51, 51, 0.1), rgba(51, 51, 51, 0.05));
    color: #333;
}

.social-icon.github::before {
    background: linear-gradient(135deg, #333, #666);
}

.social-icon.github:hover {
    background: linear-gradient(135deg, #333, #444);
    color: white;
    box-shadow: 0 8px 25px rgba(51, 51, 51, 0.4);
}

.social-icon.linkedin {
    background: linear-gradient(135deg, rgba(0, 119, 181, 0.1), rgba(0, 119, 181, 0.05));
    color: #0077b5;
}

.social-icon.linkedin::before {
    background: linear-gradient(135deg, #0077b5, #00a0dc);
}

.social-icon.linkedin:hover {
    background: linear-gradient(135deg, #0077b5, #0088cc);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 119, 181, 0.4);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .navbar {
        border-radius: 0 0 16px 16px;
    }
    
    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }
}

@media (max-width: 767.98px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .logos-grid {
        gap: 15px;
    }
    
    .brand-logo-card {
        padding: 15px;
        min-height: 80px;
    }
    
    .brand-logo-card img {
        max-height: 50px;
    }
}

@media (max-width: 575.98px) {
    .display-4 {
        font-size: 1.75rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .glass-card {
        border-radius: 18px;
        padding: 1.5rem !important;
    }
    
    .calculator-logo {
        max-height: 60px;
    }
    
    .feature-icon {
        font-size: 1.5rem;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

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

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}
