:root {
    /* Primary Colors - Green/Teal theme for chemistry */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --primary-hover: #059669;
    --primary-shadow: rgb(16 185 129 / 25%);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --accent: #8b5cf6;
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f0fdf4;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-color: var(--border);
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-secondary: var(--text-muted);
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Shadow System */
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
}

.calculator-page {
    padding: 2rem 0;
    min-height: 80vh;
}

.calculator-intro {
    margin-bottom: 2rem;
    padding: 0;
}

.calculator-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.calculator-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-muted);
    max-width: 700px;
    line-height: 1.6;
}

.calculator-meta {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.calculator-main {
    margin-top: 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.calculator-card {
    padding: 0rem 1rem;
    height: 100%;
}

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

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
}

.status-info {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

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

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9375rem;
}

.label-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-trigger {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tooltip-trigger:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--text-main);
    color: var(--text-inverse);
    text-align: center;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8125rem;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
}

.tooltip-trigger:hover + .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-main) transparent transparent transparent;
}

.calculator-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-main);
    transition: all 0.2s ease;
    font-weight: 500;
}

.calculator-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-shadow);
}

.calculator-input:hover {
    border-color: var(--border-dark);
}

.scenario-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.scenario-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: var(--surface-muted);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.calculate-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.calculate-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

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

.ghost-btn {
    padding: 1rem 1.5rem;
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ghost-btn:hover {
    background: var(--surface-muted);
    border-color: var(--border-dark);
    transform: translateY(-2px);
}

.results-container {
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border);
    position: relative;
    background: var(--background);
    height: 100%;
    min-height: 400px;
}

.results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.titration-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
}

.result-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.result-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.25rem;
}

.result-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.copy-buttons-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.copy-buttons-row .copy-button {
    flex: 1 1 auto;
    min-width: 140px;
}

.copy-button {
    width: 48%;
    background: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.copy-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff !important;
}

.share-container {
    background: rgba(241, 245, 249, 0.8);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.share-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
    color: #ffffff;
}

.share-x {
    background: #111827;
}

.share-facebook {
    background: #1877f2;
}

.share-linkedin {
    background: #0a66c2;
}

.share-reddit {
    background: #ff4500;
}

.share-telegram {
    background: #229ed9;
}

.share-whatsapp {
    background: #25d366;
    color: #0f172a;
}

.success-animation {
    animation: slideIn 0.6s ease-out;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Educational Content Styles */
.angle-seo-section {
    padding: 2rem 0 0;
}

.angle-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 4vw, 2.75rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--shadow-sm);
}

.angle-education-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.angle-education-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.angle-education-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.angle-education-card p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.angle-education-card a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.angle-education-card a:hover {
    color: var(--primary-dark);
}

/* Infographic Styles */
.infographic-conversion-formula {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.formula-box {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.formula-box:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.formula-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.formula-content {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    
}

.formula-example {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.infographic-timeline {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.infographic-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 2rem;
}

.timeline-container {
    position: relative;
    padding: 1rem 0;
}

.timeline-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
    gap: 1.5rem;
    position: relative;
}

.timeline-item {
    text-align: center;
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    transition: all 0.2s ease;
}

.timeline-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.timeline-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-icon svg {
    width: 100%;
    height: 100%;
}

.timeline-era {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.timeline-years {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.timeline-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .calculator-page {
        padding: 1rem 0;
    }

    .calculator-card,
    .results-container {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .calculate-btn,
    .ghost-btn {
        width: 100%;
    }

    .scenario-buttons {
        flex-direction: column;
    }

    .scenario-btn {
        width: 100%;
    }

    .share-buttons {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .copy-buttons-row {
        flex-direction: column;
    }

    .copy-buttons-row .copy-button {
        width: 100%;
    }

    .infographic-conversion-formula {
        grid-template-columns: 1fr;
    }

    .timeline-items {
        grid-template-columns: 1fr;
    }

    .angle-education-card h2 {
        font-size: 1.75rem;
    }

    .angle-education-card h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .calculator-title {
        font-size: 1.75rem;
    }

    .calculator-subtitle {
        font-size: 0.9375rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }
}

