/* YUKI HEALTH - Health Hub tool styles (only loaded on /health-hub/).
   Carried over from the previous site so the existing tools keep working; colours re-pointed to
   tokens.css. Candidate for a later clean-up into the new component system. */

/* Health Hub */
.health-hub {
    background: var(--color-bg);
}

.health-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); /* never wider than a phone */
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.health-tool-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(252, 66, 1, 0.1);
}

.tool-header {
    margin-bottom: 2rem;
    text-align: center;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.tool-desc {
    color: var(--color-text-muted);
    margin: 0;
}

/* Collapsible tool cards - collapsed by default so Health Hub reads as a
   scannable menu instead of a wall of forms; tapping a header expands it */
.tool-header.tool-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    padding: 0.25rem;
    margin: -0.25rem -0.25rem 0;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tool-header.tool-toggle:hover {
    background: rgba(252, 66, 1, 0.05);
}

.tool-header.tool-toggle:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.tool-header-main {
    flex: 1;
    min-width: 0;
}

.tool-chevron {
    color: var(--color-brand-ink);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.health-tool-card.expanded .tool-chevron {
    transform: rotate(180deg);
}

.health-tool-card.expanded .tool-header.tool-toggle {
    margin-bottom: 1.5rem;
}

.tool-content {
    transform-origin: top;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    cursor: pointer;
}

.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--color-brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(252, 66, 1, 0.1);
}

.input-group select:hover {
    border-color: var(--color-brand);
}

.help-text {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* BMI Calculator Specific */
.bmi-gauge {
    margin: 2rem 0;
}

.gauge-container {
    position: relative;
    max-width: 200px;
    margin: 0 auto;
}

.gauge {
    width: 100%;
    height: auto;
}

.gauge-value {
    font-size: 2rem;
    font-weight: 700;
    fill: var(--color-brand);
}

.bmi-info {
    text-align: center;
}

.bmi-category {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bmi-recommendation {
    color: var(--color-text-muted);
    margin: 0;
}

/* Blood Pressure Guide */
.bp-form {
    margin-bottom: 2rem;
}

.bp-inputs {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bp-separator {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-brand-ink);
    padding-bottom: 0.875rem;
}

.bp-indicator {
    width: 100%;
    height: 20px;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: relative;
}

.bp-category {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bp-explanation {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.disclaimer {
    font-size: 0.875rem;
    color: #999;
    font-style: italic;
    margin: 0;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 10px;
    border-left: 4px solid var(--color-brand);
}

/* Enhanced Medical Disclaimers */
.medical-disclaimers {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.disclaimer-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 12px 20px;
    margin: 0;
}

.disclaimer-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer-content {
    padding: 20px;
    line-height: 1.6;
}

.disclaimer-content p {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #333;
}

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

.disclaimer-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.validation-note {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px !important;
    color: #155724 !important;
    font-size: 0.85rem !important;
    text-align: center;
}

.validation-note em {
    font-style: normal;
    font-weight: 500;
}

/* Info Icon */
.info-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    margin-left: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: var(--color-brand-ink);
    opacity: 0.7;
    vertical-align: middle;
}

.info-icon:hover {
    opacity: 1;
    background: rgba(252, 66, 1, 0.1);
    transform: scale(1.1);
}

.info-icon:active {
    transform: scale(0.95);
}

/* Info Modal */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

/* Hide modal by default */
.info-modal[hidden] {
    display: none !important;
}

.info-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.info-modal-header {
    background: linear-gradient(135deg, #2c3e50 0%, var(--color-brand) 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-modal-header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.info-modal-body {
    padding: 25px;
}

.ranges-intro {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--color-brand);
    font-size: 0.95rem;
}

.ranges-table-container {
    overflow-x: auto;
    margin-bottom: 25px;
}

.ranges-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.ranges-table th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
}

.ranges-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: top;
}

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

.ranges-table tbody tr:hover {
    background: #f8f9fa;
}

.test-type {
    background: #f8f9fa;
    font-weight: 500;
}

.test-type strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 4px;
}

.test-type small {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.normal-range {
    background: rgba(76, 175, 80, 0.05);
    border-left: 3px solid #4CAF50;
}

.prediabetes-range {
    background: rgba(255, 152, 0, 0.05);
    border-left: 3px solid #FF9800;
}

.diabetes-range {
    background: rgba(244, 67, 54, 0.05);
    border-left: 3px solid #F44336;
}

.normal-range strong {
    color: #2E7D32;
}

.prediabetes-range strong {
    color: #E65100;
}

.diabetes-range strong {
    color: #C62828;
}

.ranges-table td strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.ranges-table td small {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.clinical-notes {
    margin-bottom: 20px;
}

.clinical-notes h5 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.note-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.normal-note {
    background: rgba(76, 175, 80, 0.05);
    border-left-color: #4CAF50;
}

.prediabetes-note {
    background: rgba(255, 152, 0, 0.05);
    border-left-color: #FF9800;
}

.diabetes-note {
    background: rgba(244, 67, 54, 0.05);
    border-left-color: #F44336;
}

.note-item h6 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.note-item p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
}

.accuracy-badge {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: #155724;
}

.accuracy-badge p {
    margin: 0;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .info-modal {
        padding: 10px;
    }

    .info-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .info-modal-header {
        padding: 15px 20px;
        border-radius: 12px 12px 0 0;
    }

    .info-modal-header h4 {
        font-size: 1.1rem;
    }

    .info-modal-body {
        padding: 20px 15px;
    }

    .ranges-table {
        font-size: 0.8rem;
    }

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

    .notes-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .note-item {
        padding: 12px;
    }
}

/* Blood Pressure Specific Styling */
.bp-category-cell {
    font-weight: 500;
}

.bp-category-cell strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.bp-category-cell small {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.normal-bp {
    background: rgba(76, 175, 80, 0.05);
    border-left: 3px solid #4CAF50;
}

.elevated-bp {
    background: rgba(255, 193, 7, 0.05);
    border-left: 3px solid #FFC107;
}

.stage1-bp {
    background: rgba(255, 152, 0, 0.05);
    border-left: 3px solid #FF9800;
}

.stage2-bp {
    background: rgba(244, 67, 54, 0.05);
    border-left: 3px solid #F44336;
}

.crisis-bp {
    background: rgba(183, 28, 28, 0.05);
    border-left: 3px solid #B71C1C;
}

.crisis-row {
    background: rgba(183, 28, 28, 0.02);
}

.crisis-range {
    background: rgba(183, 28, 28, 0.05);
    border-left: 3px solid #B71C1C;
    color: #B71C1C !important;
}

.crisis-range strong {
    color: #B71C1C !important;
    font-weight: 700;
}

.and-cell, .or-cell, .and-or-cell {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.and-cell {
    color: #4CAF50;
}

.or-cell {
    color: #FF9800;
}

.and-or-cell {
    color: #F44336;
}

/* BMI Specific Styling */
.underweight-bmi {
    background: rgba(52, 152, 219, 0.05);
    border-left: 3px solid #3498db;
}

.normal-bmi {
    background: rgba(76, 175, 80, 0.05);
    border-left: 3px solid #4CAF50;
}

.overweight-bmi {
    background: rgba(255, 193, 7, 0.05);
    border-left: 3px solid #FFC107;
}

.obese1-bmi {
    background: rgba(255, 152, 0, 0.05);
    border-left: 3px solid #FF9800;
}

.obese2-bmi {
    background: rgba(244, 67, 54, 0.05);
    border-left: 3px solid #F44336;
}

.obese3-bmi {
    background: rgba(183, 28, 28, 0.05);
    border-left: 3px solid #B71C1C;
}

.underweight-range {
    background: rgba(52, 152, 219, 0.05);
    border-left: 3px solid #3498db;
    color: #2980b9 !important;
}

.severe-range {
    background: rgba(244, 67, 54, 0.05);
    border-left: 3px solid #F44336;
    color: #c62828 !important;
}

.severe-range strong {
    color: #c62828 !important;
}

.morbid-row {
    background: rgba(183, 28, 28, 0.02);
}

.risk-cell {
    text-align: center;
    font-weight: 500;
}

.minimal-risk {
    color: #4CAF50;
}

.low-risk {
    color: #2196F3;
}

.mild-risk {
    color: #FFC107;
}

.moderate-risk {
    color: #FF9800;
}

.high-risk {
    color: #F44336;
}

.very-high-risk {
    color: #B71C1C;
    font-weight: 600;
}

.bmi-limitations {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.bmi-limitations h5 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1rem;
}

.bmi-limitations ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

.bmi-limitations li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.bmi-limitations strong {
    color: #6c5200;
}

/* Water Intake Specific Styling */
.org-cell {
    font-weight: 500;
}

.iom-org {
    background: rgba(33, 150, 243, 0.05);
    border-left: 3px solid #2196F3;
}

.efsa-org {
    background: rgba(76, 175, 80, 0.05);
    border-left: 3px solid #4CAF50;
}

.who-org {
    background: rgba(255, 152, 0, 0.05);
    border-left: 3px solid #FF9800;
}

.mayo-org {
    background: rgba(156, 39, 176, 0.05);
    border-left: 3px solid #9C27B0;
}

.mild-range {
    background: rgba(156, 39, 176, 0.05);
    border-left: 3px solid #9C27B0;
    color: #7B1FA2 !important;
}

.notes-cell {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.hydration-factors, .hydration-safety {
    margin: 25px 0;
}

.factors-grid, .safety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.factor-item, .safety-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #2196F3;
}

.safety-item.dehydration-warning {
    border-left-color: #FF5722;
    background: rgba(255, 87, 34, 0.05);
}

.safety-item.overhydration-warning {
    border-left-color: #9C27B0;
    background: rgba(156, 39, 176, 0.05);
}

.factor-item h6, .safety-item h6 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
}

.factor-item p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
}

.safety-item ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: #555;
}

.safety-item li {
    margin-bottom: 4px;
}

.safety-note {
    margin-top: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
}

.safety-note p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    font-weight: 500;
}

