/* CSS Reset and Variables */
:root {
    --primary: #2A3950;
    --secondary: #FF6B6B;
    --light: #F7F9FC;
    --dark: #1A2332;
    --success: #4CAF50;
    --danger: #FF6B6B;
    --warning: #FFC107;
    --info: #2196F3;
    --purple: #9C27B0;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #2A3950 0%, #1A2332 100%);
}

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

/* Body and Typography */
body {
    background: var(--light);
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: white;
    padding: 0.2rem 0;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    z-index: 1030;
    min-height: 40px;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: 55px;
        left: 0;
        right: 0;
        background: white;
        padding: 0.75rem;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
        max-height: calc(100vh - 55px);
        overflow-y: auto;
        transition: all 0.3s ease;
        transform: translateY(-100%);
        opacity: 0;
    }

    .navbar-collapse.show {
        transform: translateY(0);
        opacity: 1;
    }

    .dropdown-menu.dropdown-grid {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        padding: 0;
    }

    .dropdown-menu.dropdown-grid .dropdown-item {
        padding: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}

.navbar.scrolled {
    padding: 1rem 0;
}

body {
    padding-top: 40px;
}

.navbar-brand {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

.navbar-brand i {
    font-size: 1.1rem;
}

.nav-link {
    color: var(--dark) !important;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    line-height: 1.2;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.dropdown-menu {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 10px;
    width: 420px;
    background: white;
}

.dropdown-item {
    color: var(--dark);
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 6px;
    display: grid;
    grid-template-rows: auto 1fr;
    place-items: center;
    height: 70px;
    transition: all 0.3s ease;
}

.dropdown-item i {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 8px;
}

.dropdown-item span {
    font-size: 12px;
    line-height: 1.2;
    max-width: 100%;
    padding: 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Specific styles for calculator items */
.nav-item:nth-child(2) .dropdown-item {
    height: 90px;
}

.nav-item:nth-child(2) .dropdown-item span {
    font-size: 11px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

@media (max-width: 576px) {
    .dropdown-menu.dropdown-grid {
        width: 100%;
        grid-template-columns: 1fr;
    }
}

.dropdown-item:hover {
    background: var(--light);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dropdown-item:hover i {
    transform: scale(1.1);
    color: var(--primary);
}

.dropdown-item:hover span {
    color: var(--primary);
}

.dropdown-item.active {
    background: var(--light);
    border-color: var(--primary);
}

.dropdown-item.active i,
.dropdown-item.active span {
    color: var(--primary);
}

/* Adjust spacing for specific calculator names */
.nav-item:nth-child(2) .dropdown-item[href*="homeloan"] span,
.nav-item:nth-child(2) .dropdown-item[href*="lumpsum"] span {
    letter-spacing: -0.3px;
    font-size: 10.5px;
}

/* Search Form */
.search-form {
    position: relative;
}

.search-form .form-control {
    background: var(--light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--dark);
    width: 180px;
    height: 28px;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.search-form .form-control:focus {
    box-shadow: 0 0 0 4px rgba(42, 57, 80, 0.1);
    border-color: var(--primary);
}

.search-form .form-control::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.search-form .btn {
    border: none;
    padding: 0.25rem 0.75rem;
    color: var(--primary);
    position: absolute;
    right: 0;
    top: 0;
    background: transparent;
    height: 28px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    line-height: 1;
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-top: 0.5rem;
    display: none;
    z-index: 1000;
}

.search-results.show {
    display: block;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern.svg');
    background-size: cover;
    opacity: 0.1;
}

.hero-section h1 {
    font-size: 3.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.25rem;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 2rem;
}

.hero-stats {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats .stat-item {
    text-align: center;
}

.hero-stats h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.hero-stats p {
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
}

/* Tools Section */
.tools-section {
    background: linear-gradient(to bottom, var(--light), white);
    padding: 5rem 0;
}

.badge {
    font-size: 1rem;
    font-weight: 500;
}

.bg-primary-subtle {
    background-color: rgba(42, 57, 80, 0.1);
}

.bg-success-subtle {
    background-color: rgba(76, 175, 80, 0.1);
}

/* Tool Cards */
.tool-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.tool-card .card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--dark));
    opacity: 0;
    transition: all 0.3s ease;
}

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

.tool-card:hover::before {
    opacity: 0.95;
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.25rem 0;
    color: var(--dark);
    transition: all 0.3s ease;
}

.tool-card:hover h3 {
    color: white;
    transform: translateY(-10px);
}

.tool-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.5rem;
    font-size: 2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    background: var(--light);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.tool-card:hover .tool-icon i {
    color: white !important;
}

.card-hover {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.tool-card:hover .card-hover {
    transform: translateY(0);
    opacity: 1;
}

.btn-text {
    color: white;
    font-weight: 500;
    font-size: 1rem;
}

/* Mini Cards */
.mini-card {
    background: white;
    border-radius: 1.25rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.mini-card i {
    font-size: 2.25rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.mini-card:hover i {
    transform: scale(1.1);
}

.mini-card h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--dark);
}

/* Features Section */
.features-section {
    padding: 5rem 0 2rem;
}

.feature-card {
    background: white;
    border-radius: 1.25rem;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon i {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-card p {
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 0;
}

/* Section Headers */
.section-header {
    margin-bottom: 3.5rem;
    text-align: center;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* Footer */
.footer {
    background: var(--gradient);
    color: white;
    margin-top: 3rem;
    padding-top: 2rem;
}

.footer-brand h5 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer h5 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
}

.footer ul li a:hover {
    color: white;
    transform: translateX(5px);
}

.footer ul li a i {
    transition: all 0.3s ease;
}

.footer ul li a:hover i {
    transform: scale(1.2);
}

.social-links {
    margin-top: 2rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.social-links a:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-3px);
}

.contact-info {
    color: rgba(255, 255, 255, 0.7);
}

.contact-info i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    margin-right: 0.75rem;
    font-size: 0.85rem;
}

.contact-info .d-flex {
    transition: all 0.3s ease;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.contact-info .d-flex:hover {
    transform: translateX(3px);
}

.payment-methods i {
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin: 0 0.25rem;
}

.payment-methods i:hover {
    color: white;
    transform: translateY(-3px);
}

hr.bg-light {
    opacity: 0.1;
}

.bottom-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: var(--dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .search-form .form-control {
        width: 100%;
    }
    
    .search-results {
        width: 100%;
    }

    .dropdown-menu.dropdown-grid {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .tools-section {
        padding: 3rem 0;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .tool-card .card-body {
        padding: 1.5rem;
    }

    .tool-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .footer {
        text-align: center;
        padding-top: 1.5rem;
    }

    .footer-brand {
        margin-bottom: 1rem;
    }

    .social-links {
        display: flex;
        justify-content: center;
        gap: 0.75rem;
        margin: 1rem 0;
    }

    .contact-info .d-flex {
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .footer h5 {
        margin-top: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .payment-methods {
        margin-top: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .scroll-top-btn {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-stats .stat-item h3 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .dropdown-menu {
        padding: 1rem;
        min-width: auto;
    }
}