/* Reset and Base Styles */
* {
    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: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.inputs-section,
.results-section {
    padding: 40px;
}

.inputs-section {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

.results-section {
    background: white;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #2d3748;
}

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

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 0.95rem;
}

input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-hint {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    margin-top: 5px;
}

.input-help {
    display: block;
    font-size: 0.88rem;
    color: #4a5568;
    margin-top: 8px;
    padding: 10px 12px;
    background: #edf2f7;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    line-height: 1.5;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

/* Unit Toggle */
.unit-toggle-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.unit-toggle-container input {
    flex: 1;
}

.unit-toggle {
    display: flex;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.unit-btn {
    padding: 0 16px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.unit-btn:first-child {
    border-right: 1px solid #e2e8f0;
}

.unit-btn.active {
    background: #667eea;
    color: white;
}

.unit-btn:hover:not(.active) {
    background: #f7fafc;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Results */
.results-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-content.hidden {
    display: none;
}

.results-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
    font-size: 1.1rem;
}

.result-item {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    font-weight: 600;
    color: #4a5568;
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
}

.classification-item {
    background: white;
    border: 2px solid #e2e8f0;
}

/* Badges */
.badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
}

.badge.rule-out {
    background: #c6f6d5;
    color: #22543d;
}

.badge.indeterminate {
    background: #fef5e7;
    color: #975a16;
}

.badge.rule-in {
    background: #fed7d7;
    color: #742a2a;
}

/* Clinical Meaning */
.clinical-meaning {
    padding: 16px;
    background: #edf2f7;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #2d3748;
    line-height: 1.6;
}

/* Method Details (Expandable) */
.method-details {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.method-toggle {
    width: 100%;
    padding: 14px 16px;
    background: #f8f9fa;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #667eea;
    transition: all 0.2s ease;
}

.method-toggle:hover {
    background: #edf2f7;
}

.method-toggle .chevron {
    transition: transform 0.3s ease;
    color: #667eea;
}

.method-toggle.active .chevron {
    transform: rotate(180deg);
}

.method-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.method-content.expanded {
    max-height: 1000px;
    border-top: 1px solid #e2e8f0;
}

.method-section {
    padding: 16px;
    border-bottom: 1px solid #f1f3f5;
}

.method-section:last-child {
    border-bottom: none;
}

.method-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.formula {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #2d3748;
    line-height: 1.7;
}

.formula-note {
    margin: 10px 0 0 0;
    font-size: 0.88rem;
    color: #4a5568;
    font-style: italic;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

.cutoff-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.cutoff-list li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

.cutoff-list li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.reference-text {
    margin: 0;
    font-size: 0.9rem;
    color: #4a5568;
    font-style: italic;
    line-height: 1.6;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-buttons button {
    flex: 1;
}

/* Footer */
footer {
    margin-top: 40px;
    color: white;
}

.disclaimer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.disclaimer h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.disclaimer p {
    margin-bottom: 10px;
    opacity: 0.95;
    line-height: 1.7;
}

.footer-links {
    text-align: center;
    opacity: 0.9;
}

.citation-placeholder {
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .calculator-card {
        grid-template-columns: 1fr;
    }

    .inputs-section,
    .results-section {
        padding: 25px;
    }

    .inputs-section {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

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

    .unit-toggle-container {
        flex-direction: column;
    }

    .unit-toggle {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .calculator-card {
        box-shadow: none;
    }

    .btn-primary,
    .btn-secondary {
        display: none;
    }
}
