/* =========================================
   LIC Calculator - Complete Stylesheet
   (Version 4: Ultra Compact Header & Fixed Dropdowns)
   ========================================= */

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

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

:root {
    --primary-color: #0066cc;       /* LIC Blue */
    --primary-dark: #0052a3;
    --secondary-color: #f0f4f8;
    --success-color: #28a745;       /* Green */
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: #f5f7fa;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* =========================================
   1. HEADER & MENU
   ========================================= */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
}

/* Mobile Hamburger Menu Toggle Button (Three Lines) */
.mobile-menu-toggle {
    display: none;
    background: #f8fafc;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 8px 7px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 38px;
    height: 36px;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    background: #eef2f6;
    border-color: #0066cc;
    outline: none;
}

.mobile-menu-toggle .hamburger-bar {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: #0066cc;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-menu-toggle.active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo-section h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
}

.logo-section .tagline {
    font-size: 11px;
    color: var(--text-light);
    display: block;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 260px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    border-radius: 8px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
}

/* Desktop Hover */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* Mobile Active Class (Triggered by JS) */
.dropdown.active .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    border-bottom: 1px solid #f9f9f9;
}

.dropdown-content a:hover {
    background-color: #f0f7ff;
    color: var(--primary-color);
    padding-left: 25px;
}

.dropdown-content div {
    background-color: #f8f9fa;
    padding: 8px 20px !important;
    font-weight: 700 !important;
    color: #555 !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
}

/* =========================================
   2. CALCULATOR HEADER (Compact)
   ========================================= */
.calculator-header {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calculator-header .header-icon {
    font-size: 32px;
    margin-bottom: 8px;
    background: #f0f7ff;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--text-color);
}

.calculator-header .plan-code {
    font-size: 11px;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

.calculator-header .description {
    font-size: 12px;
    color: #777;
    max-width: 600px;
    line-height: 1.4;
}

/* =========================================
   3. GRID & CARDS (Home Page)
   ========================================= */
.main-content {
    min-height: 80vh;
    padding: 20px 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 30px;
}

.hero-section h2 { font-size: 28px; color: var(--primary-color); margin-bottom: 10px; }
.category-section { margin-bottom: 40px; }
.category-title { font-size: 20px; color: var(--primary-color); margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 8px; }

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px;
}

.calculator-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f3f5;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 102, 204, 0.12);
    border-color: var(--primary-color);
}

.calculator-card .card-icon {
    font-size: 30px;
    margin-bottom: 12px;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f7ff;
    color: var(--primary-color);
    border-radius: 50%;
}

.calculator-card h3 { font-size: 15px; font-weight: 700; color: #2c3e50; margin-bottom: 8px; }
.calculator-card p { font-size: 12px; color: #7f8c8d; margin-bottom: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.calculator-card small { font-size: 11px; font-weight: 600; color: var(--primary-color); background: #eef2f7; padding: 5px 12px; border-radius: 15px; margin-top: auto; }

/* =========================================
   4. CALCULATOR FORM & RESULTS
   ========================================= */
.calculator-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 900px) {
    .calculator-layout {
        grid-template-columns: 40% 60%;
    }
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    padding: 25px; 
}

/* Info Section & Calculator Featured Images */
.info-section .card {
    padding: 0;
    overflow: hidden;
}

.info-content {
    padding: 24px;
    line-height: 1.8;
}

.info-content img,
.info-section img,
.calculator-img {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.card-header {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.card-header h2 { font-size: 18px; color: var(--primary-color); margin: 0; font-weight: 600; }

.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: #444; }
.form-input, .form-select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: all 0.3s; }
.form-input:focus, .form-select:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1); }