.male-col, .female-col {
    text-align: center;
    background: rgba(33, 150, 243, 0.05);
}

.female-col {
    background: rgba(233, 30, 99, 0.05);
}

/* Daily Tip */
.daily-tip {
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand));
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.daily-tip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%), 
                linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.3;
    pointer-events: none;
}

.tip-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.tip-content {
    font-size: 1.125rem;
    margin: 0;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Enhanced Daily Tip Content */
.daily-tip-content {
    position: relative;
    z-index: 1;
}

.tip-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tip-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    min-height: 3rem;
}

.tip-category {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tip-text {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tip-meta {
    opacity: 0.8;
    font-size: 0.875rem;
}

.tip-meta small {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    display: inline-block;
}

/* Water Intake Calculator Styles */
.water-result,
.walking-result,
.diabetes-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid var(--color-brand);
}

.water-display {
    text-align: center;
    margin-bottom: 2rem;
}

.water-amount {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.amount-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.amount-unit {
    font-size: 1.125rem;
    opacity: 0.9;
}

.water-glasses {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.125rem;
    font-weight: 500;
}

.water-tips h4,
.walking-tips h4,
.diabetes-recommendations h4 {
    color: var(--color-brand-ink);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.water-tips ul,
.walking-tips ul,
.diabetes-recommendations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.water-tips li,
.walking-tips li,
.diabetes-recommendations li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(252, 66, 1, 0.1);
    position: relative;
    padding-left: 1.5rem;
}

.water-tips li:before,
.walking-tips li:before,
.diabetes-recommendations li:before {
    content: '•';
    color: var(--color-brand-ink);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: 0.25rem;
}

.water-tips li:last-child,
.walking-tips li:last-child,
.diabetes-recommendations li:last-child {
    border-bottom: none;
}

/* Walking Goals Calculator Styles */
.walking-goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.goal-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(252, 66, 1, 0.1);
    transition: all 0.3s ease;
}

.goal-card:hover {
    border-color: var(--color-brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(252, 66, 1, 0.15);
}

.goal-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.goal-value {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.goal-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-brand-ink);
    margin-bottom: 0.25rem;
    display: block;
}

.goal-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Diabetes Assistant Styles */
.diabetes-indicator {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.diabetes-status {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.diabetes-range {
    font-size: 1rem;
    color: var(--color-text-muted);
    background: rgba(252, 66, 1, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.diabetes-interpretation {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #333;
}

/* Form Error States */
.input-group input.error,
.input-group select.error {
    border-color: #E53935;
    background-color: rgba(229, 57, 53, 0.05);
}

.error-message {
    color: #E53935;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for new calculators */
@media (max-width: 768px) {
    /* Hero section adjustments */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-graphic {
        max-width: 400px; /* Smaller on tablets */
        margin: 0 auto;
    }
    
    .water-amount {
        padding: 1.5rem;
    }
    
    .amount-number {
        font-size: 2.5rem;
    }
    
    .walking-goals {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .goal-card {
        padding: 1rem;
    }
    
    .goal-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 430px) {
    /* Mobile hero adjustments */
    .hero-graphic {
        max-width: 300px; /* Even smaller on mobile */
    }
    
    .hero-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .walking-goals {
        grid-template-columns: 1fr;
    }
    
    .water-result,
    .walking-result,
    .diabetes-result {
        padding: 1rem;
        margin-top: 1.5rem;
    }
}

/* Learn Section */
.learn {
    background: white;
}

.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.learn-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(252, 66, 1, 0.1);
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.learn-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(252, 66, 1, 0.15);
    border-color: var(--color-brand);
}

.learn-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-brand), var(--color-brand));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.learn-card:hover::after {
    transform: scaleX(1);
}

.learn-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.learn-card:hover .learn-icon {
    transform: scale(1.1);
}

.learn-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.learn-desc {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.learn-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.learn-category {
    background: rgba(252, 66, 1, 0.1);
    color: var(--color-brand-ink);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
}

.learn-read-time {
    color: #999;
    font-style: italic;
}

/* Loading skeleton */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skeleton-card {
    background: #f0f0f0;
    border-radius: 20px;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Health Education Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    color: #222;
    font-size: 1.75rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: var(--color-brand-ink);
}

.modal-content {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-loading {
    text-align: center;
    padding: 3rem 0;
}

.modal-loading .spinner {
    margin-bottom: 1rem;
}

/* Health topic content styling */
.health-content {
    line-height: 1.7;
}

.health-intro {
    font-size: 1.125rem;
    color: #555;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid var(--color-brand);
}

.health-section {
    margin-bottom: 2.5rem;
}

.health-section h3 {
    color: var(--color-brand-ink);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.health-section h3::before {
    content: '●';
    color: var(--color-brand-ink);
    font-size: 0.75rem;
}

.health-section h4 {
    color: #333;
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
}

.health-section p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.health-tips {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(252, 66, 1, 0.1);
    margin: 1.5rem 0;
}

.health-tips ul,
.practical-tips ul,
.myth-facts ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.health-tips li,
.practical-tips li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(252, 66, 1, 0.1);
    position: relative;
    padding-left: 2rem;
    color: #333;
}

.health-tips li:before,
.practical-tips li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-brand-ink);
    font-weight: bold;
    font-size: 1.25rem;
}

.health-tips li:last-child,
.practical-tips li:last-child {
    border-bottom: none;
}

.practical-tips {
    background: linear-gradient(135deg, var(--color-brand), var(--color-brand));
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.practical-tips h4 {
    color: white;
    margin-top: 0;
}

.practical-tips li {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.practical-tips li:before {
    color: white;
}

.myth-facts {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
}

.myth-fact-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #e74c3c;
}

.myth {
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.myth::before {
    content: '❌ Myth: ';
    font-weight: normal;
}

.fact {
    color: #27ae60;
    font-weight: 500;
}

.fact::before {
    content: '✅ Fact: ';
    font-weight: normal;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .health-intro {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .learn-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}


/* Health Education / Learn Section */
.learn {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--color-bg) 0%, #FFEEE5 100%);
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 2rem auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid rgba(252, 66, 1, 0.2);
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(252, 66, 1, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 4px 20px rgba(252, 66, 1, 0.2);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-brand-ink);
    font-size: 1.2rem;
    pointer-events: none;
}

.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.learn-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(252, 66, 1, 0.1);
    position: relative;
    overflow: hidden;
}

.learn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-brand), #FF9F4A);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.learn-card:hover::before {
    transform: scaleX(1);
}

.learn-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(252, 66, 1, 0.15);
}

.learn-card:focus {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.learn-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.learn-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.learn-desc {
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.learn-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.learn-category {
    background: rgba(252, 66, 1, 0.1);
    color: var(--color-brand-ink);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
}

.learn-read-time {
    color: #999;
}

/* Loading Skeleton */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skeleton-card {
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 20px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Health Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-container {
    background: white;
    border-radius: 25px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(252, 66, 1, 0.1);
    color: var(--color-brand-ink);
}

.modal-content {
    padding: 1rem 2rem 2rem;
}

.modal-loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Health Content Styling */
.health-content {
    line-height: 1.7;
    color: #333;
}

.health-content p {
    color: #555;
    margin-bottom: 1rem;
}

.health-intro {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(252, 66, 1, 0.05);
    border-radius: 15px;
    border-left: 4px solid var(--color-brand);
}

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

.health-section h3 {
    color: var(--color-brand-ink);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.health-section h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.health-tips ul {
    margin: 1rem 0;
    padding-left: 0;
    list-style: none;
}

.health-tips li {
    position: relative;
    padding: 0.5rem 0 0.5rem 2rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.health-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.practical-tips {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.practical-tips h4 {
    color: #333;
    margin-top: 0;
}

.practical-tips ul {
    margin: 1rem 0 0 0;
    padding-left: 0;
    list-style: none;
}

.practical-tips li {
    position: relative;
    padding: 0.5rem 0 0.5rem 2rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.practical-tips li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

.myth-facts {
    margin: 2rem 0;
}

.myth-facts h3 {
    color: #e74c3c;
    margin-bottom: 1.5rem;
}

.myth-fact-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #eee;
}

.myth {
    color: #e74c3c;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.myth::before {
    content: '❌ Myth: ';
}

.fact {
    color: #27ae60;
    font-weight: 500;
}

.fact::before {
    content: '✅ Fact: ';
}


/* Health Score Calculator */
.health-tool-card.featured {
    border: 2px solid var(--color-brand);
    background: linear-gradient(135deg, var(--color-bg) 0%, #F9F5F0 100%);
    position: relative;
    overflow: visible;
}

.health-tool-card.featured::before {
    content: '🏆 FEATURED TOOL';
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, var(--color-brand), #FF6B35);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}

.score-instructions {
    background: rgba(252, 66, 1, 0.1);
    border: 1px solid rgba(252, 66, 1, 0.2);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    color: #D68910;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-input {
    display: flex;
    flex-direction: column;
}

.metric-input label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.metric-input input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.metric-input input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(252, 66, 1, 0.1);
}

.metric-input small {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--color-text-muted);
    color: var(--color-text-muted);
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--color-text-muted);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
}

.health-score-result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(252, 66, 1, 0.2);
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring circle:first-child {
    stroke: #e0e0e0;
}

.score-ring circle:last-child {
    transition: stroke-dasharray 1s ease-out;
}

.score-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

.score-rating h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.score-rating p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 300px;
}

.score-breakdown,
.score-recommendations {
    background: white;
    border-radius: 15px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(252, 66, 1, 0.1);
}

.score-breakdown h5,
.score-recommendations h5 {
    color: var(--color-brand-ink);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-breakdown h5::before {
    content: '📊';
}

.score-recommendations h5::before {
    content: '💡';
}

.metrics-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.metric-name {
    font-weight: 600;
    color: #333;
    min-width: 120px;
    font-size: 0.9rem;
}

.metric-bar {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-out;
    position: relative;
}

.metric-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.score-recommendations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.score-recommendations li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    line-height: 1.6;
    position: relative;
    padding-left: 1.5rem;
}

.score-recommendations li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.score-recommendations li:last-child {
    border-bottom: none;
}

.score-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.score-actions .btn-outline {
    min-width: 150px;
    justify-content: center;
}

/* Health Score Responsive */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 2rem;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-number {
        font-size: 2rem;
    }
    
    .score-rating h4 {
        font-size: 1.25rem;
    }
    
    .metric-score {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .metric-name {
        min-width: auto;
    }
    
    .score-actions {
        flex-direction: column;
    }
}

/* Medication Reminder */
.medication-reminder {
    background: linear-gradient(135deg, #E8F5E8 0%, #F0F8F0 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(76, 175, 80, 0.2);
    position: relative;
    overflow: hidden;
}

.medication-reminder::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="20" fill="%234CAF50" opacity="0.1"/></svg>');
    z-index: 1;
}

.med-container {
    position: relative;
    z-index: 2;
}

.med-title {
    color: #4CAF50;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.med-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.med-limit-note {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(252, 66, 1, 0.08);
    color: #444;
    font-size: 0.9rem;
    line-height: 1.5;
}

.med-add-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(76, 175, 80, 0.2);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.05);
}

.med-input-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.med-input-row input,
.med-input-row select {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.med-input-row input:focus,
.med-input-row select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-small {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 8px;
    white-space: nowrap;
}

.medication-list {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    border: 1px solid rgba(76, 175, 80, 0.2);
    margin-bottom: 1.5rem;
    min-height: 60px;
}

.med-placeholder {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

.medication-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.medication-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.medication-item.active {
    background: rgba(76, 175, 80, 0.05);
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.medication-item.inactive {
    background: rgba(158, 158, 158, 0.05);
    opacity: 0.7;
}

.medication-item:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: translateX(5px);
}

.med-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.med-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.med-time {
    color: #4CAF50;
    font-weight: 500;
    font-size: 0.9rem;
}

.med-last-taken {
    color: #999;
    font-size: 0.8rem;
    font-style: italic;
}

.med-actions-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.med-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-success {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

.btn-success:hover {
    background: #45a049 !important;
}

/* Medication Reminder Responsive */
@media (max-width: 768px) {
    .medication-reminder {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .med-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .med-input-row input,
    .med-input-row select,
    .btn-small {
        min-width: auto;
        width: 100%;
    }
    
    .medication-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .med-info {
        width: 100%;
    }
    
    .med-actions-inline {
        width: 100%;
        justify-content: flex-end;
    }
    
    .med-actions {
        flex-direction: column;
    }
}

/* Health Records Tracker */
.health-records {
    background: linear-gradient(135deg, #E3F2FD 0%, #F1F8FE 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(33, 150, 243, 0.2);
    position: relative;
    overflow: hidden;
}

.health-records::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="20" y="20" width="60" height="60" fill="%232196F3" opacity="0.1" rx="5"/></svg>');
    z-index: 1;
}

.records-container {
    position: relative;
    z-index: 2;
}

.records-title {
    color: #2196F3;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.records-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.records-summary {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(33, 150, 243, 0.2);
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.05);
}

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

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2196F3;
    line-height: 1;
    margin-bottom: 0.25rem;
}

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

.records-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn-danger {
    border-color: #f44336 !important;
    color: #f44336 !important;
}

.btn-danger:hover {
    background: #f44336 !important;
    color: white !important;
}

.health-history {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(33, 150, 243, 0.2);
    margin-top: 1rem;
}

.health-history h5 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.health-history h5::before {
    content: '📈';
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.history-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.history-item:hover {
    background: rgba(33, 150, 243, 0.05);
    transform: translateX(5px);
}

.history-type {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    min-width: 120px;
}

.history-date {
    color: #2196F3;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.history-summary {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    flex: 1;
    text-align: right;
}

.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
    background: rgba(33, 150, 243, 0.05);
    border-radius: 10px;
    border: 1px dashed rgba(33, 150, 243, 0.2);
}

/* Health Records Responsive */
@media (max-width: 768px) {
    .health-records {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .summary-number {
        font-size: 1.5rem;
    }
    
    .records-actions {
        flex-direction: column;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-type,
    .history-date,
    .history-summary {
        min-width: auto;
        text-align: left;
        width: 100%;
    }
    
    .history-date {
        font-size: 0.75rem;
        opacity: 0.8;
    }
}


/* Form Validation */
/* Only flag fields after the user has interacted with them */
.input-group input:user-invalid,
.input-group select:user-invalid {
    border-color: #e74c3c;
}

.input-group input:valid,
.input-group select:valid {
    border-color: #27ae60;
}


/* Keyframes used by the tools */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes staggerFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes gaugeFill {
    from {
        stroke-dasharray: 0 251.2;
    }
    to {
        stroke-dasharray: var(--gauge-value) 251.2;
    }
}
@keyframes bpIndicatorSlide {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}
@keyframes expandFaq {
    from {
        opacity: 0.8;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(229, 57, 53, 0.6);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
        transform: scale(1);
    }
}
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}
@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-brand);
    }
}
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }
    100% {
        stroke-dashoffset: 0;
    }
}
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}
@keyframes progressFill {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideInFab {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Old button class names used by the tool markup, mapped to the new button design */
.btn.btn-primary { background: var(--color-brand-strong); color: #fff; border-color: transparent; box-shadow: none; }
.btn.btn-primary:hover { background: var(--color-brand-hover); color: #fff; transform: none; }
.btn.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1.5px solid var(--color-line); box-shadow: none; }
.btn.btn-secondary:hover { border-color: var(--color-text); color: var(--color-text); background: var(--color-surface); transform: none; }
.btn.btn-large { min-height: 52px; padding-inline: var(--space-6); }

/* New page frame around the tools */
.health-hub { padding-block: var(--space-6) var(--section-y); background: none; }
.hub-notice { margin-bottom: var(--space-6); border-left-color: var(--color-status-caution); }
