/* JaldiMoney V2 — Main Stylesheet */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d6d3d1;
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a29e;
}
.dark ::-webkit-scrollbar-thumb {
    background: #1e2d8f;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #2a3cb8;
}

/* Glass Morphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.dark .glass {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(30, 45, 143, 0.3);
}

/* Card Hover Lift */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
}
.dark .card-hover:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #10b981, #3b50e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Mesh Gradient */
.mesh-gradient {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 80, 224, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

/* Credit Score Gauge */
.gauge-circle {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Range Slider Custom */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 100px;
    background: #e7e5e4;
    outline: none;
}
.dark input[type="range"] {
    background: #1e2d8f;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    border: 3px solid white;
    transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    border: 3px solid white;
}

/* Comparison checkbox */
.compare-check {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d6d3d1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.compare-check:checked {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}
.compare-check:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Scroll-triggered visibility */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Trust logo marquee */
.marquee-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}
.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 30s linear infinite;
    width: max-content;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Pulse glow for CTAs */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

/* Skeleton shimmer */
.skeleton {
    background: linear-gradient(90deg, #f5f5f4 25%, #e7e5e4 50%, #f5f5f4 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.dark .skeleton {
    background: linear-gradient(90deg, #141e66 25%, #1e2d8f 50%, #141e66 75%);
    background-size: 200% 100%;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Number formatting for Indian locale */
.rupee::before {
    content: '\20B9';
}

/* Toast styles */
.toast {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-success {
    background: #10b981;
    color: white;
}
.toast-error {
    background: #ef4444;
    color: white;
}
.toast-info {
    background: #3b50e0;
    color: white;
}
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Tab active state */
.tab-active {
    color: #10b981;
    border-bottom-color: #10b981;
}

/* Floating comparison bar */
.comparison-bar {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.comparison-bar.active {
    transform: translateY(0);
}

/* Product card applied today pulse */
.applied-pulse {
    animation: appliedPulse 3s ease-in-out infinite;
}
@keyframes appliedPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Confetti animation for offers */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Hide scrollbar for horizontal scroll containers */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ═══ RESPONSIVE UTILITIES ═══ */

/* Prevent horizontal overflow globally */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all tables in dashboard containers are scrollable */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent content overflow on mobile */
@media (max-width: 639px) {
    /* Tighter padding on very small screens */
    .mobile-compact {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Stack flex items on mobile */
    .mobile-stack {
        flex-direction: column;
        align-items: stretch;
    }

    /* Full-width inputs on mobile */
    .mobile-full {
        width: 100%;
    }

    /* Reduce card hover lift on touch devices */
    .card-hover:hover {
        transform: none;
    }

    /* Larger range slider thumb for touch */
    input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }
    input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }

    /* Remove stagger delays on mobile — reveal all items together */
    .stagger-1, .stagger-2, .stagger-3,
    .stagger-4, .stagger-5, .stagger-6 {
        transition-delay: 0s !important;
    }

    /* Faster reveal animation on mobile */
    .scroll-reveal {
        transition-duration: 0.3s;
    }

    /* Make toast notifications fit mobile */
    #toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .toast {
        width: 100%;
    }

    /* Back-to-top handled by Tailwind responsive classes in base.html */
}

/* Tablet adjustments */
@media (min-width: 640px) and (max-width: 1023px) {
    /* Slightly reduce card hover lift */
    .card-hover:hover {
        transform: translateY(-2px);
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .fixed.bottom-6 {
        padding-bottom: env(safe-area-inset-bottom);
    }
    footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Improve touch targets on mobile */
@media (pointer: coarse) {
    button, a, input, select, textarea {
        min-height: 44px;
    }
    /* Sidebar nav links need larger touch targets */
    nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}