.form-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.btn { padding: 12px; border: none; border-radius: 6px; font-weight: 600; font-size: 14px; width: 100%; cursor: pointer; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-secondary { background: #f1f3f5; color: #333; border: 1px solid #ddd; }

/* Results Design */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.result-item { background: white; padding: 15px; border-radius: 8px; border: 1px solid #eee; border-left: 4px solid var(--primary-color); box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.result-item.highlight { background: #f0fff4; border-left-color: var(--success-color); }
.result-label { font-size: 11px; text-transform: uppercase; color: #888; font-weight: 600; margin-bottom: 5px; }
.result-value { font-size: 18px; font-weight: 700; color: #2c3e50; }
.result-item.highlight .result-value { color: var(--success-color); font-size: 20px; }

.empty-state { padding: 40px; text-align: center; color: #aaa; font-size: 14px; }

/* =========================================
   5. FOOTER & RELATED
   ========================================= */
.related-section { padding: 40px 0; background: #f8f9fa; border-top: 1px solid #e9ecef; margin-top: 40px; }
.related-title { font-size: 20px; margin-bottom: 20px; padding-left: 15px; border-left: 4px solid var(--primary-color); font-weight: 600; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }

.footer { background: #333; color: white; padding: 30px 0; text-align: center; }
.footer p { margin-bottom: 8px; font-size: 13px; }
.footer-note { font-size: 12.5px; color: #f1f5f9; font-weight: 500; }

/* =========================================
   6. MOBILE RESPONSIVENESS (ACCESSIBLE & COMPACT)
   ========================================= */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 1. Full Width Containers - No Empty White Space on Left/Right */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
    }

    .main-content {
        padding: 10px 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* 2. Header Adjustments - Header Fix Nahi Karna (Normal Scrolling, Not Sticky) */
    .header {
        position: static !important;
        top: auto !important;
        padding: 8px 0; 
        width: 100% !important;
    }

    .header .container {
        padding: 0 10px !important;
    }

    .header-content { 
        display: flex;
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        flex-wrap: wrap;
        width: 100% !important;
    }
    
    .logo-section {
        margin-bottom: 0;
        text-align: left;
    }

    .logo-section h1,
    .logo-section div {
        font-size: 19px !important;
        margin: 0;
        line-height: 1.2;
    }
    
    .logo-section .tagline {
        display: none;     /* Hide tagline on mobile */
    }

    /* Mobile 3-line hamburger button */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile Nav Menu: Hidden by default, expands when user taps hamburger button */
    .nav { 
        display: none;
        width: 100% !important; 
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
        padding: 10px 0 4px 0;
        border-top: 1px solid #e5e7eb;
    }

    .nav.nav-open {
        display: flex !important;
        animation: navSlideDown 0.2s ease-out;
    }

    @keyframes navSlideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .nav-link { 
        font-size: 13.5px;
        padding: 10px 14px;
        background: #f8fafc; 
        border-radius: 6px;
        line-height: 1.2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 40px;
        font-weight: 500;
        width: 100% !important;
        box-sizing: border-box;
        touch-action: manipulation;
    }

    .dropdown {
        width: 100% !important;
    }

    .dropdown-btn {
        width: 100% !important;
        text-align: left;
    }

    /* 3. Mobile Menu Dropdown Fixes */
    .dropdown-content { 
        position: static !important; 
        width: 100% !important;
        transform: none !important;
        box-shadow: none; 
        border: 1px solid #e2e8f0; 
        border-radius: 6px;
        margin: 6px 0; 
        z-index: 100;
        background: white;
        display: none;
        padding: 6px 0;
        max-height: 320px;
        overflow-y: auto;
    }
    
    .dropdown-content a {
        padding: 10px 14px;
        font-size: 13px;
        line-height: 1.4;
        display: block;
        min-height: 38px;
        color: #374151;
        border-bottom: 1px solid #f1f5f9;
    }

    /* Ensure Active Class Shows Dropdown */
    .dropdown.active .dropdown-content {
        display: block !important;
    }

    /* 4. Calculator Grid & Cards Compact - Full Width */
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 6px !important;
        width: 100% !important;
    }

    .category-section {
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    .calculator-card { 
        padding: 12px 6px !important;
        border-radius: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calculator-card .card-icon { 
        width: 38px; 
        height: 38px; 
        font-size: 20px; 
        margin-bottom: 6px; 
    }

    .calculator-card h3 { 
        font-size: 12px; 
        min-height: 32px; 
        line-height: 1.3;
        margin-bottom: 4px; 
    }

    .calculator-card small { 
        font-size: 10.5px; 
        padding: 3px 6px; 
        border-radius: 4px;
    }

    /* 5. Full Width Form & Card Layout */
    .card { 
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px 10px !important; 
        margin-bottom: 10px !important; 
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }

    .calculator-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .calculator-header { 
        width: 100% !important;
        padding: 12px 10px !important; 
        margin-bottom: 10px !important; 
        box-sizing: border-box !important;
    }

    .calculator-header h1 { 
        font-size: 18px; 
        line-height: 1.3;
        margin-bottom: 6px; 
    }

    .calculator-header .description { 
        font-size: 12.5px; 
        line-height: 1.5;
    }

    .calculator-header .header-icon { 
        width: 36px; 
        height: 36px; 
        font-size: 20px; 
    }
    
    .form-group { 
        margin-bottom: 12px; 
        width: 100% !important;
    }

    .form-label { 
        font-size: 12.5px; 
        margin-bottom: 4px; 
        font-weight: 600;
        display: block;
    }

    .form-input, .form-select { 
        width: 100% !important;
        padding: 10px 11px !important; 
        font-size: 14px !important; 
        min-height: 42px !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
    }

    .form-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 14px !important;
    }

    .btn { 
        width: 100% !important;
        padding: 12px 14px !important; 
        font-size: 14px !important; 
        min-height: 44px !important;
        font-weight: 600 !important;
        box-sizing: border-box !important;
    }
    
    .hero-section { 
        padding: 18px 8px !important; 
        margin-bottom: 12px !important;
        border-radius: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-section h1, .hero-section h2 { 
        font-size: 19px !important; 
        margin-bottom: 6px !important; 
    }

    .hero-section p { 
        font-size: 12.5px !important; 
        display: block !important;
        color: #4b5563 !important;
        line-height: 1.5 !important;
    }

    /* 6. Mobile Images & Info Content - Full Width & Increased Prominent Height */
    .info-section {
        width: 100% !important;
    }

    .info-section .card {
        padding: 0 !important;
        border-radius: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .info-content {
        padding: 12px 8px !important;
        line-height: 1.7 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .info-content img,
    .info-section img,
    .calculator-img,
    .card img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        object-fit: cover !important;
        display: block !important;
        margin: 0 auto 16px auto !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        background-color: #f1f5f9;
    }

    .cta-section {
        padding: 16px 0 !important;
        width: 100% !important;
    }

    .cta-section .container {
        padding: 0 6px !important;
    }

    .footer {
        padding: 24px 0 16px 0 !important;
        width: 100% !important;
    }

    .footer .container {
        padding: 0 8px !important;
    }
}
