:root {
    /* Health & Fitness Theme Colors */
    --primary: 33 150 243; /* Blue */
    --success: 76 175 80; /* Green */
    --warning: 255 193 7; /* Amber */
    --danger: 244 67 54; /* Red */
    --info: 3 169 244; /* Light Blue */
    --light: 248 249 250; /* Light Gray */
    --dark: 33 37 41; /* Dark Gray */
    
    /* Custom Health Colors */
    --health-primary: 45 125 150; /* Teal Blue */
    --health-success: 102 187 106; /* Light Green */
    --health-warning: 255 167 38; /* Orange */
    --health-danger: 239 83 80; /* Light Red */
    --health-info: 66 165 245; /* Sky Blue */
    
    /* Background Colors */
    --bg-primary: 245 248 251; /* Very Light Blue */
    --bg-secondary: 255 255 255; /* White */
    --bg-accent: 232 245 233; /* Very Light Green */
    
    /* Text Colors */
    --text-primary: 33 37 41; /* Dark */
    --text-secondary: 108 117 125; /* Gray */
    --text-muted: 134 142 150; /* Light Gray */
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Border Radius */
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: rgb(var(--text-primary));
}

/* Mobile Navigation Optimizations */
@media (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1rem;
        white-space: nowrap;
    }
    
    .navbar-brand i {
        font-size: 0.9rem;
    }
    
    .navbar-toggler {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .dropdown-toggle::after {
        display: none;
    }
    
    /* Compact mobile controls */
    .navbar .d-flex.align-items-center.d-lg-none {
        gap: 0.25rem;
    }
    
    .navbar .d-flex.align-items-center.d-lg-none .nav-link {
        padding: 0.25rem !important;
        min-width: auto;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

/* Mobile Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgb(var(--bg-secondary));
    border-top: 1px solid rgba(var(--text-muted), 0.2);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    padding: 0.5rem 0;
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgb(var(--text-secondary));
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    min-width: 60px;
    font-size: 0.75rem;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: rgb(var(--health-primary));
    text-decoration: none;
    background: rgba(var(--health-primary), 0.1);
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item span {
    font-weight: 500;
    white-space: nowrap;
}

/* Hide bottom nav on desktop */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* Show bottom nav only on mobile */
@media (max-width: 767.98px) {
    .bottom-nav {
        display: block;
    }
    
    /* Add padding to body to prevent content overlap */
    body {
        padding-bottom: 80px;
    }
    
    /* Hide desktop navigation on mobile */
    .navbar-collapse {
        display: none !important;
    }
    
    /* Adjust navbar brand on mobile */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Hide navbar toggler since we're using bottom nav */
    .navbar-toggler {
        display: none !important;
    }
}

/* Modern Search Interface */
.search-container {
    position: relative;
}

.search-input {
    padding-left: 3rem;
    border-radius: 1rem;
    border: 2px solid rgba(var(--health-primary), 0.2);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    font-size: 1rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
}

.search-input:focus {
    border-color: rgb(var(--health-primary));
    box-shadow: 0 0 0 0.25rem rgba(var(--health-primary), 0.25);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(var(--text-secondary));
    font-size: 1.1rem;
    z-index: 10;
}

.search-info {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(var(--health-info), 0.1);
    border-radius: 0.5rem;
    border-left: 3px solid rgb(var(--health-info));
}

/* Modern Food Grid */
.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

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

/* Modern Food Cards */
.food-card {
    background: rgb(var(--bg-secondary));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(var(--text-muted), 0.1);
}

.food-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.food-card-header {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--health-primary)) 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.food-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.food-name {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.food-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portion-selector,
.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portion-selector label,
.quantity-selector label {
    font-weight: 600;
    color: rgb(var(--text-primary));
    font-size: 0.875rem;
    margin-bottom: 0;
}

.portion-select {
    border-radius: var(--border-radius);
    border: 1px solid rgba(var(--text-muted), 0.3);
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.portion-select:focus {
    border-color: rgb(var(--health-primary));
    box-shadow: 0 0 0 0.125rem rgba(var(--health-primary), 0.25);
}

.quantity-input-group {
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid rgba(var(--text-muted), 0.3);
    transition: all 0.3s ease;
}

.quantity-input-group:focus-within {
    border-color: rgb(var(--health-primary));
    box-shadow: 0 0 0 0.125rem rgba(var(--health-primary), 0.25);
}

.quantity-input {
    border: none;
    padding: 0.5rem;
    flex: 1;
    background: transparent;
}

.quantity-input:focus {
    outline: none;
    box-shadow: none;
}

.quantity-unit {
    background: rgba(var(--health-primary), 0.1);
    color: rgb(var(--health-primary));
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.calories-display {
    background: rgba(var(--health-success), 0.1);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    text-align: center;
    border: 1px solid rgba(var(--health-success), 0.2);
}

.calculated-calories {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.calories-label {
    font-weight: 500;
    color: rgb(var(--text-secondary));
    font-size: 0.875rem;
}

.calories-value {
    font-weight: 700;
    color: rgb(var(--health-success));
    font-size: 1.1rem;
}

.food-card-footer {
    padding: 1rem 1.25rem;
    background: rgba(var(--light), 0.5);
    border-top: 1px solid rgba(var(--text-muted), 0.1);
}

.btn-add-food {
    width: 100%;
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-add-food:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, rgb(var(--success)) 0%, rgb(var(--health-success)) 100%);
}

.btn-add-food:active {
    transform: translateY(0);
}

/* Search Results Container */
.search-results-container {
    background: rgba(var(--health-info), 0.05);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(var(--health-info), 0.2);
    margin-bottom: 2rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgb(var(--text-secondary));
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h6 {
    margin-bottom: 0.5rem;
    color: rgb(var(--text-primary));
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Modern Food Grid */
.modern-food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.modern-food-item {
    transition: all 0.3s ease;
}

.modern-food-card {
    background: linear-gradient(145deg, rgb(var(--bg-secondary)) 0%, rgba(var(--health-success), 0.05) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(var(--health-success), 0.1);
}

.modern-food-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--health-success), 0.3);
}

.food-header-modern {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%);
    color: white;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.food-icon-modern {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.food-title-modern {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.3;
}

.modern-food-body {
    padding: 1.5rem;
}

.portion-selector-modern {
    margin-bottom: 1.25rem;
}

.modern-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: rgb(var(--text-primary));
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.modern-select {
    width: 100%;
    border-radius: var(--border-radius);
    border: 2px solid rgba(var(--health-success), 0.2);
    padding: 0.75rem;
    transition: all 0.3s ease;
    background: rgb(var(--bg-primary));
    font-size: 0.9rem;
}

.modern-select:focus {
    border-color: rgb(var(--health-success));
    box-shadow: 0 0 0 0.125rem rgba(var(--health-success), 0.25);
    outline: none;
}

.quantity-selector-modern {
    margin-bottom: 1.25rem;
}

.quantity-control-modern {
    display: flex;
    align-items: center;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid rgba(var(--health-success), 0.2);
    background: rgb(var(--bg-primary));
    margin-bottom: 0.5rem;
}

.quantity-btn-modern {
    background: rgb(var(--health-success));
    border: none;
    color: white;
    width: 40px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.quantity-btn-modern:hover {
    background: rgb(var(--success));
    transform: scale(1.05);
}

.quantity-input-modern {
    border: none;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    background: transparent;
    flex: 1;
    min-width: 0;
}

.quantity-input-modern:focus {
    outline: none;
}

.quantity-unit-modern {
    background: rgba(var(--health-success), 0.1);
    color: rgb(var(--health-success));
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius);
    margin-top: 0.25rem;
}

.calories-display-modern {
    text-align: center;
}

.calories-badge {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 120px;
    box-shadow: var(--shadow);
}

.calories-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.calories-label {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Modern Exercise Grid */
.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

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

/* Modern Exercise Cards */
.exercise-card {
    background: rgb(var(--bg-secondary));
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(var(--text-muted), 0.1);
}

.exercise-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.exercise-card-header {
    background: linear-gradient(135deg, rgb(var(--health-warning)) 0%, rgb(var(--warning)) 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exercise-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.exercise-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-name {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mets-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.mets-value {
    font-size: 0.9rem;
    font-weight: 700;
}

.mets-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

.exercise-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.duration-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.duration-selector label {
    font-weight: 600;
    color: rgb(var(--text-primary));
    font-size: 0.875rem;
    margin-bottom: 0;
}

.duration-input-group {
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid rgba(var(--text-muted), 0.3);
    transition: all 0.3s ease;
}

.duration-input-group:focus-within {
    border-color: rgb(var(--health-warning));
    box-shadow: 0 0 0 0.125rem rgba(var(--health-warning), 0.25);
}

.duration-input {
    border: none;
    padding: 0.5rem;
    flex: 1;
    background: transparent;
}

.duration-input:focus {
    outline: none;
    box-shadow: none;
}

.duration-unit {
    background: rgba(var(--health-warning), 0.1);
    color: rgb(var(--health-warning));
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.exercise-calories {
    background: rgba(var(--health-warning), 0.1);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    text-align: center;
    border: 1px solid rgba(var(--health-warning), 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.exercise-calories .calories-label {
    font-weight: 500;
    color: rgb(var(--text-secondary));
    font-size: 0.875rem;
}

.exercise-calories .calories-value {
    font-weight: 700;
    color: rgb(var(--health-warning));
    font-size: 1.1rem;
}

.exercise-card-footer {
    padding: 1rem 1.25rem;
    background: rgba(var(--light), 0.5);
    border-top: 1px solid rgba(var(--text-muted), 0.1);
}

.btn-add-exercise {
    width: 100%;
    background: linear-gradient(135deg, rgb(var(--health-warning)) 0%, rgb(var(--warning)) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-add-exercise:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, rgb(var(--warning)) 0%, rgb(var(--health-warning)) 100%);
}

.btn-add-exercise:active {
    transform: translateY(0);
}

::-webkit-scrollbar-track {
    background: rgb(var(--light));
}

::-webkit-scrollbar-thumb {
    background: rgb(var(--text-secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--text-primary));
}

/* Navigation Styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    padding-top: 80px; /* Account for fixed navbar */
}

/* Hero Section */
.hero-section {
    background: #ffffff;
    color: rgb(var(--text-primary));
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.feature-item {
    font-size: 1.1rem;
    animation: fadeInLeft 1s ease-out;
}

.feature-item:nth-child(1) { animation-delay: 0.2s; }
.feature-item:nth-child(2) { animation-delay: 0.4s; }
.feature-item:nth-child(3) { animation-delay: 0.6s; }
.feature-item:nth-child(4) { animation-delay: 0.8s; }

/* Auth Container */
.auth-container {
    animation: fadeInRight 1s ease-out;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    background: rgb(var(--bg-secondary));
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, rgb(var(--health-primary)) 0%, rgb(var(--health-info)) 100%);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    border: none;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, rgb(var(--health-primary)) 0%, rgb(var(--health-info)) 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, rgb(var(--health-warning)) 0%, rgb(var(--warning)) 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, rgb(var(--health-danger)) 0%, rgb(var(--danger)) 100%);
    color: white;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid rgba(var(--text-secondary), 0.2);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: rgb(var(--health-primary));
    box-shadow: 0 0 0 0.2rem rgba(var(--health-primary), 0.25);
}

/* Divider */
.divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(var(--text-secondary), 0.3);
}

.divider-text {
    background: rgb(var(--bg-secondary));
    padding: 0 1rem;
    color: rgb(var(--text-secondary));
    font-size: 0.9rem;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Dashboard Cards */
.card.bg-success {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, rgb(var(--health-warning)) 0%, rgb(var(--warning)) 100%) !important;
}

.card.bg-danger {
    background: linear-gradient(135deg, rgb(var(--health-danger)) 0%, rgb(var(--danger)) 100%) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, rgb(var(--health-info)) 0%, rgb(var(--info)) 100%) !important;
}

.card.bg-primary {
    background: linear-gradient(135deg, rgb(var(--health-primary)) 0%, rgb(var(--primary)) 100%) !important;
}

/* List Group Items */
.list-group-item {
    border: none;
    border-radius: var(--border-radius) !important;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow);
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: var(--border-radius);
}

.badge.bg-success {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, rgb(var(--health-warning)) 0%, rgb(var(--warning)) 100%) !important;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background: linear-gradient(135deg, rgb(var(--health-primary)) 0%, rgb(var(--health-info)) 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.table td {
    border-color: rgba(var(--text-secondary), 0.1);
    vertical-align: middle;
}

/* Food and Exercise Items */
.food-item, .exercise-item {
    transition: all 0.3s ease;
}

.food-item:hover, .exercise-item:hover {
    transform: translateY(-2px);
}

.consumption-item, .exercise-item {
    transition: all 0.3s ease;
    border-color: rgba(var(--text-secondary), 0.2) !important;
}

.consumption-item:hover, .exercise-item:hover {
    border-color: rgb(var(--health-primary)) !important;
    background-color: rgba(var(--health-primary), 0.05);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.alert-info {
    background: linear-gradient(135deg, rgba(var(--health-info), 0.1) 0%, rgba(var(--info), 0.1) 100%);
    border-left: 4px solid rgb(var(--health-info));
    color: rgb(var(--text-primary));
}

.alert-success {
    background: linear-gradient(135deg, rgba(var(--health-success), 0.1) 0%, rgba(var(--success), 0.1) 100%);
    border-left: 4px solid rgb(var(--health-success));
    color: rgb(var(--text-primary));
}

.alert-danger {
    background: linear-gradient(135deg, rgba(var(--health-danger), 0.1) 0%, rgba(var(--danger), 0.1) 100%);
    border-left: 4px solid rgb(var(--health-danger));
    color: rgb(var(--text-primary));
}

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

@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);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding-top: 70px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .feature-item {
        font-size: 1rem;
    }
}

/* Tab Navigation */
.nav-tabs {
    border: none;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: rgb(var(--text-secondary));
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border: none;
    background-color: rgba(var(--health-primary), 0.1);
    color: rgb(var(--health-primary));
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, rgb(var(--health-primary)) 0%, rgb(var(--health-info)) 100%);
    color: white !important;
    border: none;
}

/* Chart Container */
#weightChart {
    border-radius: var(--border-radius);
}

/* Custom Health Icons */
.fa-heartbeat {
    animation: heartbeat 2s ease-in-out infinite both;
}

@keyframes heartbeat {
    from {
        transform: scale(1);
    }
    10% {
        transform: scale(1.1);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.1);
    }
    40% {
        transform: scale(1);
    }
}

/* Progress Indicators */
.progress {
    border-radius: var(--border-radius);
    background-color: rgba(var(--text-secondary), 0.1);
}

.progress-bar {
    background: linear-gradient(135deg, rgb(var(--health-success)) 0%, rgb(var(--success)) 100%);
    border-radius: var(--border-radius);
}

/* Modal Customization */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, rgb(var(--health-primary)) 0%, rgb(var(--health-info)) 100%);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    border: none;
}

.modal-footer {
    border: none;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Health-specific styling */
.calorie-positive {
    color: rgb(var(--health-danger));
}

.calorie-negative {
    color: rgb(var(--health-success));
}

.weight-loss {
    color: rgb(var(--health-success));
}

.weight-gain {
    color: rgb(var(--health-warning));
}

/* Utility Classes */
.text-health-primary { color: rgb(var(--health-primary)) !important; }
.text-health-success { color: rgb(var(--health-success)) !important; }
.text-health-warning { color: rgb(var(--health-warning)) !important; }
.text-health-danger { color: rgb(var(--health-danger)) !important; }
.text-health-info { color: rgb(var(--health-info)) !important; }

.bg-health-primary { background-color: rgb(var(--health-primary)) !important; }
.bg-health-success { background-color: rgb(var(--health-success)) !important; }
.bg-health-warning { background-color: rgb(var(--health-warning)) !important; }
.bg-health-danger { background-color: rgb(var(--health-danger)) !important; }
.bg-health-info { background-color: rgb(var(--health-info)) !important; }

/* ========================================
   MODERN FOOD INTERFACE STYLES - VERSION 2.0
   ======================================== */

/* Modern Food Cards */
.modern-food-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: none;
}

.modern-food-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.modern-food-header {
    background: linear-gradient(135deg, rgb(66, 165, 245) 0%, rgb(33, 150, 243) 100%);
    color: white;
    padding: 1rem 1.25rem;
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.modern-food-body {
    padding: 1.5rem 1.25rem;
}

.modern-portion-selector {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.modern-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.quantity-btn-modern {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgb(66, 165, 245) 0%, rgb(3, 169, 244) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s ease;
    cursor: pointer;
}

.quantity-btn-modern:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(3, 169, 244, 0.3);
}

.quantity-input-modern {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    width: 80px;
    padding: 0.5rem;
}

.quantity-input-modern:focus {
    border-color: rgb(var(--primary));
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
    outline: none;
}

.calories-display-modern {
    background: linear-gradient(135deg, rgb(102, 187, 106) 0%, rgb(76, 175, 80) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 1rem 0;
}

.add-btn-modern {
    background: linear-gradient(135deg, rgb(255, 167, 38) 0%, rgb(255, 152, 0) 100%);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.add-btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
    color: white;
}

.btn-edit-food {
    background: linear-gradient(135deg, rgb(108, 117, 125) 0%, rgb(73, 80, 87) 100%);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-food:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    color: white;
}

/* Chart period selector styling */
.chart-period-selector .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    min-width: 150px;
}

.chart-period-selector .form-select:focus {
    border-color: rgb(var(--primary));
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
    outline: none;
}

/* ========================================
   NEW AUTH DESIGN STYLES - MATCHES REFERENCE IMAGES
   ======================================== */

/* Auth Tabs */
.auth-tabs {
    display: flex;
    border-radius: 12px;
    padding: 4px;
    background-color: #f1f3f4;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background-color: transparent;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    color: #5f6368;
    transition: all 0.2s ease;
    cursor: pointer;
}

.auth-tab.active {
    background-color: white;
    color: #202124;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    font-weight: 600;
}

.auth-tab:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Google Button */
.google-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background-color: white;
    color: #3c4043;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.google-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    color: #3c4043;
}

.google-btn:focus {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    outline: none;
    color: #3c4043;
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Divider */
.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #dadce0;
}

.divider-text {
    background-color: white;
    padding: 0 16px;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    color: #202124;
    background-color: white;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-input::placeholder {
    color: #9aa0a6;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    background-color: #1557b0;
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.3);
}

.auth-submit-btn:focus {
    outline: none;
    background-color: #1557b0;
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.3);
}

/* Forgot Password Link */
.forgot-link {
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover {
    color: #1557b0;
    text-decoration: underline;
}

/* Invalid Feedback */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 4px;
    font-size: 14px;
    color: #d93025;
}

.form-input.is-invalid {
    border-color: #d93025;
}

.form-input.is-invalid:focus {
    border-color: #d93025;
    box-shadow: 0 0 0 2px rgba(217, 48, 37, 0.2);
}

/* Mobile Optimization for Dashboard Summary Section */
@media (max-width: 767.98px) {
    /* Reduce hero section padding on mobile */
    #welcome-section {
        margin-bottom: 30px !important;
        padding: 30px 20px !important;
    }
    
    /* Reduce dashboard title size on mobile */
    .container h1 {
        font-size: 1.5rem !important;
        margin: 0 !important;
    }
    
    /* Reduce subtitle font size */
    .container > .row:nth-child(2) p {
        font-size: 0.85rem !important;
    }
    
    /* Summary cards - reduce padding and sizing */
    .row.mb-5 .col-md-3 {
        margin-bottom: 16px !important;
    }
    
    .card-body {
        padding: 16px !important;
    }
    
    /* Reduce card title large number font */
    .card-body h2 {
        font-size: 2rem !important;
    }
    
    /* Reduce card subtitle text */
    .card-body p {
        font-size: 0.8rem !important;
    }
    
    /* Reduce card icon size */
    .card-body .fa-utensils,
    .card-body .fa-fire-alt,
    .card-body .fa-scale-balanced,
    .card-body .fa-weight-scale {
        font-size: 1.2rem !important;
    }
    
    /* Make cards full width on mobile for better use of space */
    .col-md-3 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Further optimization for very small screens */
@media (max-width: 575.98px) {
    #welcome-section {
        padding: 20px 15px !important;
        margin-bottom: 20px !important;
    }
    
    .container h1 {
        font-size: 1.2rem !important;
    }
    
    .card-body {
        padding: 12px !important;
    }
    
    .card-body h2 {
        font-size: 1.5rem !important;
    }
    
    .card-body p {
        font-size: 0.75rem !important;
    }
}

