/* Shujaa Wellness Platform Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-steps: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-calories: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-distance: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-heart: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --border-radius: 8px;

    /* Light theme colors */
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --navbar-bg: #ffffff;
    --border-color: #dee2e6;
}

/* Dark theme */
.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --navbar-bg: #2d2d2d;
    --border-color: #444444;
    --light-color: #2d2d2d;
    --dark-color: #ffffff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode .card,
.dark-mode .stat-card,
.dark-mode .navbar {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

.dark-mode .text-muted {
    color: #999999 !important;
}

.dark-mode .border {
    border-color: var(--border-color) !important;
}

/* Minet Wellness Red Color Theme */
:root {
    --primary_gradient: linear-gradient(135deg, #E53E3E 0%, #DC143C 100%);
    --secondary_gradient: linear-gradient(135deg, #DC143C 0%, #B91C1C 100%);
    --success_gradient: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    --warning_gradient: linear-gradient(135deg, #F39C12 0%, #E67E22 100%);
    --bg_primary: #FEFEFE;
    --bg_secondary: #FEF5F5;
    --card_bg: #FFFFFF;
    --glass_bg: rgba(255, 255, 255, 0.95);
    --text_primary: #2D3748;
    --text_secondary: #4A5568;
    --text_muted: #718096;
    --accent_color: #E53E3E;
    --success_color: #2ECC71;
    --border_color: rgba(229, 62, 62, 0.15);
    --shadow_glow: 0 8px 32px rgba(229, 62, 62, 0.25);
    --shadow_card: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg_primary: #0a0a0a;
    --bg_secondary: #1a1a1a;
    --card_bg: #1a1a1a;
    --glass_bg: rgba(26, 26, 26, 0.95);
    --text_primary: #ffffff;
    --text_secondary: #b3b3b3;
    --text_muted: #666666;
    --border_color: rgba(255, 255, 255, 0.1);
    --shadow_card: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg_primary);
    color: var(--text_primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Navigation */
.navbar {
    background: var(--card_bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border_color);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Compact navigation styles */
.nav-link.small {
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-link.small:hover {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .navbar-nav {
        gap: 0.5rem !important;
    }

    .nav-link.small {
        padding: 0.25rem 0.5rem !important;
    }
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--primary_gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text_secondary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent_color) !important;
}

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hero Stats Section */
.hero-stats {
    background: var(--bg_primary);
    padding: 60px 0 20px;
    position: relative;
}

.hero-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
}

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

.stat-card {
    background: var(--card_bg);
    border: 1px solid var(--border_color);
    border-radius: 12px;
    padding: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow_card);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow_glow);
    border_color: var(--accent_color);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary_gradient);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--primary_gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text_secondary);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--success_color);
}

/* Activity Feed */
.activity-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text_primary);
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg_secondary);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(255, 107, 53, 0.1);
    transform: translateX(5px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    color: white;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text_primary);
    margin-bottom: 0.25rem;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text_muted);
    margin-top: 0.5rem;
}

.activity-breakdown {
    margin: 0.25rem 0;
}

.activity-breakdown small {
    font-size: 0.8rem;
}

.gradient-text {
    background: var(--primary_gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.activity-points {
    background: var(--success_gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.activity-points.high-points {
    background: var(--warning_gradient);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.activity-emoji {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.7rem;
    z-index: 2;
}

.activity-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-weight: 500;
}

.admin-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.high-performance {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.good-performance {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
    color: white;
}

.activity-icon {
    position: relative;
    overflow: visible;
}

.activity-item:nth-child(odd) {
    background: rgba(255, 107, 53, 0.02);
}

.activity-item:nth-child(even) {
    background: rgba(102, 126, 234, 0.02);
}

/* Charts */
.chart-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.chart-title {
    color: var(--text_primary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px !important;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--card_bg);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border_color);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow_color);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, var(--primary_gradient));
    color: white;
    border_color: var(--primary);
}

.leaderboard-sync {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.leaderboard-rank.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); }
.leaderboard-rank.rank-2 { background: linear-gradient(135deg, #C0C0C0, #808080); }
.leaderboard-rank.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); }
.leaderboard-rank.rank-other { background: var(--primary_gradient); }

.leaderboard-user {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text_primary);
    margin-bottom: 0.25rem;
}

