/* Home Page Styles */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #252540;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-secondary: #22d3ee;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title .icon {
    font-size: 1.5rem;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Hamburger Menu */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all 0.3s;
}

.hamburger:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
}

.hamburger:hover span {
    background: var(--text-primary);
}

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

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

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

/* Header nav - dropdown menu */
.header {
    position: relative;
}

.header-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    gap: 0.25rem;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.header-nav.active {
    display: flex;
}

.header-nav .nav-link {
    text-align: left;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
}

.header-nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.15);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.85rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--text-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Main Container */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Content Sections */
.content-section {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.content-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.info-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.info-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Usage Grid */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.usage-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.step-number {
    background: var(--accent-primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.usage-step strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.usage-step p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mobile-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(34, 211, 238, 0.1);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-secondary);
}

/* Budget Table */
.table-container {
    overflow-x: auto;
}

.budget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.budget-table th,
.budget-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.budget-table th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-table td:nth-child(2) {
    font-family: monospace;
    font-weight: 600;
    color: var(--accent-secondary);
}

.budget-table td.adjusted-col {
    font-family: monospace;
    font-weight: 600;
    color: #fbbf24;
}

.budget-table .positive {
    color: #22c55e;
    font-weight: 600;
}

.budget-table .negative {
    color: #f43f5e;
    font-weight: 600;
}

/* Data Notes */
.data-notes {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
}

.data-notes h3 {
    color: #fbbf24;
}

.data-notes ul {
    list-style: none;
    padding: 0;
}

.data-notes li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.data-notes li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #fbbf24;
}

/* Link Cards */
.link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.2s;
}

.link-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.link-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.link-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.link-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

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

    .main-container {
        padding: 1rem;
    }

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

/* --- Inflation Modal Styles --- */
.modal-backdrop {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.visible {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-backdrop.visible .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.formula-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0 1.5rem;
    text-align: center;
}

.formula-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
}

.numerator {
    border-bottom: 1px solid var(--text-primary);
    padding: 0 0.5rem 2px;
    margin-bottom: 2px;
}

.denominator {
    padding: 2px 0.5rem 0;
}

.cpi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.cpi-table th {
    text-align: left;
    padding: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.cpi-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cpi-table tr:last-child td {
    border-bottom: none;
}

/* Custom Scrollbar for Modal Table */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Prevent body scroll when modal is open */
body.no-scroll {
    overflow: hidden;
}