/* ============================================================
   Trust India Finserv — Pro-Max Animation Additions
   Cursor glow, Toast, Page loader, Shimmer, Glassmorphism,
   Particle dots, Gradient borders, Premium micro-interactions
============================================================ */

/* ── Custom Cursor Glow ──────────────────────────────────── */
#cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(217,154,0,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: opacity 0.3s;
}

/* ── Toast Notifications ─────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 99998;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}
.toast-success {
    background: rgba(34, 197, 94, 0.95);
    color: #fff;
}
.toast-error {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
}

/* ── Glassmorphism Card Variant ──────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ── Gradient Border Hover ───────────────────────────────── */
.gradient-border {
    position: relative;
    border-radius: var(--radius-md);
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--gold), var(--navy), var(--gold));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gradient-border:hover::before { opacity: 1; }

/* ── Shimmer Skeleton Loading ────────────────────────────── */
.shimmer {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Decorative Dot Pattern ──────────────────────────────── */
.dot-pattern {
    position: relative;
}
.dot-pattern::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 200px; height: 200px;
    background-image: radial-gradient(circle, rgba(217,154,0,0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
}

/* ── Section Divider Wave ────────────────────────────────── */
.wave-divider {
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    line-height: 0;
}
.wave-divider svg { display: block; width: 100%; }

/* ── Glow Button Effect ──────────────────────────────────── */
.btn-gold {
    position: relative;
    overflow: hidden;
}
.btn-gold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
}
.btn-gold::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    transform: scale(0);
}
.btn-gold:hover::before {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s, transform 0.6s ease;
}

/* ── Morphing Background Shapes ──────────────────────────── */
.morph-bg {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes morph {
    0%  { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    33% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    66% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
    100%{ border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

/* ── Floating Particle Dots ──────────────────────────────── */
.particle {
    position: absolute;
    border-radius: 50%;
    animation: floatParticle linear infinite;
    pointer-events: none;
    opacity: 0.4;
}
@keyframes floatParticle {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 0.4; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* ── Premium Input Focus Effect ──────────────────────────── */
.form-control:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(0,42,102,0.08), 0 0 0 6px rgba(217,154,0,0.05);
    transform: translateY(-1px);
}

/* ── Animated Gold Underline for Headings ────────────────── */
.gold-underline {
    position: relative;
    display: inline-block;
}
.gold-underline::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0%; height: 3px;
    background: var(--gold);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.gold-underline:hover::after,
.gold-underline.animated::after { width: 100%; }

/* ── Hero Typewriter Cursor ──────────────────────────────── */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--gold);
    margin-left: 4px;
    vertical-align: middle;
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Card Tilt Effect CSS prep ───────────────────────────── */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.1s ease;
}
.tilt-card-inner {
    transform-style: preserve-3d;
}

/* ── Number Badge Pulse ──────────────────────────────────── */
.stat-number {
    position: relative;
}
.stat-number::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(217,154,0,0.15);
    animation: pulseBorder 2s ease-in-out infinite;
    pointer-events: none;
    opacity: 0;
}
.stat-item:hover .stat-number::before { opacity: 1; }
@keyframes pulseBorder {
    0%   { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ── Reveal Line Animation ───────────────────────────────── */
.reveal-line {
    overflow: hidden;
}
.reveal-line > * {
    display: block;
    transform: translateY(100%);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-line.animated > * {
    transform: translateY(0);
}

/* ── Scroll Progress Bar ─────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
}

/* ── Premium Accordion ───────────────────────────────────── */
.faq-item {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}
.faq-item:hover { border-color: rgba(217,154,0,0.4); }
.faq-item.open { border-color: var(--gold); box-shadow: 0 4px 20px rgba(217,154,0,0.1); }
.faq-q {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark-blue);
    gap: 16px;
    user-select: none;
}
.faq-q .faq-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(217,154,0,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.faq-item.open .faq-icon {
    background: var(--gold);
    color: var(--white);
    transform: rotate(45deg);
}
.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.65;
}
.faq-a-inner { padding: 0 24px 20px; }
.faq-item.open .faq-a { max-height: 400px; }

/* ── Loan Detail Section Tabs Indicator ──────────────────── */
.loan-tabs-nav {
    position: relative;
}
.tab-indicator {
    position: absolute;
    bottom: 6px;
    height: calc(100% - 12px);
    background: var(--navy);
    border-radius: var(--radius-sm);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

/* ── Image with Gold Frame ───────────────────────────────── */
.gold-frame {
    position: relative;
    display: inline-block;
    border-radius: var(--radius-xl);
    overflow: visible;
}
.gold-frame::before {
    content: '';
    position: absolute;
    top: 16px; left: 16px; right: -16px; bottom: -16px;
    background: linear-gradient(135deg, var(--gold), var(--navy));
    border-radius: var(--radius-xl);
    z-index: -1;
    opacity: 0.25;
}
.gold-frame img {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ── Scroll-triggered Counter Highlight ──────────────────── */
@keyframes countHighlight {
    0%   { color: var(--gold); transform: scale(1.1); }
    100% { color: var(--navy); transform: scale(1); }
}
.count-done { animation: countHighlight 0.5s ease forwards; }

/* ── Social Proof Ticker ─────────────────────────────────── */
.ticker-wrap {
    overflow: hidden;
    background: linear-gradient(90deg, #B8860B 0%, #D4AF37 50%, #B8860B 100%);
    padding: 11px 0;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), inset 0 -2px 4px rgba(0,0,0,0.15);
}
.ticker-track {
    display: flex;
    gap: 60px;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-item {
    font-size: 0.84rem;
    font-weight: 800;
    color: #001F4D;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}
.ticker-item::before {
    content: '✦';
    color: #FFFFFF;
    font-size: 0.75rem;
    text-shadow: 0 0 6px rgba(255,255,255,0.8);
}

/* ── Interactive Material Ripple Effect ──────────────────── */
.ripple-container {
    position: relative;
    overflow: hidden;
}
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s cubic-bezier(0.2, 0.8, 0.4, 1);
    pointer-events: none;
    z-index: 10;
}
@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── Card Spotlight Hover Light ──────────────────────────── */
.pro-card-3d, .loan-card, .loan-split-card, .quick-card, .bank-card, .testimonial-card {
    position: relative;
    --mouse-x: 50%;
    --mouse-y: 50%;
}
.pro-card-3d::after, .loan-card::after, .loan-split-card::after, .quick-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(380px circle at var(--mouse-x) var(--mouse-y), rgba(212, 175, 55, 0.12), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}
.pro-card-3d:hover::after, .loan-card:hover::after, .loan-split-card:hover::after, .quick-card:hover::after {
    opacity: 1;
}

/* ── Interactive EMI Breakdown Visual Bar ────────────────── */
.calc-breakdown-box {
    margin-top: 18px;
    padding: 14px 18px;
    background: rgba(0, 42, 102, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(0, 42, 102, 0.08);
}
.calc-breakdown-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.calc-breakdown-bar {
    height: 10px;
    border-radius: 9999px;
    background: #E2E8F0;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.calc-bar-principal {
    background: linear-gradient(90deg, #001F4D, #002A66);
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.calc-bar-interest {
    background: linear-gradient(90deg, #B8860B, #D4AF37);
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.calc-breakdown-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-top: 8px;
    color: #475569;
    font-weight: 600;
}
.calc-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.dot-principal { background: #002A66; }
.dot-interest { background: #D4AF37; }

/* ── Confetti Canvas Overlay ─────────────────────────────── */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999999;
}