.leaderboard-stats {
    font-size: 0.85rem;
    color: var(--text_secondary);
}

.leaderboard-stats > div {
    margin-bottom: 0.2rem;
}

.leaderboard-points {
    text-align: right;
}

.leaderboard-points-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent_color);
}

.leaderboard-points-label {
    font-size: 0.7rem;
    color: var(--text_secondary);
    text-transform: uppercase;
}

/* Utility Classes */
.gradient-steps { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gradient-calories { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.gradient-distance { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.gradient-heart { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.gradient-points { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.gradient-level { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }

.loading-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Progress Ring */
.progress-ring {
    position: relative;
    margin: 2rem auto;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring .bg {
    fill: none;
    stroke: var(--border_color);
    stroke-width: 8;
    cx: 60;
    cy: 60;
    r: 50;
}

.progress-ring .progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    cx: 60;
    cy: 60;
    r: 50;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 0.5s ease;
}

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

.ring-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent_color);
}

.ring-label {
    font-size: 0.8rem;
    color: var(--text_secondary);
    text-transform: uppercase;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.action-btn {
    background: var(--card_bg);
    border: 1px solid var(--border_color);
    border-radius: 10px;
    padding: 1rem 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text_primary);
    box-shadow: var(--shadow_card);
}

.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.1rem;
    color: white;
}

.action-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Sync Status */
.sync-status {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 170, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Badges */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.badge-card {
    background: var(--card_bg);
    border: 1px solid var(--border_color);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0.6;
    box-shadow: var(--shadow_card);
}

.badge-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.goal-suggestions .btn {
    min-width: 90px;
}

.goal-suggestions {
    background: var(--bg_secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow_glow);
}

.modal-header {
    border-bottom: 1px solid var(--border_color);
    background: var(--bg_secondary);
    border-radius: 16px 16px 0 0;
}

.badge-name {
    font-weight: 600;
    color: var(--text_primary);
    margin-bottom: 0.5rem;
}

.badge-description {
    color: var(--text_secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.badge-status {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--success_color);
    text-transform: uppercase;
}

/* Sync Indicator */
.sync-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent_color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateY(100px);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.sync-indicator.show {
    transform: translateY(0);
}

/* Notifications */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.notification {
    background: var(--card_bg);
    border: 1px solid var(--border_color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow_card);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success_color);
    background: rgba(0, 212, 170, 0.05);
}

.notification.error {
    border-left: 4px solid #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.notification.info {
    border-left: 4px solid #0dcaf0;
    background: rgba(13, 202, 240, 0.05);
}

/* Login Card */
.login-card {
    background: var(--card_bg);
    border: 1px solid var(--border_color);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow_card);
}

.login-btn {
    width: 100%;
    background: var(--primary_gradient);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow_glow);
}

.login-btn.google-btn {
    background: var(--secondary_gradient);
}

/* User Profile */
.user-profile {
    padding-top: 80px;
}

/* Username Display */
.username-display {
    color: var(--text_primary) !important;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Activity Points Styles */
.activity-points.zero-points {
    background: var(--bg_secondary);
    color: var(--text_muted);
    border: 1px solid var(--border_color);
}

.activity-breakdown {
    margin: 0.25rem 0;
}

.activity-breakdown small {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Enhanced Leaderboard */
.leaderboard-stats {
    line-height: 1.4;
}

.leaderboard-stats > div {
    margin-bottom: 0.2rem;
}

.leaderboard-points {
    min-width: 80px;
}

/* Login Section */
.login-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-section .card {
    border: none;
    box-shadow: var(--shadow_md);
    border-radius: var(--border_radius);
}

/* User Profile Display */
#userProfile {
    display: none;
}

/* User Menu Dropdown Responsive */
.dropdown-menu {
    min-width: 200px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.6rem;
    }

    .stat-value {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 0.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
        line-height: 1.1;
    }

    .stat-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .hero-stats {
        padding: 20px 0 15px;
    }

    .username-display {
        max-width: 80px;
    }

    /* Container padding adjustments */
    .container-fluid {
        padding: 0.5rem;
    }

    /* Chart responsiveness */
    .chart-container {
        padding: 1rem;
        height: auto;
        min-height: 250px;
    }

    .chart-container canvas {
        max-height: 200px !important;
        height: 200px !important;
    }

    .chart-container h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    /* Activity cards mobile optimization */
    .activity-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .activity-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-right: 0.75rem;
    }

    .activity-title {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .activity-meta {
        font-size: 0.75rem;
    }

    /* Leaderboard mobile fixes */
    .leaderboard-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .leaderboard-rank {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        margin-right: 0.75rem;
    }

    .leaderboard-name {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .leaderboard-stats {
        font-size: 0.75rem;
        lineheight: 1.1;
        Thetask is toadd gap: 0.2rem;
    }

    .leaderboard-points-value {
        font-size: 1.1rem;
    }

    /* Fix dropdown positioning on mobile */
    .dropdown-menu {
        right: 0 !important;
        left: auto !important;
        transform: translateX(0) !important;
        margin-top: 0.5rem;
        min-width: 180px;
        max-width: 250px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border: 1px solid var(--border_color);
    }

    /* Ensure dropdown stays within viewport */
    .navbar .dropdown {
        position: static;
    }

    .navbar .dropdown-menu {
        position: absolute;
        right: 1rem;
        left: auto;
        top: 100%;
        margin-top: 0.25rem;
    }

    /* Section spacing */
    .activity-section {
        padding: 1rem;
        margin: 1rem 0;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    /* Badge grid mobile */
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .badge-card {
        padding: 0.75rem;
    }

    .badge-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .badge-name {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .badge-description {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .username-display {
        max-width: 60px;
    }

    /* Ultra-mobile optimizations */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem;
        text-align: center;
    }

    .stat-header {
        justify-content: center;
        margin-bottom: 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Chart text spacing fixes */
    .chart-container {
        padding: 0.75rem;
        height: auto;
        min-height: 200px;
    }

    .chart-container canvas {
        max-height: 180px !important;
        height: 180px !important;
    }

    /* Chart title spacing */
    .chart-container h3 {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Activity feed ultra-mobile */
    .activity-item {
        padding: 0.6rem;
        border-radius: 8px;
    }

    .activity-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin-right: 0.6rem;
    }

    .activity-title {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .activity-meta {
        font-size: 0.7rem;
        margin-top: 0.3rem;
    }

    /* Leaderboard ultra-mobile */
    .leaderboard-item {
        padding: 0.6rem;
        border-radius: 8px;
    }

    .leaderboard-rank {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        margin-right: 0.6rem;
    }

    .leaderboard-name {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .leaderboard-stats {
        font-size: 0.7rem;
        line-height: 1.1;
    }

    .leaderboard-points-value {
        font-size: 1rem;
    }

    /* Badge grid ultra-mobile */
    .badges-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .badge-card {
        padding: 0.6rem;
        text-align: center;
    }

    /* More aggressive mobile positioning */
    .dropdown-menu {
        right: 0.5rem !important;
        left: auto !important;
        min-width: 160px;
        font-size: 0.9rem;
    }

    .dropdown-item {
        padding: 0.5rem 1rem;
    }

    .dropdown-item i {
        font-size: 0.8rem;
    }

    /* Navigation mobile fixes */
    .navbar {
        padding: 0.25rem 0;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .nav-link.small {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem !important;
    }

    /* Install prompt mobile */
    .install-prompt {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .install-content {
        gap: 0.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    .install-btn {
        padding: 0.5rem;
        font-size: 0.85rem;
        width: 100%;
    }
}

/* Loading States */
.loading-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Touch-friendly mobile improvements */
@media (max-width: 768px) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem !important;
    }

    /* Improve text readability */
    body {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }

    /* Better spacing for cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .card-body {
        padding: 1rem;
    }

    /* Improve form inputs */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    /* Better modal spacing */
    .modal-dialog {
        margin: 1rem;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }
}

/* Ultra-mobile specific improvements */
@media (max-width: 576px) {
    /* Even better touch targets */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
    }

    /* Larger text for readability */
    body {
        font-size: 1rem;
    }

    /* Better table responsiveness */
    .table-responsive {
        font-size: 0.85rem;
    }

    .table th, .table td {
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* Improve alert spacing */
    .alert {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    /* Better progress bar visibility */
    .progress {
        height: 8px;
        border-radius: 4px;
    }

    /* Improve badge spacing */
    .badge {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 6px;
    }
}

/* Chart Responsive */
.chart-container canvas {
    max-height: 300px !important;
    width: 100% !important;
}

/* Enhanced Chart Styles */
.chart-header {
    border-bottom: 1px solid var(--border_color);
    padding-bottom: 0.5rem;
}

.chart-status .badge {
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

Adding PWA install prompt styles to the CSS file.This CSS file provides styles for the Shujaa Wellness Platform, incorporating light and dark themes, a Minet Wellness Red Color Theme, and responsive design.
```text
.chart-summary {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Leaderboard Filters */
.leaderboard-filters .btn {
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.leaderboard-filters .btn.active {
    background: var(--primary_gradient);
    border_color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Enhanced Stat Cards */
.stat-card.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.stat-card.bg-gradient-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
}

.stat-card.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

/* Chart Grid Enhancements */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;

        gap: 1.5rem;
    }

    .leaderboard-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .leaderboard-filters .btn {
        flex: 1;
        min-width: 70px;
    }
}

/* Real-time indicators */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.chart-status .badge.bg-success {
    position: relative;
}

.chart-status .badge.bg-success::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Leaderboard Table Styles */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
    font-weight: 600;
}

.table thead th {
    background: #f8f9fa;
    color: #000000 !important;
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table tbody tr.table-primary {
    --bs-table-accent-bg: rgba(13, 110, 253, 0.1);
    border_color: rgba(13, 110, 253, 0.2);
}

.progress {
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

.progress-bar {
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .avatar-sm {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .hero-stats {
        padding: 40px 0 20px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .action-btn {
        padding: 1.5rem 0.5rem;
    }

    .action-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .navbar-nav {
        gap: 1rem !important;
    }

    .notification {
        max-width: 280px;
        margin-right: 1rem;
    }
}

/* Enhanced Card Styling */
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border_color: #cbd5e0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #f7fafc;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--primary_gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text_secondary);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Enhanced Activity Cards */
.activity-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.activity-item:hover {
    background: #f7fafc;
    transform: translateX(5px);
    border_color: #cbd5e0;
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    color: white;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 700;
    color: var(--text_primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text_muted);
    margin-top: 0.75rem;
}

.activity-points {
    background: var(--success_gradient);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.activity-points.high-points {
    background: var(--warning_gradient);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    animation: pulse 2s infinite;
}

/* Enhanced Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border_color: #cbd5e0;
}

.leaderboard-item.current-user {
    background: #f8f9fa !important;
    border: 2px solid #007bff;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.15);
}

.alert-info {
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1976d2;
}

.rank-badge.rank-1 { 
    background: linear-gradient(135deg, #FFD700, #FFA500);
    font-size: 1.2rem;
}
.rank-badge.rank-2 { 
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    font-size: 1.2rem;
}
.rank-badge.rank-3 { 
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    font-size: 1.2rem;
}
.rank-badge.rank-other { 
    background: var(--primary-gradient);
}

.leaderboard-rank {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    margin-right: 1rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaderboard-rank.rank-1 { 
    background: linear-gradient(135deg, #FFD700, #FFA500);
    font-size: 1.2rem;
}
.leaderboard-rank.rank-2 { 
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    font-size: 1.2rem;
}
.leaderboard-rank.rank-3 { 
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    font-size: 1.2rem;
}
.leaderboard-rank.rank-other { 
    background: var(--primary_gradient);
}

.leaderboard-user {
    flex: 1;
}

.leaderboard-name {
    font-weight: 700;
    color: var(--text_primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text_secondary);
}

.leaderboard-points {
    text-align: right;
}

.leaderboard-points-value {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary_gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-points-label {
    font-size: 0.7rem;
    color: var(--text_secondary);
    text-transform: uppercase;
    font-weight: 600;
}

/* Enhanced Badge Cards */
.badge-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.badge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.badge-card.earned {
    opacity: 1;
    border_color: #a0aec0;
    background: #ffffff;
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.badge-name {
    font-weight: 700;
    color: var(--text_primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.badge-description {
    color: var(--text_secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.badge-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status.earned {
    color: var(--success_color);
}

/* Charts Section */
.charts-section {
    margin-top: 2rem;
    padding: 1rem;
}

.charts-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text_primary);
    font-size: 1.5rem;
    font-weight: 600;
    }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.chart-container {
    background: #ffffff !important;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border_color);
    height: 350px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin: 0 0 1rem 0;
    color: var(--text_primary);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.chart-container canvas {
    height: 280px !important;
    width: 100% !important;
}

/* Chart Grid */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Hide charts when no data */
.charts-section[style*="display: none"] {
    display: none !important;
}

/* User Menu Styles */
#userMenu {
    display: none; /* Hidden by default, shown when authenticated */
}

#userMenu.show, 
#userMenu[style*="display: block"] {
    display: block !important;
}

.dropdown-menu {
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color, #dee2e6);
}

.username-display {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Login Interface Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

/* Leaderboard Styles */
.leaderboard-item {
    background: var(--card-background);
    border: 1px solid var(--border_color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow_color);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid var(--primary_color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.leaderboard-item.current-user .username {
    color: var(--primary_color);
    font-weight: 600;
}

        .gradient-distance {
            background: linear-gradient(135deg, #E53E3E 0%, #DC143C 100%);
        }

        .gradient-cycling {
            background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
        }

/* Leaderboard Stats Cards - White Background */
.leaderboard-stats-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.leaderboard-stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.leaderboard-stats-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text_primary) !important;
    margin-bottom: 0.5rem;
}

.leaderboard-stats-card .stat-label {```text
    color: var(--text_secondary) !important;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Professional Meal Analysis Styles */
.analysis-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.wellness-assessment {
    transition: all 0.3s ease;
}

.wellness-assessment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nutrition-metrics .metric-item {
    transition: all 0.3s ease;
}

.nutrition-metrics .metric-item:hover {
    transform: scale(1.05);
}

.detected-foods-grid {
    min-height: 60px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.food-item .badge {
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.food-item .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.recommendation-card {
    transition: all 0.3s ease;
    border-width: 1px !important;
}

.recommendation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.alternative-card {
    transition: all 0.3s ease;
    border-width: 1px !important;
}

.alternative-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.alternative-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.tip-card, .improvement-card {
    transition: all 0.3s ease;
}

.tip-card:hover, .improvement-card:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.wellness-reminder {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.local-guidance {
    position: relative;
    overflow: hidden;
}

.local-guidance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
}

.professional-summary {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%) !important;
    position: relative;
    overflow: hidden;
}

.professional-summary::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="3" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.professional-summary > * {
    position: relative;
    z-index: 1;
}

.grade-a, .grade-aplus { 
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white; 
}
.grade-aminus { 
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white; 
}
.grade-b, .grade-bplus { 
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    color: white; 
}
.grade-bminus { 
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white; 
}
.grade-c, .grade-cplus { 
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: black; 
}
.grade-cminus { 
    background: linear-gradient(135deg, #fd7e14 0%, #e83e8c 100%);
    color: white; 
}
.grade-d, .grade-dminus { 
    background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
    color: white; 
}
.grade-f { 
    background: linear-gradient(135deg, #dc3545 0%, #721c24 100%);
    color: white; 
}

/* Responsive Design */
@media (max-width: 768px) {
    .nutrition-metrics {
        margin-bottom: 1rem;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }

    .professional-summary {
        text-align: center;
    }
}

/* Animation for cards */
.card {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Meal Analysis Styles - World Class Responsive Design */
.meal-analysis-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin: 1rem 0;
    overflow: hidden;
}

.analysis-header {
    border-bottom: 3px solid #e9ecef;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.analysis-header h4 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

/* Grade badges with better contrast */
.grade-a, .grade-aplus { 
    background: linear-gradient(45deg, #28a745, #20c997) !important; 
    color: white !important;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.grade-b, .grade-bplus { 
    background: linear-gradient(45deg, #17a2b8, #6610f2) !important; 
    color: white !important;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.grade-c, .grade-cplus { 
    background: linear-gradient(45deg, #ffc107, #fd7e14) !important; 
}

/* Enhancements to meal analysis components, including styling and responsiveness.

/* Meal Analysis Styles */
.analysis-content {
    max-width: 100%;
    margin: 0 auto;
}

.metric-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.calorie-badge, .points-badge {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

.analysis-section {
    margin-bottom: 1.5rem;
}

.section-title {
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.food-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.food-tag {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
}

.recommendations-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.recommendation-card {
    background: white;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hydration-reminder {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
}

.grade-a, .grade-aplus {
    background: #28a745 !important;
    color: white !important;
}

.grade-b, .grade-bplus {
    background: #ffc107 !important;
    color: #212529 !important;
}

.grade-c, .grade-cplus {
    background: #fd7e14 !important;
    color: white !important;
}

.grade-d, .grade-f {
    background: #dc3545 !important;
    color: white !important;
}

/* Enhanced Analysis Display */
#mealAnalysisResults .alert {
    border: none;
    border-left: 4px solid;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#mealAnalysisResults .alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
}

#mealAnalysisResults .alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
}

#mealAnalysisResults .alert-success {
    border-left-color: #28a745;
    background-color: #d4edda;
}

#mealAnalysisResults .alert-primary {
    border-left-color: #007bff;
    background-color: #d1ecf1;
}

#mealAnalysisResults .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

#mealAnalysisResults .bg-light:hover {
    background-color: #e9ecef !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.meal-analysis-loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.meal-analysis-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* PWA-specific styles */
.pwa-mode {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.pwa-mode .navbar {
    padding-top: calc(env(safe-area-inset-top) + 0.5rem);
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #E53E3E 0%, #DC143C 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: none;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: calc(100vw - 40px);
    min-width: 280px;
}

@media (max-width: 768px) {
    .install-prompt {
        bottom: env(safe-area-inset-bottom, 20px);
        padding: 0.75rem 1rem;
        border-radius: 12px;
        min-width: 260px;
    }

    .install-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .install-text {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .install-btn {
        white-space: nowrap;
        min-width: 100px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.install-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.install-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea67a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

.install-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.close-btn {
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    margin-left: auto;
    opacity: 0.8;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.install-text {
    flex: 1;
    min-width: 140px;
    font-weight: 500;
    line-height: 1.3;
}

/* Small screens (phones) */
@media (max-width: 576px) {
    .install-prompt {
        bottom: 15px;
        left: 15px;
        right: 15px;
        transform: none;
        padding: 1rem;
        min-width: auto;
        max-width: none;
        border-radius: 12px;
    }

    .install-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .install-text {
        font-size: 0.9rem;
        min-width: auto;
    }

    .install-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        margin: 0;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
}

/* Medium screens (tablets) */
@media (max-width: 768px) and (min-width: 577px) {
    .install-prompt {
        bottom: 15px;
        left: 20px;
        right: 20px;
        transform: none;
        padding: 1rem 1.25rem;
        min-width: auto;
        max-width: none;
    }

    .install-content {
        gap: 0.75rem;
    }

    .install-text {
        font-size: 0.9rem;
    }

    .install-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* Large screens */
@media (min-width: 769px) {
    .install-prompt {
        max-width: 450px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(100%) scale(0.9);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}