/* ===== Tool Navigation ===== */
.tool-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 60px;
    z-index: 40;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

.tool-nav .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tool-nav-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.tool-nav-back:hover {
    color: var(--primary);
}

.tool-nav-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

/* ===== Calculator ===== */
.calculator-wrapper {
    padding: 24px 0 60px;
}

.calc-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.calc-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
    color: var(--primary);
}

.calc-icon svg {
    width: 28px;
    height: 28px;
}

.calc-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.calc-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 1024px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Form ===== */
.calc-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 140px;
}

@media (max-width: 1024px) {
    .calc-form {
        position: static;
    }
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--text);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 10px 48px 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    transition: var(--transition);
    outline: none;
    color: var(--text);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-currency {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* ===== Button Group ===== */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group .btn-option {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-group .btn-option:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-group .btn-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-group .btn-option.active:hover {
    background: var(--primary);
    color: white;
}

.unit-toggle {
    margin-top: 16px;
}

/* ===== Calculate Button ===== */
.calc-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    margin-top: 4px;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.35);
}

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

.result-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-bmi .result-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-bmi .result-value {
    display: inline-block;
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: -0.03em;
    line-height: 1.2;
    transition: color 0.5s ease;
}

.result-bmi .result-unit {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.result-category {
    display: inline-flex;
    align-items: center;
    padding: 8px 24px;
    border-radius: 50px;
    background: var(--bg);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 8px;
    transition: all 0.5s ease;
    color: var(--text-muted);
}

/* ===== BMI Scale ===== */
.bmi-scale {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px 14px;
    box-shadow: var(--shadow);
}

.scale-bar {
    position: relative;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    background: #e5e7eb;
}

.scale-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.scale-segment.underweight {
    background: #60a5fa;
    flex: 0.7;
}

.scale-segment.normal {
    background: #34d399;
    flex: 1.3;
}

.scale-segment.overweight {
    background: #fbbf24;
    flex: 1;
}

.scale-segment.obese {
    background: #f87171;
    flex: 1.5;
}

.scale-marker {
    position: absolute;
    top: -6px;
    width: 3px;
    height: 40px;
    background: var(--text);
    border-radius: 2px;
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-marker::after {
    content: '▲';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0 2px;
}

/* ===== Result Cards ===== */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow);
}

.result-card.highlight {
    background: var(--primary);
    border-color: var(--primary);
    grid-column: 1 / -1;
}

.result-card.highlight .result-label {
    color: rgba(255, 255, 255, 0.8);
}

.result-card.highlight .result-value {
    color: white;
}

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

.result-card .result-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* ===== Detailed Info ===== */
.info-expand {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--shadow);
}

.info-expand button {
    width: 100%;
    padding: 8px;
    border: none;
    background: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.info-expand button:hover {
    color: var(--primary);
}

.detailed-info {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detailed-info.active {
    opacity: 1;
    transform: translateY(0);
}

.info-section {
    margin-bottom: 14px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.info-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-section ul {
    list-style: none;
    padding: 0;
}

.info-section ul li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}

.info-section ul li:last-child {
    border-bottom: none;
}

.info-section ul li strong {
    color: var(--text);
}

/* ===== Search Suggestions ===== */
.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    padding: 4px 0;
    z-index: 100;
}

.suggestions.active {
    display: block;
    animation: fadeIn 0.15s ease;
}

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

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.suggestion-item:hover {
    background: var(--primary-light);
}

.suggestion-item .name {
    flex: 1;
}

.suggestion-item .category-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.suggestion-item .highlight {
    font-weight: 600;
    color: var(--primary);
}

.suggestions::-webkit-scrollbar {
    width: 4px;
}

.suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.suggestions::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .calc-header {
        flex-direction: column;
        text-align: center;
    }

    .calc-header h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {
    .calculator-wrapper {
        padding: 16px 0 40px;
    }

    .calc-form {
        padding: 20px 16px;
    }

    .result-display {
        padding: 20px;
    }

    .result-bmi .result-value {
        font-size: 2.6rem;
    }

    .btn-group {
        flex-direction: column;
    }
}