/* Health Metrics Page - Function Health Inspired */

.healthmetrics-page {
    background: #FAFAFA;
}

/* Hero Section - Compact */
.metrics-hero-compact {
    padding: 120px 0 40px;
    background: linear-gradient(180deg, #FAFAFA 0%, #F0F0F0 100%);
    text-align: center;
}

.metrics-title {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 400;
    letter-spacing: -2px;
    color: #191919;
    margin-bottom: 12px;
}

.metrics-title em {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: normal;
    font-weight: 600;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metrics-subtitle {
    font-size: 17px;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Main Content - Two Column Layout */
.metrics-main {
    padding: 40px 0 80px;
    background: #FAFAFA;
}

.metrics-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    align-items: start;
}

/* Sidebar */
.metrics-sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
}

.sidebar-search {
    margin-bottom: 28px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: #9CA3AF;
    flex-shrink: 0;
}

.search-input {
    border: none;
    outline: none;
    font-size: 15px;
    width: 100%;
    background: transparent;
}

.search-input::placeholder {
    color: #9CA3AF;
}

/* Sidebar Categories */
.sidebar-categories {
    margin-bottom: 24px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    padding: 8px 14px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    color: #374151;
}

.category-tag:hover {
    border-color: #9CA3AF;
    background: #F9FAFB;
}

.category-tag.active {
    background: #191919;
    color: white;
    border-color: #191919;
}

/* Metrics Content */
.metrics-content {
    min-height: 600px;
}

.metrics-count {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E5E5;
}

.metrics-count strong {
    color: #2563EB;
    font-weight: 600;
}

/* Responsive for Mobile */
@media (max-width: 900px) {
    .metrics-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .sidebar-sticky {
        position: relative;
        top: 0;
    }

    .metrics-sidebar {
        order: 1;
    }

    .metrics-content {
        order: 2;
    }
}

/* Discovery Tags */
.discovery-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E5E5;
}

.discovery-tag {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    background: #F3F4F6;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.discovery-tag:hover {
    background: #E5E7EB;
    color: #111827;
}

.discovery-tag.trending {
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FFEDD5;
}

.discovery-tag.essential {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #DBEAFE;
}

/* Legacy styles kept for compatibility */
.category-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    height: 6px;
}

.category-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.category-tabs::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.category-tab {
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 100px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-tab:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.category-tab.active {
    background: #191919;
    border-color: #191919;
    color: white;
}

/* Metrics Grid */
.metrics-grid-section {
    padding: 40px 0 80px;
    background: #FAFAFA;
}

.metrics-count {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 24px;
}

.metrics-count strong {
    color: #191919;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.metric-card:hover {
    border-color: #2563EB;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    transform: translateY(-6px);
}

.metric-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F9FAFB;
    border-radius: 12px;
    flex-shrink: 0;
}

.metric-info {
    flex: 1;
    min-width: 0;
}

.metric-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #191919;
    margin: 0 0 4px 0;
}

.metric-info p {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    line-height: 1.4;
}

.metric-badge {
    background: #EFF6FF;
    color: #2563EB;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 100px;
    flex-shrink: 0;
}

/* CTA Section */
.metrics-cta {
    padding: 100px 0;
    background: linear-gradient(135deg, #0A0A0A 0%, #1a1a2e 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.metrics-cta::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: #3B82F6;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    top: -100px;
    right: -100px;
}

.metrics-cta::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: #8B5CF6;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    bottom: -100px;
    left: -50px;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.metrics-cta h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 400;
    color: white;
    margin-bottom: 16px;
}

.metrics-cta h2 em {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: normal;
    font-weight: 600;
    color: #60A5FA;
}

.metrics-cta p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
}

.btn-cta {
    display: inline-block;
    background: white;
    color: #191919;
    padding: 16px 36px;
    border-radius: 100px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2);
}

