:root {
    --primary-green: #059669; /* Modern Pakistan Green */
    --primary-green-light: #10b981;
    --primary-green-dark: #047857;
    --light-green: #f0fdf4;
    --text-black: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --bg-color: #ffffff;
    --bg-gray: #f9fafb;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --gradient-primary: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* GLOBAL RESET */
* {
    box-sizing: border-box; /* Critical for mobile sizing */
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-black);
    background: var(--bg-gray);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CONTAINER */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}


/* HEADER */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    margin-bottom: 25px;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
    flex-shrink: 0; /* Ensures logo doesn't crush */
}
.logo span { color: var(--text-black); }

/* Desktop Navigation */
nav ul { list-style: none; display: flex; gap: 20px; }
nav a { text-decoration: none; color: var(--text-black); font-weight: 500; }
nav a:hover { color: var(--primary-green); }

/* --- SIDEBAR STYLING (NEW) --- */
.sidebar {
    height: 100%;
    width: 0; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* Sit on top of everything */
    top: 0;
    left: 0;
    background-color: #fff;
    overflow-x: hidden;
    transition: 0.3s; /* Smooth slide effect */
    padding-top: 60px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 1.2rem;
    color: var(--text-black);
    display: block;
    transition: 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar a:hover {
    background-color: var(--light-green);
    color: var(--primary-green);
}

.sidebar .closebtn {
    position: absolute;
    top: 0;
    right: 20px;
    font-size: 40px;
    border-bottom: none;
}

/* Overlay (Dark background when menu is open) */
#overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1500;
    cursor: pointer;
}

/* Hamburger Icon (Hidden on Desktop) */
.hamburger {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-black);
    padding-right: 15px;
}

/* CALCULATOR SECTION */
.calculator-section {
    background: #fff;
    padding: 25px; 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    width: 100%;
    max-width: 100%; 
}

h1 { color: #002e5b; margin-bottom: 10px; line-height: 1.3; }
.subtitle { color: #666; margin-bottom: 5px; }
.link-slab { color: var(--primary-green); text-decoration: none; display: block; margin-bottom: 15px; }

/* CALCULATOR GRID */
.calculator-grid {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* INPUTS */
.input-group { margin-bottom: 14px; }
input, select {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.error-message {
    color: var(--accent-red);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

/* RESULTS */
.results-box {
    margin-top: 30px;
}
.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
}
.total-row {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-black);
}
.highlight-red { color: var(--accent-red); }

#taxYear {
    /* 1. Remove the default browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* 2. Add custom arrow using an SVG Data URI */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    
    /* 3. Position the arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    background-color: white;

    /* 4. Basic Styling to look good */
    padding: 10px;
    padding-right: 30px; /* Important: Make room for the arrow so text doesn't overlap */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
}

/* SEO CONTENT */
.seo-content {
    margin-top: 5px;
    padding-top: 30px;
    border-top: 0px solid #ddd;
    word-wrap: break-word; 
}
.seo-content h2 { margin-bottom: 15px; color: var(--primary-green); }
.seo-content h3 { margin: 20px 0 10px; }
.seo-content p, .seo-content li { color: #555; margin-bottom: 10px; }

.site-footer {
    text-align: center;
    padding: 40px 0;
    color: #888;
    margin-top: 40px;
}

/* --- TABLE STYLING --- */
.slab-table-container {
    margin: 30px 0;
    font-family: 'Segoe UI', sans-serif;
    width: 100%;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    min-width: 600px; 
}

.tax-table thead {
    background-color: var(--primary-green);
    color: #ffffff;
}

.tax-table th, 
.tax-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
    vertical-align: top;
    font-size: 0.95rem;
}

.tax-table th { font-weight: 600; white-space: nowrap; }
.col-small { width: 50px; text-align: center; }

.tax-table tbody tr:nth-child(even) { background-color: var(--light-green); }

.tax-table td:last-child { font-weight: 500; color: var(--text-black); }

.note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* --- FAQ SECTION STYLING --- */
.faq-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.faq-section h3 {
    color: var(--primary-green);
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.faq-item {
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--primary-green);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.1);
}

.faq-question {
    color: var(--text-black);
    margin: 0;
    padding: 20px;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: rgba(5, 150, 105, 0.05);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-green);
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

.faq-answer.active {
    max-height: 200px;
    padding: 0 20px 20px 20px;
}

.faq-answer p {
    color: #555;
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

/* --- TAX TIPS SECTION --- */
.tax-tips-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.tax-tips-section h3 {
    color: var(--primary-green);
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: center;
}

.tips-intro {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tip-card {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0fdf4 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-green);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 100, 0, 0.1);
}

.tip-card h4 {
    color: var(--text-black);
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.tip-card p {
    color: #555;
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.important-note {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 8px;
    padding: 20px;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- MOBILE RESPONSIVENESS (UPDATED) --- */
@media (max-width: 768px) {
    /* Header Layout Changes */
    .site-header .container {
        /* Align Items for Mobile: Hamburger Left, Logo Center/Right */
        justify-content: flex-start; 
    }

    .hamburger {
        display: block; /* Show hamburger */
    }

    .desktop-nav {
        display: none; /* Hide old menu */
    }

    .logo {
        flex-grow: 1; /* Pushes logo to take available space */
        text-align: center; /* Centers logo text */
        margin-right: 30px; /* Counter-balance the hamburger size to center perfectly */
    }

    /* Calculator Adjustments */
    .calculator-section { padding: 25px 15px; }

    /* Fix Zoom Issue on iPhone */
    input, select {
        font-size: 16px; 
        padding: 12px;
    }

    /* Adjust Result Text */
    .result-row {
        font-size: 0.95rem;
        flex-wrap: wrap; 
    }
    
    h1 { font-size: 1.5rem; }
    
    /* Mobile adjustments for new sections */
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tip-card {
        padding: 1.25rem;
    }
    
    .faq-section h3,
    .tax-tips-section h3 {
        font-size: 1.5rem;
    }
}

