:root {
    --primary-color: #0d253f;
    /* Deep Navy Blue */
    --secondary-color: #cda45e;
    /* Gold Accent */
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --dark-overlay: rgba(13, 37, 63, 0.9);
    --transition: all 0.3s ease;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent Horizontal Scroll */
body,
html {
    overflow-x: hidden;
    width: 100%;
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    /* Prevent font scaling in landscape/desktop mode */
    font-size: 0.95rem;
    /* Match header font size preference */
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Increased min-width to force wrap earlier */
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 15px;
    /* Increased spacing */
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
}

/* Fix text overflow in footer */
.footer-col {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.footer-col a {
    word-break: break-word;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 900px) {

    /* Increased breakpoint */
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .section-padding {
        padding: 60px 0;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        padding: 40px 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        margin: 10px 0;
    }

    .hero {
        height: auto;
        min-height: 80vh;
        padding: 80px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    .hero-btns {
        flex-direction: column;
        gap: 15px;
        padding: 0 20px;
    }

    .hero-btn-primary,
    .hero-btn-secondary {
        width: 100%;
        padding: 12px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        display: flex;
        /* Changed from grid to flex column for better mobile stack */
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .footer-col {
        width: 100%;
    }

    .footer-col ul li {
        display: block;
        /* Ensure list items stack */
        margin: 10px 0;
    }

    .footer-col i {
        display: inline-block;
        /* Inline icon for centered text */
        margin-right: 5px;
    }

    .footer-col li {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--secondary-color);
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: var(--secondary-color);
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.form-grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-span-2 {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-span-2 {
        grid-column: span 1 !important;
    }
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Header Dropdown */
.nav-links li.dropdown {
    position: relative;
    padding-bottom: 25px;
    margin-bottom: -25px;
}

.nav-links li.dropdown > a i {
    font-size: 0.7rem;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.nav-links li.dropdown:hover > a i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 55px; /* Aligned with navbar height */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 220px;
    background: var(--white);
    box-shadow: 0 10px 40px rgba(13, 37, 63, 0.15);
    border-radius: 12px;
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.05);
}

.nav-links li.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    margin: 0 !important;
    width: 100%;
}

.dropdown-menu li a {
    display: block !important;
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    color: var(--text-color) !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-radius: 0 !important;
}

.dropdown-menu li a:hover {
    background: #f8fafc !important;
    color: var(--secondary-color) !important;
    padding-left: 25px !important;
}

.dropdown-menu li a::after {
    display: none !important;
}

@media (max-width: 1024px) {
    .nav-links li.dropdown {
        padding-bottom: 0;
        margin-bottom: 0;
    }
    .dropdown-menu {
        position: static;
        width: 100%;
        transform: none !important;
        box-shadow: none;
        opacity: 1 !important;
        visibility: visible !important;
        display: none;
        border: none;
        background: #f1f5f9;
        margin-top: 10px;
        border-radius: 8px;
    }
    .nav-links li.dropdown.active .dropdown-menu {
        display: block !important;
    }
    .nav-links li.dropdown:hover .dropdown-menu {
        transform: none !important;
    }
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(var(--dark-overlay), var(--dark-overlay)), url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-title {
    font-size: 3.5rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 20px auto 40px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.hero-btn-primary {
    background: var(--secondary-color);
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
}

.hero-btn-secondary {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
}

.hero-btn-secondary:hover {
    background: var(--secondary-color);
    color: white;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

.dash-sidebar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.dash-menu a {
    display: block;
    padding: 10px;
    color: var(--text-color);
    border-radius: 5px;
    margin-bottom: 5px;
}

.dash-menu a:hover,
.dash-menu a.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
    font-weight: 500;
}

.dash-content {
    min-height: 500px;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .section-padding {
        padding: 40px 0;
    }

    /* Navigation */
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        height: auto;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        margin: 5px 0;
    }

    .nav-links li a {
        display: block;
        padding: 10px;
    }

    /* Hero */
    .hero {
        height: auto;
        min-height: auto;
        padding: 60px 0;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0;
        margin-bottom: 25px;
    }

    .hero-btns {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    .hero-btn-primary,
    .hero-btn-secondary {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* General Grids */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Dashboard Layout Fixes */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .dash-sidebar {
        width: 100%;
        margin-bottom: 20px;
        padding: 15px;
    }

    .dash-menu {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 5px;
        /* Scrollbar space */
    }

    .dash-menu a {
        white-space: nowrap;
        padding: 8px 15px;
        font-size: 0.9rem;
        margin-bottom: 0;
        border: 1px solid #eee;
    }

    .dash-content {
        min-height: auto;
        width: 100%;
        overflow-x: hidden;
        /* Prevent content overflow */
    }

    /* Tables Responsive */
    table {
        display: block;
        overflow-x: auto;
        width: 100%;
        font-size: 0.85rem;
    }

    /* Footer */
    .footer-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
        text-align: left;
    }

    .footer-col {
        width: auto;
    }

    .footer-col h3 {
        font-size: 1.1rem;
    }

    .footer-col ul li {
        margin-bottom: 8px;
        font-size: 0.9rem;
    }

    /* --- New Mobile Optimizations --- */

    /* Page Headers */
    .page-header {
        padding: 40px 0 !important;
    }

    .page-header h1 {
        font-size: 1.8rem !important;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    /* Cards */
    .feature-card,
    .calculator-box,
    .contact-form {
        padding: 20px !important;
    }

    .feature-card h3 {
        font-size: 1.25rem;
    }

    /* Calculator Specific */
    #emi-amount {
        font-size: 1.8rem !important;
    }

    .calc-results h3 {
        font-size: 1.2rem;
    }

    /* Contact Info */
    .contact-info h2 {
        font-size: 1.5rem !important;
    }

    .contact-info h4 {
        font-size: 1rem !important;
    }
}