/* COMPREHENSIVE MOBILE-FIRST OPTIMIZATION */

/* Extra Small Phones (xs: <576px) */
@media (max-width: 575.98px) {
    /* Container padding */
    .container {
        padding: 0 10px !important;
    }
    
    /* Hero/Welcome section */
    #welcome-section {
        padding: 15px 12px !important;
        margin-bottom: 15px !important;
        border-radius: 12px !important;
    }
    
    #welcome-section h2 {
        font-size: 1.8rem !important;
    }
    
    #welcome-section p {
        font-size: 0.9rem !important;
    }
    
    /* Dashboard title */
    .container > .row:nth-child(2) h1 {
        font-size: 1.3rem !important;
    }
    
    .container > .row:nth-child(2) p {
        font-size: 0.75rem !important;
    }
    
    /* Summary cards - even smaller on phones */
    .row.mb-5 > [class*="col"] {
        margin-bottom: 12px !important;
    }
    
    .card {
        border-radius: 12px !important;
    }
    
    .card-body {
        padding: 12px !important;
    }
    
    .card-body h2 {
        font-size: 1.8rem !important;
    }
    
    .card-body p {
        font-size: 0.75rem !important;
    }
    
    .card-body .fa-utensils,
    .card-body .fa-fire-alt,
    .card-body .fa-scale-balanced,
    .card-body .fa-weight-scale {
        font-size: 1.2rem !important;
    }
    
    /* Quick action buttons */
    .btn {
        padding: 16px 12px !important;
        font-size: 0.85rem !important;
    }
    
    /* Forms */
    .form-input {
        padding: 12px 10px !important;
        font-size: 15px !important;
    }
    
    /* Charts/Graphs containers */
    canvas {
        max-height: 300px !important;
    }
}

