/* CSS Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #f7fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.header__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.header__subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
}

.language-switcher {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.language-switcher-container {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.8);
    border-radius: 25px;
    padding: 4px;
    gap: 2px;
    backdrop-filter: blur(10px);
}

.lang-link,
.lang-current {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-current {
    background-color: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-link {
    background-color: transparent;
    opacity: 0.8;
}

.lang-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
    .language-switcher-container {
        padding: 2px;
    }
    
    .lang-link,
    .lang-current {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .header__title {
        font-size: 2.5rem;
    }
    
    .header__subtitle {
        font-size: 1.25rem;
    }
}

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

/* Calculator Section */
.calculator {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 3rem;
}

.calculator__title {
    font-size: 1.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: #1a202c;
}

/* Method Selector */
.method-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.method-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.method-btn:hover {
    color: #667eea;
    background-color: #f7fafc;
}

.method-btn.active {
    color: #667eea;
    background-color: #edf2f7;
    border-bottom: 2px solid #667eea;
}

.method-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .method-btn {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
        flex: 1;
        min-width: 0;
    }
}

/* Form Styles */
.calculator-form {
    margin-top: 2rem;
}

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

.form-section__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-size: 0.875rem;
}

.form-input,
.form-select-unit {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #e53e3e;
}

.input-with-unit {
    display: flex;
    gap: 0.5rem;
}

.input-with-unit .form-input {
    flex: 1;
}

.form-select-unit {
    min-width: 80px;
}

.form-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.2em;
    display: block;
}

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

/* Method Panels */
.method-panel {
    display: none;
}

.method-panel.active {
    display: block;
}

.method-description {
    background-color: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.method-description p {
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn--secondary {
    background-color: #edf2f7;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn--secondary:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e0;
}

.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.calculate-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Results Section */
.results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 3rem;
}

.results__title {
    font-size: 1.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: #1a202c;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.result-card {
    background-color: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-card--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.result-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.result-card--primary .result-card__title {
    opacity: 1;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.result-unit {
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: 500;
}

.fitness-category {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.fitness-description {
    font-size: 0.875rem;
    color: #718096;
}

.percentile-value {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.percentile-description {
    font-size: 0.875rem;
    color: #718096;
}

/* Improvement Suggestions */
.improvement-suggestions {
    background-color: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.improvement-suggestions__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.suggestions-content {
    display: grid;
    gap: 1rem;
}

.suggestion-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.suggestion-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.suggestion-text {
    font-size: 0.875rem;
    color: #4a5568;
    line-height: 1.5;
}

/* Educational Content Section */
.education {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 3rem;
}

.education__title {
    font-size: 1.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: #1a202c;
    position: relative;
}

.education__title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.education-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

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

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

.education-card {
    background: linear-gradient(145deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #cbd5e0;
}

.education-card__icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.education-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
    line-height: 1.4;
}

.education-card__content {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.875rem;
}

.education-list {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.education-list li {
    margin-bottom: 0.5rem;
    color: #4a5568;
    line-height: 1.5;
}

.education-list strong {
    color: #2d3748;
    font-weight: 600;
}

/* Education Highlight Section */
.education-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.education-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.education-highlight__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.education-highlight__content {
    position: relative;
    z-index: 1;
}

.education-highlight__content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.athlete-examples {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

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

.athlete-example {
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.athlete-example strong {
    font-weight: 600;
    font-size: 0.9rem;
}

.athlete-note {
    font-size: 0.75rem;
    opacity: 0.8;
    font-style: italic;
}

/* Education Methodology Section */
.education-methodology {
    background: #f7fafc;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
}

.education-methodology__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2d3748;
    text-align: center;
}

.education-methodology__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

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

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

.methodology-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.methodology-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.methodology-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.methodology-accuracy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: inline-block;
}

.methodology-item p {
    font-size: 0.875rem;
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.methodology-item p:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for educational content */
@media (max-width: 767px) {
    .education {
        padding: 1.5rem;
    }
    
    .education-card {
        padding: 1.25rem;
    }
    
    .education-highlight {
        padding: 1.5rem;
    }
    
    .education-methodology {
        padding: 1.5rem;
    }
    
    .methodology-item {
        padding: 1.25rem;
    }
}

/* FAQ Section */
.faq {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 3rem;
}

.faq__title {
    font-size: 1.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: #1a202c;
}

.faq-list {
    display: grid;
    gap: 1rem;
}

.faq-item {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    background-color: #f7fafc;
    transition: background-color 0.2s ease;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-question:hover {
    background-color: #edf2f7;
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 1.5rem;
    background-color: white;
}

.faq-answer p {
    color: #4a5568;
    line-height: 1.6;
}

/* Disclaimer Section */
.disclaimer {
    background: #fef5e7;
    border: 2px solid #f6ad55;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.disclaimer__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #c53030;
}

.disclaimer-content p {
    margin-bottom: 1rem;
    color: #744210;
    line-height: 1.6;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

/* Footer */
.footer {
    background-color: #2d3748;
    color: #a0aec0;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

.footer__text {
    font-size: 0.875rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .calculate-btn::after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error States */
.form-input.error {
    border-color: #e53e3e;
    background-color: #fed7d7;
}

/* Success States */
.form-input.success {
    border-color: #38a169;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible polyfill */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* Print Styles */
@media print {
    .method-selector,
    .calculator-form,
    .btn {
        display: none !important;
    }
    
    .results {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .header {
        background: white;
        color: black;
        border-bottom: 2px solid #000;
    }
}