/* Jain Home Loans - Custom Styles */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Scroll Effect - Glassmorphism */
.header-scrolled {
    background-color: rgba(7, 31, 34, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

#mobile-menu.open {
    max-height: 85vh;
}

/* Mega Menu Animations */
.mega-menu-enter {
    transform: scale(0.97) translateY(-4px);
    transform-origin: top center;
    transition: all 0.2s ease-out;
}

.group:hover .mega-menu-enter {
    transform: scale(1) translateY(0);
}

.mega-menu-item {
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}

.mega-menu-item:hover {
    border-left-color: #ED6915;
}

/* Hero Background Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-animated {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #ED6915 0%, #FF8F21 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF8F21 0%, #ED6915 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(237, 105, 21, 0.4);
}

/* FAQ Accordion */
.faq-toggle {
    cursor: pointer;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-toggle.active .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-content.open {
    max-height: 500px;
}

/* Timeline */
.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #ED6915, #FF8F21);
}

/* Form Focus States */
input:focus,
select:focus,
textarea:focus {
    border-color: #ED6915;
    box-shadow: 0 0 0 3px rgba(237, 105, 21, 0.1);
    outline: none;
}

/* Checkbox Styling */
input[type="checkbox"]:checked {
    background-color: #ED6915;
    border-color: #ED6915;
}

/* Floating CTA Animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.floating-cta {
    animation: slideUp 0.5s ease-out;
}

/* Scroll Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loader Spinner */
.spinner {
    border: 3px solid rgba(237, 105, 21, 0.3);
    border-radius: 50%;
    border-top: 3px solid #ED6915;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .hero-content {
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Adjust spacing for mobile floating CTA */
    main {
        padding-bottom: 80px;
    }

    /* Smaller fonts on mobile */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Selection Color */
::selection {
    background-color: #ED6915;
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #ED6915;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF8F21;
}

/* Print Styles */
@media print {
    header,
    .floating-cta,
    #mobile-menu {
        display: none !important;
    }

    main {
        padding-top: 0 !important;
    }
}

/* Accessibility - Focus Visible */
:focus-visible {
    outline: 2px solid #ED6915;
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ED6915;
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Pulse Animation for CTAs */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(237, 105, 21, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(237, 105, 21, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 5-Step Process Hover Animations */
.step-icon {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card {
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.step-container:hover .step-icon {
    transform: translateY(-8px) scale(1.05);
}

.step-container:hover .step-card {
    transform: translateY(-4px);
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Mobile Step Hover */
.mobile-step {
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-step:hover {
    transform: translateX(8px);
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #ED6915 0%, #FF8F21 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image Lazy Load Placeholder */
.img-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #071F22;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #10B981;
}

.toast.error {
    background: #EF4444;
}

/* Hero Testimonial Rotation */
.testimonial-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.testimonial-slide.active {
    display: block;
    opacity: 1;
}

.testimonial-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonial-dot.active {
    background-color: #ED6915;
    transform: scale(1.2);
}

/* Testimonial Card - Always Pulsing Border */
.testimonial-card {
    position: relative;
    animation: always-pulse 2.5s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Hover effect - lift up like other sections */
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(237, 105, 21, 0.25);
    border-color: rgba(237, 105, 21, 0.7);
    animation-play-state: paused;
}

@keyframes always-pulse {
    0%, 100% {
        border-color: rgba(237, 105, 21, 0.3);
        box-shadow: 0 0 0 0 rgba(237, 105, 21, 0);
    }
    50% {
        border-color: rgba(237, 105, 21, 0.6);
        box-shadow: 0 0 12px 2px rgba(237, 105, 21, 0.2);
    }
}

/* Stronger effect on review change */
.testimonial-card.changing {
    animation: change-flash 0.6s ease-out;
}

@keyframes change-flash {
    0% {
        border-color: rgba(237, 105, 21, 1);
        box-shadow: 0 0 20px 4px rgba(237, 105, 21, 0.5);
        transform: scale(1.01);
    }
    100% {
        border-color: rgba(237, 105, 21, 0.3);
        box-shadow: 0 0 0 0 rgba(237, 105, 21, 0);
        transform: scale(1);
    }
}

/* Blog Card Hover Lift */
.blog-card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #ED6915, #FF8F21);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Table of Contents */
.toc-container {
    margin-top: 2rem;
    margin-bottom: 0;
    padding: 1.5rem;
    background: #F9FAFB;
    border-radius: 1rem;
    border-left: 4px solid #ED6915;
}

.toc-container .toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toc-container .toc-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #071F22;
    margin: 0;
}

.toc-container .toc-toggle {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    border: 1px solid #E5E7EB;
    transition: transform 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.toc-container .toc-toggle.collapsed {
    transform: rotate(180deg);
}

.toc-container .toc-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
}

.toc-container .toc-list.hidden {
    display: none;
}

.toc-container .toc-list li {
    margin: 0;
    padding: 0;
}

.toc-container .toc-list a {
    display: block;
    padding: 0.4rem 0 0.4rem 1rem;
    font-size: 0.875rem;
    color: #6B7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.toc-container .toc-list a:hover {
    color: #ED6915;
    border-left-color: #ED6915;
}

.toc-container .toc-list a.active {
    color: #ED6915;
    border-left-color: #ED6915;
    font-weight: 500;
}
