/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.return-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: #4f46e5;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.return-btn:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.4);
}

.return-btn:active {
    transform: translateY(0);
}

.return-btn svg {
    flex-shrink: 0;
}

.header-nav {
    display: none;
    gap: 1.5rem;
}

.header-nav a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: #4f46e5;
}

@media (min-width: 640px) {
    .header-nav {
        display: flex;
    }
}

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

/* Intro Section */
.intro-section {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 3rem;
}

.intro-section h1,
.intro-section .h1-style {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.intro-section h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.intro-section p {
    font-size: 1.125rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.learn-more-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    border-radius: 2rem;
    transition: all 0.2s;
}

.learn-more-link:hover {
    background-color: #e2e8f0;
    transform: translateY(2px);
}

@media (min-width: 640px) {

    .intro-section h1,
    .intro-section .h1-style {
        font-size: 3rem;
    }
}

/* Calculators Grid */
.calculators-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .calculators-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Calculator Card */
.calculator-card {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 2rem;
    transition: box-shadow 0.3s, transform 0.2s;
}

.calculator-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    background-color: #f1f5f9;
    padding: 0.75rem;
    border-radius: 0.75rem;
    color: #4f46e5;
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.card-header p {
    font-size: 0.875rem;
    color: #64748b;
}

/* Input Styles */
.input-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .input-row {
        flex-direction: row;
    }
}

.input-field {
    flex: 1;
    min-width: 140px;
}

.input-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.5rem;
}

.input-field input,
.input-wrapper input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #0f172a;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field input:focus,
.input-wrapper input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Input with suffix */
.input-wrapper {
    position: relative;
}

.input-wrapper input {
    padding-right: 2.5rem;
}

.input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.875rem;
    pointer-events: none;
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Result Display */
.result-display {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .result-display {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.result-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.result-value-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
}

.result-value.positive {
    color: #059669;
}

.result-value.negative {
    color: #dc2626;
}

.result-suffix {
    color: #0f172a;
    font-size: 1.875rem;
    font-weight: 700;
}

.change-label {
    color: #64748b;
    font-weight: 500;
    font-size: 1rem;
}

/* Copy Button */
.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.copy-btn:active {
    transform: scale(0.98);
}

.copy-btn.copied {
    border-color: #10b981;
    color: #10b981;
}

.copy-icon {
    flex-shrink: 0;
}

.check-icon {
    color: #10b981;
}

/* Info Card */
.info-card {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-radius: 1rem;
    padding: 2rem;
    color: #ffffff;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-header svg {
    opacity: 0.8;
}

.info-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.info-card p {
    color: #e0e7ff;
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 2rem;
}

.info-card strong {
    color: #ffffff;
}

.info-stats {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c7d2fe;
    margin-bottom: 0.25rem;
}

.stat-value {
    color: #ffffff;
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: 6rem;
    padding: 3rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

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

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

.calculator-card {
    animation: fadeIn 0.5s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Adblock Detection Modal Styles */
/* Bait Element - hidden from view but detectable */
.adsbox,
.ad-unit,
.header-ads {
    position: absolute;
    left: -10000px;
    top: -10000px;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* Modal Overlay */
.adblock-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.adblock-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal Content */
.adblock-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 32rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.adblock-modal.active .adblock-content {
    transform: scale(1);
}

/* Modal Icon */
.adblock-icon {
    margin: 0 auto 1.5rem;
    width: 4rem;
    height: 4rem;
    background-color: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typography */
.adblock-content h2 {
    color: #f8fafc;
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.adblock-content p {
    color: #94a3b8;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Button */
.adblock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 2rem;
    background-color: #ef4444;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

.adblock-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3);
}

.adblock-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .adblock-content {
        padding: 2rem;
    }

    .adblock-content h2 {
        font-size: 1.5rem;
    }

    .adblock-content p {
        font-size: 1rem;
    }
}

/* Article Styles */
.article-content {
    margin-top: 4rem;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.article-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 4rem 2rem;
    text-align: center;
    color: #ffffff;
}

.article-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    max-width: 800px;
    margin: 0 auto;
    letter-spacing: -0.025em;
}

@media (min-width: 768px) {
    .article-header h1 {
        font-size: 3rem;
    }
}

.article-body {
    padding: 3rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    color: #334155;
}

@media (min-width: 768px) {
    .article-body {
        padding: 4rem 3rem;
    }
}

.article-body p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.article-body a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(79, 70, 229, 0.1);
    transition: all 0.2s;
}

.article-body a:hover {
    background-color: rgba(79, 70, 229, 0.05);
    border-bottom-color: #4f46e5;
}

.article-body hr {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 3rem 0;
}

.article-body h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2.5rem 0 1.25rem;
    letter-spacing: -0.01em;
}

.article-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 2rem 0 1rem;
}

.article-body h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

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

.article-body li {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    background-color: #f1f5f9;
    border-left: 4px solid #4f46e5;
    padding: 1.5rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin: 2rem 0;
}

.article-body blockquote p {
    margin-bottom: 0;
    font-style: italic;
    color: #475569;
}

/* Formula Block */
.formula-block {
    background-color: #0f172a;
    color: #38bdf8;
    padding: 1.5rem;
    border-radius: 0.75rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.formula-block p {
    margin-bottom: 0;
    font-size: 1rem;
    word-break: break-all;
}

@media (min-width: 640px) {
    .formula-block p {
        font-size: 1.25rem;
    }
}

/* Table Design */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 1rem;
}

th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.comparison-table td:first-child {
    font-weight: 600;
    color: #64748b;
    background-color: #f8fafc;
    width: 30%;
}

.formula-table td:first-child {
    font-weight: 600;
    color: #4f46e5;
    width: 40%;
}

.formula-table code {
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-family: monospace;
    color: #0f172a;
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2.5rem 0;
}

@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.article-grid-item {
    background-color: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

.article-grid-item h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #0f172a;
    border-bottom: 2px solid #4f46e5;
    display: inline-block;
    padding-bottom: 0.25rem;
    margin-bottom: 1.25rem;
}

.article-grid-item ul {
    margin-bottom: 0;
}

/* FAQ Section */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-item h3 {
    color: #4f46e5;
    margin-bottom: 0.75rem;
}

.faq-item p {
    font-size: 1rem;
    margin-bottom: 0;
    color: #475569;
}

/* Article Footer */
.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.article-footer p {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 0;
}