/* Modern, High-Fidelity Design System for My Divorce Kit */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary-h: 154;
    --primary-s: 18%;
    --primary-l: 44%; /* Sage Green: #52796F */
    --primary-color: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-light: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 20%));
    --primary-dark: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 10%));
    
    --accent-h: 200;
    --accent-s: 95%;
    --accent-l: 39%; /* Premium Blue: #0284C7 */
    --accent-color: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-hover: hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 8%));
    
    --bg-h: 210;
    --bg-s: 15%;
    --bg-l: 98%; /* Neutral Warm Light: #F8FAFC */
    --background-color: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
    
    --text-h: 215;
    --text-s: 25%;
    --text-l: 17%; /* Charcoal Body Text: #1E293B */
    --text-color: hsl(var(--text-h), var(--text-s), var(--text-l));
    --text-light: #64748B;
    
    --card-bg: #ffffff;
    --border-color: #E2E8F0;
    --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);
    
    --header-font: 'Outfit', sans-serif;
    --body-font: 'Inter', sans-serif;
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --card-bg: #1e293b;
        --text-color: #f8f9fa;
        --text-light: #94a3b8;
        --border-color: #334155;
        --primary-color: #a7f3d0;
        --primary-light: #34d399;
        --primary-dark: #064e3b;
    }
    header {
        background-color: rgba(30, 41, 59, 0.8) !important;
    }
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    min-width: 320px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Headings & Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--header-font);
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.25;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.85rem; margin-top: 2rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; }
p { margin-bottom: 1.25rem; font-weight: 400; }
a { color: var(--accent-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-text {
    font-family: var(--header-font);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--primary-color);
}

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

nav a {
    text-decoration: none;
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Page Layouts */
.content-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 992px) {
    .content-layout {
        grid-template-columns: 3fr 1fr;
    }
}

.main-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

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

.sticky-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

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

th {
    background-color: var(--primary-color);
    color: white;
    font-family: var(--header-font);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Ad Unit CLS Shields */
.ad-top-banner, .ad-mid-article, .ad-slot-matched, .ad-sticky-sidebar {
    margin: 2rem 0;
    background-color: rgba(226, 232, 240, 0.3);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
}

.ad-top-banner {
    min-height: 90px;
    width: 100%;
    max-width: 970px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .ad-top-banner {
        min-height: 250px;
    }
}

.ad-mid-article {
    min-height: 280px;
    max-width: 336px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.ad-slot-matched {
    min-height: 200px;
}

.ad-sticky-sidebar {
    display: none;
    min-height: 600px;
    width: 300px;
    padding: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

@media (min-width: 992px) {
    .ad-sticky-sidebar {
        display: flex;
        position: sticky;
        top: 24px;
    }
}

.ad-label {
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* UI Interactive Calculator */
.calculator-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(82, 121, 111, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    box-shadow: var(--shadow-md);
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group select, .form-group input {
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    outline: none;
    min-height: 44px; /* Mobile touch target */
    transition: border-color 0.2s ease;
}

.form-group select:focus, .form-group input:focus {
    border-color: var(--accent-color);
}

.calc-btn {
    background-color: var(--accent-color);
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.calc-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.calc-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.result-item {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.result-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Monetization Modules */
.store-module {
    background-color: var(--card-bg);
    padding: 1.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.2s ease;
}

.store-module:hover {
    transform: translateY(-2px);
}

.btn-payment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #0070ba; /* PayPal Blue */
    color: white !important;
    font-weight: 700;
    text-decoration: none !important;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    min-height: 44px;
    min-width: 200px;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-payment:hover {
    background-color: #005ea6;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.revenue-module {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(2, 132, 199, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.revenue-module .kicker, .transparency-module .kicker {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.revenue-module .notice, .transparency-module .notice {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.transparency-module {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 2rem;
}

.notice-list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

/* Guides Grid */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.guides-grid > div {
    background-color: var(--card-bg);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.guides-grid > div:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Table of Contents */
.table-of-contents {
    background-color: rgba(82, 121, 111, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.table-of-contents h2 {
    font-size: 1.15rem;
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
    color: var(--text-color);
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0.5rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Footer disclaimer */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: #e2e8f0;
}

.footer-disclaimer {
    font-size: 0.8rem;
    margin-top: 1.5rem;
    line-height: 1.6;
    color: #64748b;
}

/* Author bio */
.author-bio {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* Sticky Mobile CTA for Store */
@media (max-width: 767px) {
    .store-module {
        position: sticky;
        bottom: 0;
        z-index: 99;
        margin: 0 !important;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        border-radius: 0;
        border-width: 1px 0 0 0;
    }
}
