/* Dark mode overrides for history and global */
body.dark-mode {
    background-color: #181a1b !important;
    color: #fff !important;
}
body.dark-mode .navbar, body.dark-mode .navbar-light {
    background-color: #23272b !important;
}
body.dark-mode .card, body.dark-mode .card-body {
    background-color: #23272b !important;
    color: #fff !important;
}
body.dark-mode .form-control, body.dark-mode .form-select {
    background-color: #181a1b !important;
    color: #fff !important;
    border-color: #444 !important;
}
body.dark-mode .table {
    color: #fff !important;
}
body.dark-mode .text-muted {
    color: #b0b0b0 !important;
}
/* Custom vibrant green for Add button */
.btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
}
/**
 * Custom CSS for Protein Tracking Application
 * Built on top of Bootstrap 5.3
 */

/* ============================================
   Root Variables & Theme Colors
   ============================================ */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --transition-speed: 0.3s;
    --border-radius: 0.25rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ============================================
   Global Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    box-shadow: var(--box-shadow);
    padding: 0.22rem 0;
    min-height: 40px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.04rem;
    display: flex;
    align-items: center;
    padding: 0.22rem 0;
}

.navbar-brand i {
    font-size: 1.37rem;
}

@media (min-width: 768px) {
    .navbar {
        padding: 0.34rem 0;
        min-height: 44px;
    }
    
    .navbar-brand {
        font-size: 1.16rem;
    }
    
    .navbar-brand i {
        font-size: 1.37rem;
    }
}

@media (min-width: 992px) {
    .navbar {
        padding: 0.42rem 0;
        min-height: 48px;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-brand i {
        font-size: 1.48rem;
    }
}

.nav-link {
    font-weight: 500;
    transition: all var(--transition-speed);
    padding: 0.42rem 0.84rem !important;
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    font-size: 0.84rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* User name in navbar */
.navbar-text {
    font-size: 0.84rem;
    padding: 0.42rem 0.84rem;
}

/* Mobile dropdown menu - larger tap targets */
@media (max-width: 991px) {
    .navbar-collapse .nav-link {
        padding: 0.6rem 0.84rem !important;
        font-size: 0.92rem !important;
        margin: 0.22rem 0;
    }
    
    .navbar-collapse .nav-link i {
        font-size: 1rem;
        margin-right: 0.42rem;
    }
    
    .navbar-text {
        font-size: 0.96rem;
        padding: 0.6rem 0.84rem;
    }
}

/* ============================================
   Cards
   ============================================ */
 .card {
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.06);
    transition: all var(--transition-speed);
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
}

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

.card-title {
    color: var(--dark-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.6s ease;
}

/* ============================================
   Forms
   ============================================ */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border-radius: var(--border-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

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

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

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Add Food Form Submit Button - Light Blue */
#addFoodForm button[type="submit"].btn-success {
    background-color: #87ceeb;
    border-color: #87ceeb;
    color: #fff;
}

#addFoodForm button[type="submit"].btn-success:hover {
    background-color: #70b8d4;
    border-color: #70b8d4;
    color: #fff;
}

/* Button Group for Radio Buttons */
.btn-group .btn {
    border: 2px solid var(--primary-color);
}

.btn-group .btn-check:checked + .btn {
    background-color: var(--primary-color);
    color: white;
}

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

.table thead {
    background-color: var(--light-color);
    font-weight: 600;
}

.table tbody tr {
    transition: all var(--transition-speed);
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table td, .table th {
    vertical-align: middle;
    padding: 1rem;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}

.alert-dismissible .btn-close {
    padding: 1.25rem;
}

/* ============================================
   Autocomplete (jQuery UI)
   ============================================ */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    border: 2px solid var(--primary-color);
    z-index: 1050;
}

.ui-menu-item {
    padding: 0;
}

.ui-menu-item-wrapper {
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.ui-menu-item-wrapper:hover,
.ui-menu-item-wrapper.ui-state-active {
    background-color: var(--primary-color);
    color: white;
    border: none;
    margin: 0;
}

.ui-state-disabled {
    padding: 0.75rem 1rem;
    color: var(--secondary-color);
    font-style: italic;
}

.autocomplete-item {
    display: block;
}

.autocomplete-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.autocomplete-item small {
    font-size: 0.875rem;
}

/* ============================================
   Custom Autocomplete Dropdown (Bootstrap-based)
   ============================================ */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    z-index: 1050;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-dropdown .autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    border-bottom: 1px solid #eee;
}

.autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown .autocomplete-item:hover,
.autocomplete-dropdown .autocomplete-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.autocomplete-dropdown .autocomplete-item:hover small,
.autocomplete-dropdown .autocomplete-item.selected small {
    color: rgba(255, 255, 255, 0.8);
}

.autocomplete-dropdown .autocomplete-item.disabled {
    color: var(--secondary-color);
    font-style: italic;
    cursor: not-allowed;
    background-color: transparent;
}

.autocomplete-dropdown .autocomplete-item.disabled:hover {
    background-color: transparent;
    color: var(--secondary-color);
}

/* Dark mode support for custom autocomplete */
body.dark-mode .autocomplete-dropdown {
    background-color: #16213e;
    border-color: #0d6efd;
}

body.dark-mode .autocomplete-dropdown .autocomplete-item {
    border-bottom-color: #1a3a5c;
}

body.dark-mode .autocomplete-dropdown .autocomplete-item:hover,
body.dark-mode .autocomplete-dropdown .autocomplete-item.selected {
    background-color: #0d6efd;
}

/* ============================================
   Custom Components
   ============================================ */

/* Empty State */
#emptyState {
    padding: 3rem 1rem;
}

