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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --background: #f9fafb;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --highlight-color: #dbeafe;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 2.5rem 1rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

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

/* Main Content */
main {
    flex: 1;
    padding: 2rem 1rem;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Calculator Cards */
.calculator-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.calculator-card h2 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

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

/* Calculator Form */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.input-group input[type="number"] {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--highlight-color);
}

.input-group input[type="number"]::placeholder {
    color: #9ca3af;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.radio-label input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Calculate Button */
.btn-calculate {
    background: var(--primary-color);
    color: white;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

.btn-calculate:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

/* Result Display */
.result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--highlight-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    min-height: 3rem;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result.show {
    opacity: 1;
}

.result.success {
    background: #d1fae5;
    border-left-color: var(--success-color);
    color: #065f46;
}

/* Example Box */
.example {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #78350f;
    border-left: 3px solid var(--accent-color);
}

.example strong {
    color: #92400e;
}

/* SEO Content Section */
.seo-content {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 3rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

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

.seo-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-light);
    font-size: 1.05rem;
}

.seo-content ul {
    margin: 1rem 0 1.5rem 2rem;
    line-height: 1.8;
}

.seo-content li {
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.seo-content li strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, var(--text-dark) 0%, #111827 100%);
    color: white;
    padding: 3rem 1rem 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: #d1d5db;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

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

.footer-section a:hover {
    color: #fbbf24;
    text-decoration: underline;
}

.footer-blog-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    .calculator-card h2 {
        font-size: 1.2rem;
    }

    .seo-content {
        padding: 1.5rem;
    }

    .seo-content h2 {
        font-size: 1.6rem;
    }

    .seo-content h3 {
        font-size: 1.3rem;
    }

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

@media (max-width: 480px) {
    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    main {
        padding: 1.5rem 0.5rem;
    }

    .calculator-card {
        padding: 1.25rem;
    }

    .seo-content {
        padding: 1.25rem;
    }

    .seo-content h2 {
        font-size: 1.4rem;
    }

    .seo-content h3 {
        font-size: 1.2rem;
    }
}

/* Header Navigation */
.header-nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Blog Cards */
.blog-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.blog-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-card h2 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card h2 a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.btn-read-more {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-read-more:hover {
    background: var(--primary-hover);
}

/* Blog Post Styles */
.blog-post {
    max-width: 900px;
    margin: 0 auto;
}

.blog-post h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    line-height: 1.2;
}

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

.blog-content .lead {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-weight: 400;
}

.blog-content h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.blog-content h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.blog-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: var(--text-light);
}

.blog-content ul, .blog-content ol {
    margin: 1.25rem 0 1.25rem 2rem;
    line-height: 1.8;
}

.blog-content li {
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.blog-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.blog-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.blog-content a:hover {
    color: var(--primary-hover);
}

/* Formula Box */
.formula-box {
    background: var(--highlight-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 3rem;
}

.cta-box h3 {
    color: white;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.cta-box .btn-calculate {
    background: white;
    color: var(--primary-color);
    padding: 0.875rem 2rem;
    text-decoration: none;
    display: inline-block;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.cta-box .btn-calculate:hover {
    transform: scale(1.05);
}

/* Blog Navigation */
.blog-navigation {
    margin-top: 2rem;
    text-align: center;
}

.btn-back {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
}

/* Print Styles */
@media print {
    header {
        background: white;
        color: black;
    }

    .calculator-card {
        break-inside: avoid;
    }

    .btn-calculate {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .blog-navigation {
        display: none;
    }
}

/* Mobile Responsive for Blog */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-post h1 {
        font-size: 2rem;
    }

    .blog-content {
        padding: 2rem;
    }

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

    .blog-content h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .blog-content {
        padding: 1.5rem;
    }

    .blog-post h1 {
        font-size: 1.75rem;
    }

    .header-nav {
        gap: 1rem;
    }

    .header-nav a {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
