/* FFMI Calculator - Modern Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-darker: #4338ca;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --text-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #94a3b8;
    --bg-gradient-start: #1e1b4b;
    --bg-gradient-end: #312e81;
    --bg-panel-dark: #4338ca;
    --bg-panel-light: #ffffff;
    --border-color: #475569;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.25);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Return Button */
.return-button-container {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease-out;
}

.return-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.return-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.return-button svg {
    transition: var(--transition-smooth);
}

.return-button:hover svg {
    transform: translateX(-3px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    font-weight: 300;
}

/* AdSense Container */
.ad-container {
    margin: 30px 0;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Calculator Wrapper */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

/* Results Panel */
.results-panel {
    background: linear-gradient(135deg, var(--bg-panel-dark) 0%, var(--primary-darker) 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.results-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.3);
}

/* Gauge */
.gauge-container {
    width: 220px;
    height: 220px;
    margin-bottom: 30px;
    position: relative;
}

.gauge {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.4));
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 10;
}

.gauge-value {
    fill: none;
    stroke: url(#gaugeGradient);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 0 251.2;
    transition: stroke-dasharray 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-text {
    font-size: 2.8em;
    font-weight: 700;
    fill: var(--text-light);
    dominant-baseline: middle;
}

.gauge-label {
    font-size: 0.9em;
    fill: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Results Display */
.results-text-display {
    width: 100%;
    max-width: 280px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    padding-left: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.result-value {
    font-weight: 600;
    color: var(--text-light);
    font-size: 1rem;
}

/* Input Panel */
.input-panel {
    background: var(--bg-panel-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Unit Switcher */
.unit-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 30px;
    gap: 12px;
}

.unit-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.unit-label.active {
    color: var(--primary-color);
    font-weight: 700;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    transition: var(--transition-smooth);
    border-radius: 28px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition-smooth);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider-toggle {
    background: var(--primary-color);
}

input:checked+.slider-toggle:before {
    transform: translateX(24px);
}

.slider-toggle:hover {
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* Input Groups */
.input-group {
    margin-bottom: 28px;
}

.input-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
}

/* Range Slider */
.range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) 50%, #e2e8f0 50%, #e2e8f0 100%);
    outline: none;
    transition: var(--transition-smooth);
    margin: 8px 0;
}

.range-slider:hover {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.4);
    transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.4);
    transition: var(--transition-smooth);
}

.range-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.slider-labels span:nth-child(2) {
    color: var(--primary-color);
    font-weight: 600;
}

/* Select */
.select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}

.select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.select:hover {
    border-color: var(--primary-color);
}

/* Interpretation Section */
.interpretation-section {
    background: var(--bg-panel-light);
    color: var(--text-dark);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.interpretation-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 700;
}

.interpretation-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* Info Section */
.info-section {
    background: var(--bg-panel-light);
    color: var(--text-dark);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.info-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 700;
}

.info-section h3 {
    color: var(--primary-dark);
    margin: 30px 0 15px;
    font-size: 1.4rem;
    font-weight: 600;
}

.info-section h4 {
    color: var(--primary-dark);
    margin: 25px 0 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

.info-section p,
.info-section li {
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.info-section ul,
.info-section ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.info-section strong {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Article Images */
.article-image {
    margin: 30px 0;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.article-image img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.image-caption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.info-table th,
.info-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.info-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.info-table th {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.info-table tbody tr {
    transition: var(--transition-smooth);
}

.info-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.info-table tbody tr:last-child td {
    border-bottom: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .gauge-container {
        width: 200px;
        height: 200px;
    }

    .info-section {
        padding: 25px;
    }

    .info-table {
        font-size: 0.9rem;
    }

    .info-table th,
    .info-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .results-panel,
    .input-panel,
    .interpretation-section,
    .info-section {
        padding: 20px;
    }

    .gauge-container {
        width: 180px;
        height: 180px;
    }

    .gauge-text {
        font-size: 2.4em;
    }

    .slider-labels {
        font-size: 0.75rem;
    }

    .result-item {
        font-size: 0.9rem;
    }

    .info-table {
        font-size: 0.85rem;
    }

    .info-table th,
    .info-table td {
        padding: 8px 10px;
    }
}

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

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