#emptyState i {
    opacity: 0.3;
}

/* Progress Emoji */
#progressEmoji {
    font-size: 4rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Motivation Text */
#motivationText {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Date Selector */
#dateSelector {
    border: 2px solid #d0d0d0;
    font-weight: 500;
    cursor: pointer;
}

#dateSelector:hover {
    background-color: rgba(208, 208, 208, 0.1);
    border-color: #b0b0b0;
}

/* ============================================
   Statistics Cards
   ============================================ */
.card.text-center i {
    opacity: 0.8;
}

.card.text-center h3 {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 2rem;
}

/* ============================================
   Chart Styles
   ============================================ */
#proteinChart {
    max-height: 400px;
}

/* Chart mobile - same height as monthly chart */
@media (max-width: 767px) {
    #proteinChart {
        max-height: 300px !important;
    }
}

/* ============================================
   Loading States
   ============================================ */
.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Mobile-First Responsive Design
   ============================================ */

/* Mobile default styles (up to 768px) */
.container {
    padding: 0.5rem !important;
}

.container.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.card {
    margin-bottom: 0.5rem !important;
}

.card-body {
    padding: 0.5rem !important;
}

.card-body.py-1 {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.navbar {
    padding: 0.42rem 0 !important;
    min-height: 48px !important;
}

.navbar-collapse {
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
}

.navbar-brand {
    font-size: 1.04rem !important;
    padding: 0.22rem 0 !important;
}

.navbar-brand i {
    font-size: 1.37rem !important;
}

.nav-link {
    padding: 0.54rem 0.84rem !important;
    font-size: 0.84rem;
}

/* Collapsed mobile menu - even larger */
.navbar-collapse.show .nav-link,
.navbar-collapse.collapsing .nav-link {
    padding: 0.72rem 1.05rem !important;
    font-size: 0.96rem !important;
}

.form-control, .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.form-label {
    font-size: 0.875rem;
    margin-bottom: 0.1rem;
}

/* Form labels in add food form - even smaller spacing */
#addFoodForm .form-label {
    margin-bottom: 0.05rem !important;
}

#addFoodForm .row > div {
    margin-bottom: 0.25rem;
}

.btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.table {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.table td, .table th {
    padding: 0.5rem 0.375rem;
    vertical-align: middle;
}

/* Entries table - reduce row height */
#entriesTableBody td {
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
}

#entriesList table thead th {
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
}

/* History table - reduce row height */
#historyTableBody td {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

.history-row-clickable {
    transition: background-color var(--transition-speed);
}

.history-row-clickable:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.375rem;
}

h6.card-title {
    margin-bottom: 0.375rem !important;
}

h6 {
    font-size: 1rem;
}

/* Progress bar mobile */
.progress {
    height: 24px !important;
}

.progress-bar {
    font-size: 0.75rem !important;
}

#progressEmoji {
    font-size: 2rem !important;
}

.motivationText {
    font-size: 0.7rem !important;
}

/* Quick select buttons styled in main Quick Select Products section */
/* Grid layout is defined in main Quick Select Products section below */

/* Form spacing mobile */
#addFoodForm .row {
    margin: 0;
}

#addFoodForm .col-md-4,
#addFoodForm .col-md-3,
#addFoodForm .col-md-2 {
    margin-bottom: 0.375rem;
    padding: 0 0.25rem;
}

