:root {
    --primary-color: #0056D2;
    /* Official Blue */
    --primary-hover: #0044A5;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --text-color: #202124;
    --text-secondary: #5F6368;
    --border-color: #DADCE0;
    --success-color: #188038;
    --error-color: #D93025;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    --radius: 8px;
    /* Slightly less rounded for professional look */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Site Wrapper Grid */
.site-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Main Content Container */
.container.main-content {
    width: 100%;
    max-width: 800px;
    /* Slightly wider to accommodate content */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Ad Sidebar Styles */
.ad-sidebar {
    display: none;
    /* Hidden on mobile by default */
}

/* Mobile Sticky Ad */
.mobile-sticky-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    /* Small height */
    background-color: white;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 5px;
}

.mobile-ad {
    width: 320px;
    height: 50px;
    min-height: 50px;
    /* Override default min-height */
    border: 1px dashed #ccc;
    font-size: 0.8rem;
}

/* Adjust body padding to prevent content overlap on mobile */
body {
    padding-bottom: 70px;
}



/* Desktop Grid Layout */
@media (min-width: 1200px) {
    body {
        padding-bottom: 0;
    }

    .mobile-sticky-ad {
        display: none;
    }

    .site-wrapper {
        grid-template-columns: 200px 1fr 200px;
        /* Sidebar - Content - Sidebar */
        align-items: start;
        padding-top: 40px;
    }

    .ad-sidebar {
        display: block;
        width: 100%;
        height: 100%;
    }

    .mobile-sticky-ad {
        display: none;
    }
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.25rem;
    /* Larger title */
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Main Card Style */
main {
    background: var(--card-background);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.card {
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin-bottom: 2.5rem;
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    /* Smaller section headers */
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* More spacing */
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subject-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
}

input,
select {
    padding: 1rem 1.25rem;
    /* Large inputs */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1.125rem;
    /* Larger text in inputs */
    font-family: inherit;
    transition: border-color 0.2s, background-color 0.2s;
    width: 100%;
    background-color: #FAFAFA;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #FFFFFF;
}

/* Result Section */
.result-card {
    background: transparent;
    color: var(--text-color);
    text-align: center;
    border-top: 2px solid var(--background-color);
    padding-top: 2rem;
    margin-top: 2rem;
}

.result-header {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.result-value {
    font-size: 5rem;
    /* Very large result */
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.result-breakdown {
    background: var(--background-color);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    display: inline-flex;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.breakdown-item span:last-child {
    font-weight: 600;
    color: var(--text-color);
    margin-left: 0.5rem;
}

/* Info Section */
.info-section {
    background: transparent;
    padding: 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.info-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.formula-box {
    background: #E8F0FE;
    /* Light blue background */
    padding: 1.25rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #174EA6;
    border-left: 4px solid var(--primary-color);
}

.note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Actions */
.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-reset {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-reset:hover {
    background-color: var(--background-color);
    color: var(--text-color);
    border-color: var(--text-secondary);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.separator {
    margin: 0 0.5rem;
    color: var(--border-color);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    main {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .subject-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-value {
        font-size: 3.5rem;
    }

    .input-group {
        gap: 1.5rem;
    }
}

/* Educational Content Section */
.educational-content {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-block {
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.content-block h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--background-color);
    padding-bottom: 0.75rem;
}

.content-block p {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Steps List */
.steps-list {
    counter-reset: steps;
    list-style: none;
    padding: 0;
}

.steps-list li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

.steps-list li::before {
    counter-increment: steps;
    content: counter(steps);
    position: absolute;
    left: 0;
    top: -0.1rem;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* FAQ Styles */
details {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

details:last-child {
    margin-bottom: 0;
}

summary {
    padding: 1rem 1.25rem;
    background: #FAFAFA;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    list-style: none;
    position: relative;
    transition: background-color 0.2s;
}

summary:hover {
    background: #F0F0F0;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

details[open] summary::after {
    content: '-';
}

details p {
    padding: 1.25rem;
    margin: 0;
    border-top: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
}

/* Legal Pages Styling */
.legal-content .content-block {
    text-align: left;
}

.legal-content h2 {
    margin-top: 2rem;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.legal-content li {
    margin-bottom: 0.5rem;
}

/* Link back style */
header p a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

header p a:hover {
    text-decoration: underline;
}