/* Global Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #3b82f6;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --light-text: #64748b;
    --white: #ffffff;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --result-item-bg: #f1f5f9;
    --total-bg: #dbeafe;
    --total-border: #bfdbfe;
    --total-text: #1d4ed8;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #60a5fa;
    --secondary-color: #60a5fa;
    --background-color: #0f172a;
    --text-color: #f1f5f9;
    --light-text: #94a3b8;
    --white: #1e293b;
    /* Reusing var name for semantic flip, or better: component bg */
    --card-bg: #1e293b;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --input-bg: #334155;
    --input-border: #475569;
    --result-item-bg: #334155;
    --total-bg: #1e3a8a;
    --total-border: #1e40af;
    --total-text: #bfdbfe;
    --success-color: #34d399;
    --warning-color: #fbbf24;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--text-color);
}

.highlight {
    color: var(--primary-color);
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

nav a {
    font-weight: 500;
    color: var(--light-text);
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    background-color: var(--input-bg);
}

/* Hero Section & Calculator */
.hero-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
    padding: 4rem 0 2rem;
    text-align: center;
}

.page-hero {
    background: var(--card-bg);
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid var(--input-border);
}

.page-hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.hero-content {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
}

.calculator-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    max-width: 600px;
    margin: 0 auto;
    transition: background-color 0.3s;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    background-color: var(--input-bg);
    transition: border-color 0.2s, background-color 0.3s, color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text {
    font-size: 0.875rem;
    color: var(--light-text);
    margin-top: 0.25rem;
    display: block;
}

.calculate-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calculate-btn:hover {
    background-color: var(--primary-dark);
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--input-border);
    animation: fadeIn 0.5s ease;
}

.result-section.hidden {
    display: none;
}

.result-section h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.result-item {
    background: var(--result-item-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
}

.result-item.total {
    grid-column: span 2;
    background: var(--total-bg);
    border: 1px solid var(--total-border);
}

.result-item .label {
    font-size: 0.875rem;
    color: var(--light-text);
    margin-bottom: 0.25rem;
}

.result-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.result-item.total .value {
    color: var(--total-text);
    font-size: 1.5rem;
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--light-text);
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
}

/* Content Section */
.content-section {
    padding: 4rem 0;
    background-color: var(--card-bg);
    transition: background-color 0.3s;
}

article {
    max-width: 800px;
    margin: 0 auto;
}

article h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

article h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

article h4 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

article p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    color: var(--text-color);
}

article ul,
article ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

article li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

table th,
table td {
    color: var(--text-color);
    background-color: var(--card-bg);
    border-color: var(--input-border) !important;
}

table tr:first-child th {
    background-color: var(--input-bg) !important;
}

/* Footer */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Salary Table */
.salary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.salary-table th {
    background: var(--bg-color);
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--input-border);
    color: var(--text-color);
}

.salary-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--input-border);
    color: var(--text-color);
}

.salary-table .total-row td {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    border-top: 2px solid var(--input-border);
    border-bottom: none;
}

.highlight-val {
    color: var(--success-color);
    font-weight: 600;
}

.hike-info {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    margin-top: 1rem;
}