/* Date selector mobile */
#dateSelector {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
    width: auto;
    max-width: 150px;
}

/* Empty state mobile */
#emptyState {
    padding: 2rem 1rem;
}

#emptyState i {
    font-size: 2rem;
}

/* Tablet and up (768px+) */
@media (min-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .progress {
        height: 32px;
    }
    
    #progressEmoji {
        font-size: 3rem;
    }
}

/* Desktop and up (992px+) */
@media (min-width: 992px) {
    .container {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1.2rem 1.5rem 1.2rem 1.5rem;
    }
    
    .progress {
        height: 36px;
    }
    
    #progressEmoji {
        font-size: 3.5rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
    box-shadow: var(--box-shadow-lg) !important;
}

.rounded-lg {
    border-radius: var(--border-radius) !important;
}

.fw-bold {
    font-weight: 600 !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    .btn,
    #addFoodForm {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        background-color: white;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */

/* Dark mode class-based (toggle) */
body.dark-mode {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #16213e !important;
}

body.dark-mode .navbar-brand,
body.dark-mode .nav-link,
body.dark-mode .navbar-text {
    color: #e0e0e0 !important;
}

body.dark-mode .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

body.dark-mode .card {
    background-color: #16213e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
}

body.dark-mode .card-title {
    color: #e0e0e0;
}

body.dark-mode .table {
    background-color: #16213e;
    color: #e0e0e0;
    --bs-table-bg: #16213e;
    --bs-table-color: #e0e0e0;
}

body.dark-mode .table thead {
    background-color: #0f3460;
}

body.dark-mode .table thead th {
    background-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .table tbody tr {
    background-color: #16213e;
    color: #e0e0e0;
}

body.dark-mode .table tbody td {
    background-color: #16213e;
    color: #e0e0e0;
    border-color: #0f3460;
}

body.dark-mode .table tbody tr:hover {
    background-color: rgba(15, 52, 96, 0.5);
}

body.dark-mode .table-responsive {
    background-color: #16213e;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #0f3460;
    border-color: #1a3a5c;
    color: #e0e0e0;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #0f3460;
    border-color: #0d6efd;
    color: #e0e0e0;
}

body.dark-mode .form-label {
    color: #b0b0b0;
}

body.dark-mode .bg-light {
    background-color: #0f3460 !important;
}

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

/* Modal Dark Mode */
body.dark-mode .modal-content {
    background-color: #16213e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
}

body.dark-mode .modal-header {
    background-color: #0f3460;
    border-bottom: 1px solid #1a3a5c;
}

body.dark-mode .modal-header .modal-title {
    color: #e0e0e0;
}

body.dark-mode .modal-header .btn-close {
    filter: invert(1);
}

body.dark-mode .modal-body {
    background-color: #16213e;
    color: #e0e0e0;
}

body.dark-mode .modal-footer {
    background-color: #16213e;
    border-top: 1px solid #0f3460;
}

body.dark-mode .alert-info {
    background-color: #0f3460;
    color: #e0e0e0;
    border: 1px solid #0d6efd;
}

body.dark-mode .btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
}

body.dark-mode .btn-outline-secondary {
    border-color: #6c757d;
    color: #b0b0b0;
}

body.dark-mode .progress {
    background-color: #0f3460;
}

body.dark-mode .quick-select-btn {
    background-color: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .quick-select-btn:hover {
    background-color: #0f3460;
    border-color: #1a3a5c;
}

body.dark-mode .ui-autocomplete {
    background-color: #16213e;
    border-color: #0d6efd;
}

body.dark-mode .ui-menu-item-wrapper {
    color: #e0e0e0;
}

body.dark-mode .ui-menu-item-wrapper:hover {
    background-color: #0d6efd;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #0d6efd;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .dark-mode-toggle {
    background-color: #ffc107;
    color: #1a1a2e;
}

@media (prefers-color-scheme: dark) {
    /* 
    Uncomment to enable dark mode support
    
    :root {
        --light-color: #2c3e50;
        --dark-color: #ecf0f1;
    }
    
    body {
        background-color: #1a1a1a;
        color: #ecf0f1;
    }
    
    .card {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
    
    .table {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
    */
}


/* ============================================
   Achievements/Badges Styles
   ============================================ */

.achievements-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.achievement-card {
    text-align: center;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.earned {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.achievement-description {
    font-size: 0.75rem;
    color: #6c757d;
}

body.dark-mode .achievement-card {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
}

body.dark-mode .achievement-card.earned {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
}

body.dark-mode .achievement-description {
    color: #a0a0a0;
}


/* ============================================
   Favorites Section
   ============================================ */

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.favorite-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
}

.favorite-btn:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.favorite-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.favorite-btn .name {
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-btn .protein {
    font-size: 0.6rem;
    color: #6c757d;
}

body.dark-mode .favorite-btn {
    background-color: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}


/* ============================================
   Meal Templates
   ============================================ */

.template-card {
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.template-name {
    font-weight: 600;
    font-size: 1rem;
}

.template-protein {
    font-size: 0.875rem;
    color: #0d6efd;
    font-weight: 500;
}

.template-foods {
    font-size: 0.75rem;
    color: #6c757d;
}

body.dark-mode .template-card {
    background-color: #16213e;
    border-color: #0f3460;
}


/* ============================================
   Weight Chart
   ============================================ */

.weight-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.weight-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.weight-trend.up {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}


    text-align: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d6efd;
}

.stat-card .stat-label {
    font-size: 0.65rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.stat-card.success .stat-value {
    color: #198754;
}

.stat-card.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.stat-card.warning .stat-value {
    color: #856404;
}

.stat-card.info {
    background: linear-gradient(135deg, #cce5ff 0%, #b8daff 100%);
}

.stat-card.info .stat-value {
    color: #004085;
}

body.dark-mode .stat-card {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
}

body.dark-mode .stat-card .stat-value {
    color: #87ceeb;
}

body.dark-mode .stat-card .stat-label {
    color: #b0b0b0;
}

/* Weight Chart Dark Mode */
body.dark-mode #weightChart {
    background: #23272b !important;
    border-radius: 0.5rem;
}

body.dark-mode .weight-input-group input {
    background-color: #181a1b !important;
    color: #fff !important;
    border-color: #444 !important;
}


/* ============================================
   Recipe Card
   ============================================ */

.recipe-card {
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.recipe-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.recipe-header {
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
}

.recipe-body {
    padding: 1rem;
}

.recipe-ingredient {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px dashed #e0e0e0;
}

.recipe-ingredient:last-child {
    border-bottom: none;
}

body.dark-mode .recipe-card {
    border-color: #0f3460;
}

body.dark-mode .recipe-header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-color: #0f3460;
}

body.dark-mode .recipe-ingredient {
    border-color: #0f3460;
}


/* ============================================
   Motivation Quote
   ============================================ */

.motivation-quote {
    padding: 1rem;
    text-align: center;
    background: white;
    border-radius: 0.5rem;
    color: #333;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.motivation-quote .quote-text {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 0;
    color: #555;
}

.motivation-quote .quote-author {
    font-size: 0.875rem;
    opacity: 0.8;
}


/* ============================================
   New Achievement Notification
   ============================================ */

.achievement-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideDown 0.5s ease, shake 0.5s ease 0.5s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.achievement-notification .icon {
    font-size: 2rem;
}

.achievement-notification .text {
    font-weight: 600;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-5deg); }
    75% { transform: translateX(-50%) rotate(5deg); }
}

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduce motion for users with motion sensitivity */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

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

/* ============================================
   Quick Select Products
   ============================================ */
#quickSelectProducts {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    gap: 0.5rem;
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
}

.quick-select-btn {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-speed);
    border: 2px solid #d0d0d0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.quick-select-btn .fs-2 {
    font-size: 2rem;
    line-height: 1;
}

.quick-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
    background-color: rgba(208, 208, 208, 0.1);
    border-color: #b0b0b0;
}

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

/* Icons only - hide any text elements */
.quick-select-btn span:not(.fs-2),
.quick-select-btn small {
    display: none !important;
}

/* Tablet and up */
@media (min-width: 768px) {
    #quickSelectProducts {
        gap: 0.5rem;
    }
    
    .quick-select-btn {
        min-height: 55px;
        padding: 0.5rem;
    }
    
    .quick-select-btn .fs-2 {
        font-size: 1.75rem;
    }
}

/* Desktop */
@media (min-width: 992px) {
    #quickSelectProducts {
        gap: 0.5rem;
    }
    
    .quick-select-btn {
        min-height: 55px;
    }
    
    .quick-select-btn .fs-2 {
        font-size: 2rem;
    }
}

/* Mobile styles already defined above - no need for separate media query */

/* ============================================
   End of Styles
   ============================================ */
