/* =========================================
   LIC Calculator - Complete Stylesheet
   (Version 4: Ultra Compact Header & Fixed Dropdowns)
   ========================================= */

* {
    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: sticky;
    top: 0;
    z-index: 1000;
}

.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; 
}

.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: 11px; color: #aaa; }

/* =========================================
   6. MOBILE RESPONSIVENESS (ULTRA COMPACT HEADER)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Full Width Containers */
    .container {
        padding: 0 5px; 
    }

    /* 2. Header Adjustments */
    .header {
        padding: 0; 
    }

    .header-content { 
        flex-direction: column; 
        gap: 0;            /* Zero gap */
        padding: 2px 0;    /* Extremely minimal padding */
        text-align: center; 
    }
    
    .logo-section {
        margin-bottom: 2px;
    }

    .logo-section h1 {
        font-size: 16px;   /* Small Logo */
        margin: 0;
        line-height: 1;
    }
    
    .logo-section .tagline {
        display: none;     /* Hide tagline completely */
    }

    .nav { 
        width: 100%; 
        justify-content: center; 
        gap: 3px;          /* Minimal gap */
        flex-wrap: wrap;   /* Wrap if needed */
        margin-top: 0;
        /* REMOVED overflow-x: auto to fix dropdown clipping */
    }
    
    .nav-link { 
        font-size: 10px;   /* Tiny font */
        padding: 4px 6px;  /* Minimal touch target */
        background: #f4f6f8; 
        border-radius: 3px;
        line-height: 1;
        display: flex;
        align-items: center;
        height: 24px;      /* Fixed small height */
    }

    /* 3. Mobile Menu Dropdown Fixes */
    .dropdown-content { 
        position: absolute; 
        width: 180px;       /* Adjusted width */
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
        border: 1px solid #ccc; 
        margin-top: 2px; 
        z-index: 10000;     /* Extremely high Z-index */
        background: white;  /* Ensure background is white */
        display: none;      /* Hidden by default */
    }
    
    /* Ensure Active Class Shows Dropdown */
    .dropdown.active .dropdown-content {
        display: block !important;
    }

    /* 4. Calculator Grid & Cards Compact */
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 5px; 
    }
    .calculator-card { padding: 8px 4px; }
    .calculator-card .card-icon { width: 35px; height: 35px; font-size: 18px; margin-bottom: 4px; }
    .calculator-card h3 { font-size: 10px; height: 24px; margin-bottom: 2px; }
    .calculator-card small { font-size: 8px; padding: 2px 5px; }

    /* 5. Compact Form Layout */
    .card { padding: 10px; margin-bottom: 10px; }
    .calculator-header { padding: 8px; margin-bottom: 8px; }
    .calculator-header h1 { font-size: 16px; margin-bottom: 2px; }
    .calculator-header .description { font-size: 10px; }
    .calculator-header .header-icon { width: 30px; height: 30px; font-size: 16px; }
    
    .form-group { margin-bottom: 8px; }
    .form-label { font-size: 11px; margin-bottom: 2px; }
    .form-input, .form-select { padding: 6px; font-size: 12px; }
    .btn { padding: 8px; font-size: 12px; }
    
    .hero-section { padding: 15px 0; }
    .hero-section h2 { font-size: 18px; margin-bottom: 5px; }
    .hero-section p { display: none; } /* Hide hero text */
}