/* Tools Section Global Styles - Clean Professional Design */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    overflow-x: hidden;
    position: relative;
}

.tools-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Standard container for calculator pages */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.tools-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

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

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo-container {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.site-logo-container img {
    height: auto;
    width: 200px;
    background: transparent;
}

.site-description {
    color: #666;
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    font-weight: 400;
}

.header-menu ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.header-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    letter-spacing: 0.5px;
}

.header-menu a:hover,
.header-menu .current a {
    color: #3182ce;
}

/* Navigation and Sharing Row */
.navigation-sharing-row {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.navigation-sharing-row .social-sharing {
    margin: 0;
    justify-content: flex-end;
}

/* Breadcrumbs */
.breadcrumbs {
    flex: 1;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.breadcrumb-item a {
    color: #4a5568;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #3182ce;
    text-decoration: underline;
}

.breadcrumb-current span {
    color: #1a202c;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #cbd5e0;
    font-size: 1rem;
    user-select: none;
}

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

/* Main Title Styling - Shared across all calculator pages */
main h1 {
    text-align: center;
    color: #1a202c;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tool-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e2e8f0;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.08);
}

.tool-card.featured {
    border: 2px solid #f59e0b;
    background: linear-gradient(to bottom, #fffbeb 0%, #ffffff 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15), 0 4px 12px rgba(245, 158, 11, 0.1);
}

.tool-card.featured:hover {
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2), 0 8px 16px rgba(245, 158, 11, 0.15);
}

.tool-card h2 {
    color: #1a202c;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.tool-card p {
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.tool-card .features {
    margin-bottom: 1.5rem;
}

.tool-card .features ul {
    list-style: none;
    padding-left: 0;
}

.tool-card .features li {
    color: #4a5568;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.tool-card .features li::before {
    content: '✓';
    color: #38a169;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.tool-link {
    display: inline-block;
    background: #3182ce;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tool-link:hover {
    background: #2c5aa0;
    transform: translateY(-1px);
}

.coming-soon {
    opacity: 0.6;
    pointer-events: none;
}

.coming-soon .tool-link {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Learn More Navigation Section (Shared across all calculators) */
.learn-more-nav {
    background: #ebf8ff;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    border: 1px solid #bee3f8;
}

.learn-more-nav h3 {
    color: #1a202c;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.nav-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.75rem;
    border: 1px solid #bee3f8;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
    border-color: #3182ce;
}

.nav-card h4 {
    color: #3182ce;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-card p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Understanding Concepts Section (Shared across all calculators) */
.understanding-concepts {
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 3rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.understanding-concepts h2 {
    color: #1a202c;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.understanding-concepts > p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 0;
}

.concept-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.concept-card h3 {
    color: #3182ce;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.concept-card p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.concept-card p:last-of-type:not(.concept-takeaway):not(.concept-example) {
    margin-bottom: 0;
}

.concept-card ul {
    color: #4a5568;
    line-height: 1.7;
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem 0;
}

.concept-card li {
    margin-bottom: 0.6rem;
}

.concept-card li:last-child {
    margin-bottom: 0;
}

.concept-card strong {
    color: #1a202c;
    font-weight: 600;
}

.concept-takeaway {
    background: #ebf8ff;
    border-left: 4px solid #3182ce;
    padding: 1rem 1.25rem;
    margin-top: auto;
    margin-bottom: 0;
    border-radius: 0 4px 4px 0;
}

.concept-example {
    background: #faf5ff;
    border-left: 4px solid #9b59b6;
    padding: 1rem 1.25rem;
    margin-top: auto;
    margin-bottom: 0;
    border-radius: 0 4px 4px 0;
}

/* How to Use Section (Shared across all calculators) */
.how-to-use {
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem;
    margin-top: 3rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.how-to-use h2,
.how-to-use h3 {
    color: #1a202c;
    margin-bottom: 1rem;
    font-weight: 700;
}

.how-to-use h2 {
    font-size: 1.75rem;
}

.how-to-use h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

.how-to-use p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.how-to-use ol,
.how-to-use ul {
    color: #4a5568;
    line-height: 1.8;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.how-to-use li {
    margin-bottom: 0.75rem;
}

.how-to-use strong {
    color: #1a202c;
    font-weight: 600;
}

/* Footer Styles */
.tools-footer {
    background: #1a202c;
    color: #e2e8f0;
    padding: 2rem 0 1rem 0;
    margin-top: 4rem;
}

.footer-menu ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.footer-menu a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-menu a:hover {
    color: #ffffff;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: background 0.2s ease;
}

.footer-socials a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.footer-socials svg {
    fill: #e2e8f0;
}

.copyright {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #2d3748;
}

.copyright p {
    color: #a0aec0;
    font-size: 0.85rem;
}

/* Page Header Styles */
.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.page-header h1 {
    font-size: 2.25rem;
    color: #1a202c;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   SHARED CALCULATOR COMPONENTS
   ======================================== */

/* Calculator Form Styles */
.calculator-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 2rem auto;
    border: 1px solid #e2e8f0;
}

.calculator-form {
    margin-bottom: 2rem;
}

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

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

/* Input Group Styles (used by some calculators) */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label,
.form-group label {
    font-weight: 600;
    color: #1a202c;
    font-size: 1.05rem;
    line-height: 1.4;
}

.input-group input,
.input-group select,
.form-group input,
.form-group select {
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    background: #fff;
    color: #1a202c;
    font-weight: 500;
    line-height: 1.5;
}

.input-group input:hover,
.input-group select:hover,
.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e0;
}

.input-group input:focus,
.input-group select:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.1);
    background: #ffffff;
}

.form-help {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

/* Compact Select - for narrower dropdowns like currency selectors */
.select-compact {
    max-width: 300px;
    cursor: pointer;
}

/* Preset Buttons */
.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.preset-btn {
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    color: #2d3748;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.preset-btn:hover,
.preset-btn:focus {
    background: #e2e8f0;
    border-color: #a0aec0;
    transform: translateY(-1px);
}

/* Tab Navigation System - Professional Underline Style */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: white;
    padding: 0 1rem;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: #f7fafc;
}

.tabs::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease, background 0.3s ease;
    color: #4a5568;
    white-space: nowrap;
    position: relative;
    margin-bottom: -2px;
    flex-shrink: 0;
}

.tab-btn:hover:not(.active) {
    background: rgba(203, 213, 224, 0.2);
    color: #1a202c;
    border-bottom-color: #cbd5e0;
}

.tab-btn.active {
    background: rgba(49, 130, 206, 0.05);
    color: #3182ce;
    border-bottom-color: #3182ce;
}

/* Tab Content Sections */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Legacy Mode Toggle Styles (backward compatibility) */
.mode-toggle {
    display: flex;
    background: #edf2f7;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
    border: 1px solid #e2e8f0;
}

/* Calculator Mode Sections with Animation (legacy) */
.calculator-mode {
    display: none;
}

.calculator-mode.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.mode-toggle button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.mode-toggle button.active {
    background: #3182ce;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mode-toggle button:hover:not(.active) {
    color: #1a202c;
    background: #f7fafc;
}

/* Calculate Button */
.calculate-btn {
    background: #3182ce;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calculate-btn:hover {
    background: #2c5aa0;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

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

/* Results Section */
.results-section {
    margin-top: 2rem;
    background: #e0f2fe;
    border-radius: 12px;
    padding: 2rem;
    border: 5px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    scroll-margin-top: 160px; /* Offset for sticky header */
}

.results-section h2 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.75rem;
}

/* Error Styles */
.form-group.has-error input,
.form-group.has-error select {
    border-color: #e53e3e;
    box-shadow: 0 0 0 1px #e53e3e;
}

.form-group.has-error label {
    color: #e53e3e;
}

.validation-error,
.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Success message styles */
.success-message {
    color: #276749;
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.875rem;
}

/* Error message styles */
.error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fc8181;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.875rem;
}

/* Loading state */
.calculator-form.loading .calculate-btn {
    opacity: 0.7;
    cursor: not-allowed;
}

.calculator-form.loading .calculate-btn:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========================================
   SOCIAL SHARING STYLES
   ======================================== */

.social-sharing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-label {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
    margin-right: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-btn svg {
    width: 16px;
    height: 16px;
    color: #4a5568;
    transition: color 0.2s ease;
}

/* Platform-specific colors on hover */
.share-btn-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.share-btn-facebook:hover svg {
    color: #fff;
}

.share-btn-twitter:hover {
    background: #000;
    border-color: #000;
}

.share-btn-twitter:hover svg {
    color: #fff;
}

.share-btn-linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.share-btn-linkedin:hover svg {
    color: #fff;
}

.share-btn-pinterest:hover {
    background: #e60023;
    border-color: #e60023;
}

.share-btn-pinterest:hover svg {
    color: #fff;
}

/* ========================================
   MOBILE HAMBURGER MENU
   ======================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    position: relative;
}

.mobile-menu-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 120;
}

.mobile-menu-close .close-icon {
    font-size: 2.5rem;
    color: #1a202c;
    line-height: 1;
    font-weight: 300;
}

.hamburger-icon {
    display: block;
    width: 28px;
    height: 2px;
    background: #1a202c;
    position: relative;
    transition: background 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 2px;
    background: #1a202c;
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    bottom: -8px;
}

/* Hamburger animation when menu is open */
.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon {
    background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    main h1 {
        font-size: 2rem;
    }

    /* Tab navigation mobile styles */
    .tabs {
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
        border-radius: 10px 10px 0 0;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Legacy mode toggle mobile styles */
    .mode-toggle {
        flex-direction: column;
        max-width: 100%;
    }

    .mode-toggle button {
        padding: 0.75rem 1rem;
    }

    .tools-container {
        padding: 0 16px;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .site-branding {
        flex: 1;
    }

    .site-logo-container {
        align-items: flex-start;
        text-align: left;
    }

    .site-logo-container img {
        width: 150px;
    }

    .site-description {
        font-size: 0.75rem;
    }

    /* Show hamburger menu toggle on mobile */
    .mobile-menu-toggle {
        display: block;
    }

    /* Show close button on mobile */
    .mobile-menu-close {
        display: block;
    }

    /* Hide menu by default on mobile */
    .header-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 115;
        overflow-y: auto;
    }

    /* Show menu when open */
    .header-menu.open {
        right: 0;
    }

    .header-menu ul {
        flex-direction: column;
        gap: 0;
        padding: 4rem 0 2rem 0;
        justify-content: flex-start;
    }

    .header-menu li {
        width: 100%;
        border-bottom: 1px solid #e2e8f0;
    }

    .header-menu a {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
    }

    .header-menu .current {
        background: #f7fafc;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 280px; /* Leave space for menu width */
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 110;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }

    .page-header {
        padding: 0.75rem 1rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

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

    .footer-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    main {
        padding: 1.5rem 0;
    }

    .container {
        padding: 0 16px;
    }

    .calculator-wrapper {
        padding: 1.5rem;
        margin: 1rem auto;
    }

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

    .presets {
        gap: 0.25rem;
    }

    .preset-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Compact navigation row on mobile */
    .navigation-sharing-row {
        padding: 0.5rem 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Compact breadcrumbs */
    .breadcrumbs {
        width: 100%;
    }

    .breadcrumb-item {
        font-size: 0.75rem;
    }

    .breadcrumb-separator {
        font-size: 0.875rem;
    }

    /* Hide "Home" breadcrumb on mobile to save space */
    .breadcrumb-item:first-child {
        display: none;
    }

    /* Hide share buttons entirely on mobile */
    .social-sharing {
        display: none;
    }

    /* Learn More Navigation mobile optimization */
    .learn-more-nav {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .learn-more-nav h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .nav-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-card {
        padding: 1.25rem;
    }

    .nav-card h4 {
        font-size: 1rem;
    }

    /* Concept sections mobile optimization */
    .understanding-concepts {
        padding: 1.5rem;
    }

    .understanding-concepts > p {
        margin-bottom: 1.5rem;
    }

    .concept-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .concept-card {
        padding: 1.5rem;
    }

    .concept-card h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .concept-takeaway,
    .concept-example {
        padding: 0.75rem 1rem;
    }

    .how-to-use {
        padding: 1.5rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .preset-btn:hover,
    .calculate-btn:hover,
    .tool-card:hover,
    .tool-link:hover,
    .back-button:hover {
        transform: none;
    }
}