/* Print Styles */
@media print {

    /* Reset layout */
    body,
    html {
        background-color: white !important;
        height: auto;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Hide UI elements */
    header,
    footer,
    #about,
    .hero-content,
    #salaryForm,
    .action-buttons,
    .help-text,
    nav {
        display: none !important;
    }

    /* Reset Container Styles to allow full width print */
    .hero-section,
    .container,
    .calculator-card {
        background: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
    }

    /* Ensure result section is visible */
    .result-section {
        display: block !important;
        visibility: visible !important;
        border: 2px solid #000;
        /* Add a border for the receipt look */
        padding: 2rem !important;
        margin: 0 !important;
        color: black !important;
        position: relative;
        left: 0;
        top: 0;
    }

    /* Ensure table text is black */
    .salary-table th,
    .salary-table td {
        color: black !important;
        border-color: #000 !important;
    }

    /* Hike Info styling for print */
    .hike-info {
        border: 1px solid #000;
        background: none !important;
        color: black !important;
    }

    /* Show disclaimer */
    .disclaimer {
        display: block !important;
        color: #000 !important;
        font-size: 0.8rem;
        margin-top: 2rem;
        text-align: center;
        border-top: 1px dashed #000;
        padding-top: 0.5rem;
    }

    /* Add a professional header for the print */
    .result-section h3::before {
        content: "8th Pay Commission Salary Estimate";
        display: block;
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        text-align: center;
        color: black;
        font-weight: bold;
        text-decoration: underline;
    }
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 3rem 0;
    margin-top: 0;
    border-top: 1px solid var(--input-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-col p {
    font-size: 0.9rem;
    color: var(--light-text);
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--light-text);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--input-border);
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--light-text);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* Active State for Hamburger (X shape) */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: row;
        /* Keep logo and hamburger on same row */
        flex-wrap: nowrap;
        /* Prevent wrapping */
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    /* Fix Title Wrapping */
    .logo h1 {
        font-size: 1.1rem;
        /* Smaller font to fit on one line */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-menu-toggle {
        display: block;
        margin-left: 1rem;
        /* Ensure space between logo and button */
    }

    nav {
        width: 100%;
        display: none;
        margin-top: 1rem;
        background-color: var(--card-bg);
        border-top: 1px solid var(--input-border);
        position: absolute;
        /* Take out of flow to not push content */
        top: 100%;
        left: 0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    nav.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    nav ul li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--input-border);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 1rem;
        width: 100%;
    }

    .theme-btn {
        margin: 1rem auto;
    }

    /* Reduce Whitespace */
    .hero-section {
        padding: 2rem 0 1rem;
    }

    .page-hero {
        padding: 1.5rem 0;
    }

    .page-hero h2 {
        font-size: 1.5rem;
    }

    .content-section {
        padding: 2rem 0;
    }

    article h2 {
        margin-top: 1rem;
        font-size: 1.5rem;
    }

    article h3 {
        margin-top: 1.5rem;
        font-size: 1.25rem;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    footer {
        padding: 2rem 0;
    }

    /* Responsive Tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
    }
}

/* ----------------------------------------------------
   News Page Redesign (2-Column Layout)
---------------------------------------------------- */
.news-wrapper {
    background-color: #f8fafc;
    padding: 3rem 0;
    min-height: 80vh;
}

.news-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .news-sidebar {
        order: -1;
    }
}

/* News Feed */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-card.list-view {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.news-card.list-view:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.news-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.news-cat {
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.news-date {
    color: #64748b;
}

.news-card.list-view h3 {
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    color: #1e293b;
    line-height: 1.3;
}

.news-card.list-view p {
    color: #475569;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.read-more:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Sidebar Widgets */
.news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 2rem;
}

.widget {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.widget h4 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Search Widget */
.search-widget form {
    display: flex;
    gap: 0.5rem;
}

.search-widget input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.search-widget button {
    padding: 0 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Quick Links */
.widget-links {
    list-style: none;
    padding: 0;
}

.widget-links li {
    margin-bottom: 0.75rem;
}

.widget-links a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: color 0.2s;
    display: block;
    padding: 0.5rem;
    border-radius: 6px;
    background: #f8fafc;
}

.widget-links a:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

/* Categories */
.widget-categories {
    list-style: none;
    padding: 0;
}

.widget-categories li {
    border-bottom: 1px solid #f1f5f9;
}

.widget-categories a {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    text-decoration: none;
    color: #475569;
}

.widget-categories a:hover {
    color: var(--primary-color);
}

.widget-categories span {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #64748b;
}

/* Newsletter */
.newsletter-widget p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.newsletter-widget input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.btn-subscribe {
    width: 100%;
    padding: 0.75rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-subscribe:hover {
    background: #059669;
}

/* ----------------------------------------------------
   Single Post View (post.html)
---------------------------------------------------- */
.post-header {
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    color: #1e293b;
    margin: 1rem 0;
}

.post-meta-row {
    font-size: 0.95rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta-row .divider {
    color: #cbd5e1;
}

.post-hero-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #334155;
    max-width: 100%;
    /* Ensure content doesn't overflow */
}

.post-content h2,
.post-content h3 {
    margin-top: 2.5rem;
    color: #1e293b;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #475569;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.post-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .post-header h1 {
        font-size: 2rem;
    }
}