/* Small Tablets (sm: 576px-767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    #welcome-section {
        padding: 25px 20px !important;
        margin-bottom: 25px !important;
    }
    
    #welcome-section h2 {
        font-size: 2rem !important;
    }
    
    .card-body {
        padding: 16px !important;
    }
    
    .card-body h2 {
        font-size: 2.2rem !important;
    }
}

/* Full responsive - all text elements */
@media (max-width: 991.98px) {
    /* Navbar optimization */
    .navbar {
        padding: 0.5rem 0 !important;
    }
    
    .navbar-brand {
        font-size: 1rem !important;
    }
    
    /* Stack sections properly */
    .row {
        margin: 0 -8px !important;
    }
    
    [class*="col-"] {
        padding: 0 8px !important;
    }
    
    /* Bottom spacing reduction */
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-6 {
        margin-bottom: 1.5rem !important;
    }
}

/* Modal responsiveness */
.modal-content {
    border-radius: 12px !important;
}

@media (max-width: 575.98px) {
    .modal {
        padding: 0 !important;
    }
    
    .modal-content {
        border-radius: 8px !important;
    }
    
    .modal-body {
        padding: 16px !important;
    }
    
    .modal-header {
        padding: 16px !important;
    }
}

/* Input focus optimization for touch devices */
input:focus,
textarea:focus,
select:focus {
    font-size: 16px !important;
}

/* Ensure buttons are easily tappable (44px minimum) */
button,
.btn,
a.btn {
    min-height: 44px !important;
    min-width: 44px !important;
}

/* Scrolling optimization */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-font-smoothing: antialiased;
    -webkit-touch-callout: none;
}