/* Footer */
.metrics-footer {
    padding: 80px 0 40px;
    background: #0A0A0A;
    border-top: 1px solid #333;
}

.metrics-footer .footer-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 80px;
    margin-bottom: 60px;
}

.metrics-footer .footer-brand h2 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: normal;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #fff;
    margin-bottom: 12px;
}

.metrics-footer .footer-brand p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
}

.metrics-footer .footer-links-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.metrics-footer .footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
}

.metrics-footer .footer-col a {
    display: block;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.metrics-footer .footer-col a:hover {
    color: #fff;
}

.metrics-footer .footer-bottom {
    padding-top: 40px;
    border-top: 1px solid #333;
    text-align: center;
}

.metrics-footer .footer-bottom p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.metrics-footer .footer-bottom strong {
    color: rgba(255, 255, 255, 0.8);
}

/* Nav active state */
.nav-item.active {
    color: #191919;
    font-weight: 600;
}

/* User Profile Button */
.user-profile-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E5E5E5;
    transition: border-color 0.2s;
}

.nav-user-avatar:hover {
    border-color: #2563EB;
}

/* User Dropdown */
.user-dropdown {
    position: fixed;
    top: 70px;
    right: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 20px;
    min-width: 280px;
    z-index: 1001;
    border: 1px solid #E5E5E5;
}

.user-dropdown .user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E5E5;
}

.user-dropdown .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown .user-name {
    font-weight: 600;
    font-size: 15px;
    color: #191919;
    margin: 0;
}

.user-dropdown .user-email {
    font-size: 13px;
    color: #6B7280;
    margin: 4px 0 0 0;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: #F3F4F6;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #E5E7EB;
    color: #111827;
}

/* ============================================
   DETAIL SIDE PANEL
   ============================================ */

.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
}

.detail-overlay.open {
    opacity: 1;
    visibility: visible;
}

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100%;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1101;
    overflow: hidden;
}

.detail-panel.open {
    transform: translateX(0);
}

.detail-panel-content {
    height: 100%;
    overflow-y: auto;
    padding: 32px;
}

.detail-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    background: #F3F4F6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #374151;
}

.detail-close:hover {
    background: #E5E7EB;
    color: #111827;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-right: 48px;
}

.detail-icon {
    font-size: 48px;
    line-height: 1;
}

.detail-header h2 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #191919;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.detail-pronunciation {
    font-size: 14px;
    color: #6B7280;
    font-style: normal;
    margin: 0;
}

.detail-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.detail-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.detail-badge.essential {
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    color: white;
}

.detail-badge.frequency {
    background: #F0FDF4;
    color: #15803D;
    border: 1px solid #BBF7D0;
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.detail-section p {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    margin: 0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tags .tag {
    background: #F3F4F6;
    color: #374151;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
}

.detail-cta {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

.btn-detail-cta {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-detail-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Metric Card Hover Enhancement */
.metric-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: #2563EB;
}

/* Featured Card Hover */
.featured-card {
    cursor: pointer;
    transition: all 0.25s ease;
}

.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

/* Metrics Count */
.metrics-count {
    text-align: center;
    color: #6B7280;
    font-size: 15px;
    margin-bottom: 32px;
}

.metrics-count strong {
    color: #2563EB;
}

/* Responsive Detail Panel */
@media (max-width: 520px) {
    .detail-panel {
        width: 100%;
    }

    .detail-panel-content {
        padding: 24px 20px;
    }

    .detail-header h2 {
        font-size: 24px;
    }

    .detail-icon {
        font-size: 40px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .metrics-hero {
        padding: 120px 0 40px;
    }

    .metrics-title {
        font-size: 40px;
    }

    .metrics-subtitle {
        font-size: 16px;
    }

    .category-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .category-tab {
        flex-shrink: 0;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metrics-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .metrics-footer .footer-links-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .metrics-footer .footer-links-group {
        grid-template-columns: 1fr;
    }
}