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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 220px;
    transition: padding 0.3s ease, direction 0.3s ease;
}

/* RTL by default */
html[lang="ar"] {
    direction: rtl;
}

/* LTR for English */
html[lang="en"] {
    direction: ltr;
}

html[lang="en"] .log-item {
    border-right: none;
    border-left: 4px solid #667eea;
}

html[lang="en"] .recommendation-item {
    border-right: none;
    border-left: 4px solid #667eea;
}

/* اللوجو الثابت */
.logo-fixed {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.logo-fixed:hover {
    transform: scale(1.05);
}

.logo-fixed img {
    width: 80px;
    height: 80px;
}

.logo-text {
    font-size: 0.9em;
    font-weight: bold;
    color: #667eea;
    text-align: center;
}

/* عرض السعرات الثابت */
/* Fixed calories display */
.total-calories-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

.total-calories-fixed.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.calorie-display-fixed {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2em;
    font-weight: bold;
    color: white;
    position: relative;
}

.calorie-display-fixed::before {
    content: '🔥';
    font-size: 1.5em;
    animation: flame 1.5s ease-in-out infinite;
}

/* RTL support for fixed calories */
html[lang="en"] .total-calories-fixed {
    right: auto;
    left: 20px;
}

@keyframes flame {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.btn-toggle-log,
.btn-toggle-calendar {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-toggle-log:hover,
.btn-toggle-calendar:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* اللوحات الجانبية */
.sidebar-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.sidebar-panel.open {
    right: 0;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-header h3 {
    font-size: 1.5em;
    margin: 0;
}

.btn-close-panel {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-panel:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.panel-content {
    padding: 20px;
}

/* السجل */
.log-date {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1em;
}

.log-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    padding: 15px;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7ff 100%);
    border-radius: 10px;
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.summary-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.log-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.log-meal-group {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-meal-group h4 {
    color: #667eea;
    font-size: 1.2em;
    margin: 0 0 5px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e7ff;
}

.log-empty {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 1.1em;
}

.log-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid #667eea;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    transition: all 0.3s ease;
}

.log-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.log-item-info {
    flex: 1;
}

.log-item-name {
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.log-item-weight {
    font-size: 0.95em;
    color: #667eea;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    text-align: center;
    white-space: nowrap;
}

.log-item-details {
    font-size: 0.9em;
    color: #666;
}

.log-item-calories {
    font-size: 1.1em;
    font-weight: bold;
    color: #f5576c;
    background: rgba(245, 87, 108, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    text-align: center;
    white-space: nowrap;
}

.btn-remove-log {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #f5576c;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-log:hover {
    background: #d84356;
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(245, 87, 108, 0.4);
}

/* التقويم */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-controls h4 {
    font-size: 1.3em;
    color: #667eea;
}

.btn-calendar-nav {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-calendar-nav:hover {
    transform: scale(1.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.calendar-day:hover {
    background: #e0e7ff;
    transform: scale(1.05);
}

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

.calendar-day.selected {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.calendar-day.has-data::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 5px;
    height: 5px;
    background: #f5576c;
    border-radius: 50%;
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day-header {
    font-weight: bold;
    color: #667eea;
    background: transparent;
    cursor: default;
}

.calendar-selected-info {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 100px;
}

.calendar-selected-info h4 {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e7ff;
}

.calendar-selected-info h5 {
    color: #667eea;
    margin-bottom: 10px;
}

.calendar-no-data {
    text-align: center;
    color: #999;
    padding: 20px;
}

.history-meal-group {
    background: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.history-meal-group h5 {
    color: #667eea;
    font-size: 1em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e7ff;
}

.history-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

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

.history-item span:first-child {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.history-item span:nth-child(2) {
    color: #667eea;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.history-item span:nth-child(3) {
    color: #f5576c;
    font-weight: bold;
    background: rgba(245, 87, 108, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
}

.total-calories {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    text-align: center;
    margin: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.total-calories h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.calorie-display {
    font-size: 3em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease;
}

.unit {
    font-size: 0.4em;
    opacity: 0.9;
}

.item-count-display {
    margin-top: 15px;
    font-size: 1.2em;
    opacity: 0.95;
}

/* أقسام الوجبات */
.meal-section {
    padding: 0;
    border-bottom: 2px solid #f0f0f0;
}

.meal-section:last-of-type {
    border-bottom: none;
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.meal-header:hover {
    background: #f8f9fa;
}

.meal-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.collapse-icon {
    font-size: 1.2em;
    color: #667eea;
    transition: transform 0.3s ease;
}

.meal-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.meal-title {
    font-size: 1.8em;
    color: #667eea;
    margin: 0;
}

.meal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.meal-calories {
    font-size: 1.1em;
    color: #764ba2;
    font-weight: 500;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.meal-calories strong {
    color: #f5576c;
    font-size: 1.3em;
}

.btn-save-meal,
.btn-clear-meal {
    padding: 8px 15px;
    font-size: 1.2em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-save-meal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-clear-meal {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-clear-meal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

/* محتوى الوجبة */
.meal-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.5s ease;
    padding: 0 30px 30px;
}

.meal-content.collapsed {
    max-height: 0;
    padding: 0 30px;
}

.category {
    margin-bottom: 30px;
}

.category h3 {
    font-size: 1.3em;
    color: #764ba2;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category h3::before {
    content: "▸";
    color: #f5576c;
}

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

.food-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.food-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.food-item.active {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7ff 100%);
    border-color: #667eea;
}

.food-info {
    margin-bottom: 12px;
}

.food-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.food-base-info {
    font-size: 0.85em;
    color: #666;
    display: block;
}

.food-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.btn-decrease,
.btn-increase {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-decrease:hover,
.btn-increase:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-confirm {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.btn-confirm:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.5);
}

.btn-confirm:active {
    transform: scale(0.95);
}

.food-item.confirmed {
    border: 2px solid #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.weight-input {
    width: 70px;
    height: 35px;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
}

.weight-input:focus {
    outline: none;
    border-color: #f5576c;
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.3);
}

.unit-label {
    font-size: 0.85em;
    color: #764ba2;
    font-weight: 500;
    min-width: 45px;
}

.food-result {
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    color: #f5576c;
    padding: 8px;
    background: white;
    border-radius: 8px;
}

.current-calories {
    font-size: 1.2em;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

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

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
}

/* الإشعارات */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    font-weight: bold;
    animation: slideDown 0.3s ease-out;
}

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

/* تحسينات إضافية */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 30px;
}

/* =======================================
   Navbar - Enhanced Design
======================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.navbar:hover::before {
    opacity: 1;
}

/* Navbar scroll effect */
.navbar.scrolled {
    padding: 10px 30px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.98) 0%, rgba(118, 75, 162, 0.98) 100%);
}

.navbar.scrolled .navbar-logo {
    width: 40px;
    height: 40px;
}

.navbar.scrolled .navbar-brand h2 {
    font-size: 1.3em;
}

.navbar.scrolled .navbar-btn {
    padding: 10px 20px;
    font-size: 0.95em;
}

/* =======================================
   Health Carousel
======================================= */
.health-carousel {
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 998;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    padding: 0 60px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px;
}

.carousel-slide.active {
    display: flex;
    animation: slideIn 0.5s ease-in-out;
}

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

.slide-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.slide-content {
    flex: 1;
    text-align: right;
}

.slide-content h3 {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 5px;
    font-weight: bold;
}

.slide-content p {
    color: #555;
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.carousel-btn.prev {
    right: 10px;
}

.carousel-btn.next {
    left: 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 25px;
    border-radius: 5px;
}

.carousel-dot:hover {
    background: #aaa;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-logo {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.4s ease;
    animation: logoFloat 3s ease-in-out infinite;
}

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

.navbar-logo:hover {
    filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.4));
    transform: rotate(360deg) scale(1.1);
}

.navbar-brand h2 {
    color: white;
    font-size: 1.5em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 1px;
}

.navbar-menu {
    display: flex;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.navbar-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.navbar-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.navbar-btn:hover::before {
    width: 300px;
    height: 300px;
}

.navbar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Language Toggle Button */
.navbar-btn.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    justify-content: center;
}

.lang-icon {
    font-size: 1.2em;
}

.lang-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* =======================================
   User Menu & Authentication
======================================= */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    cursor: pointer;
}

.user-avatar {
    font-size: 1.3em;
}

.user-name {
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

html[lang="en"] .user-dropdown {
    right: auto;
    left: 0;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7ff 100%);
    color: #667eea;
}

#loginBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: bold;
    padding: 12px 24px;
}

#loginBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* =======================================
   التبويبات
======================================= */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

/* =======================================
   المودال
======================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.btn-close-modal {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 30px;
}

/* Voice Input Option */
.voice-input-option {
    text-align: center;
    margin-bottom: 20px;
}

.btn-voice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-voice:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-voice .mic-icon {
    font-size: 1.3em;
    animation: pulse 2s ease-in-out infinite;
}

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

.voice-hint {
    margin-top: 8px;
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

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

.divider-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef 20%, #e9ecef 80%, transparent);
}

.divider-text span {
    position: relative;
    background: white;
    padding: 0 15px;
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #f5576c;
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.3);
}

.input-suffix {
    display: inline-block;
    margin-right: 10px;
    color: #666;
}

.field-hint {
    font-size: 0.85em;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.field-hint.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.field-hint.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.field-hint.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Autocomplete Suggestions */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

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

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.suggestion-item:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7ff 100%);
}

.suggestion-item.active {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7ff 100%);
}

.suggestion-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.suggestion-info {
    font-size: 0.85em;
    color: #666;
    margin-right: 10px;
}

.suggestion-calories {
    font-size: 0.9em;
    color: #f5576c;
    font-weight: bold;
    background: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    border: 1px solid #f5576c;
}

.no-suggestions {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.modal-footer {
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .btn {
    padding: 12px 30px;
}

/* =======================================
   Voice Recognition Modal
======================================= */
.voice-status {
    text-align: center;
    margin-bottom: 30px;
}

.voice-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 60px;
    margin-bottom: 15px;
}

.voice-wave {
    width: 6px;
    height: 20px;
    background: #ccc;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.voice-indicator.recording .voice-wave {
    background: #f5576c;
    animation: voiceWave 0.8s ease-in-out infinite;
}

.voice-indicator.recording .voice-wave:nth-child(1) {
    animation-delay: 0s;
}

.voice-indicator.recording .voice-wave:nth-child(2) {
    animation-delay: 0.2s;
}

.voice-indicator.recording .voice-wave:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes voiceWave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 50px;
    }
}

#voiceStatus {
    font-size: 1.1em;
    color: #667eea;
    font-weight: 500;
}

.voice-controls {
    text-align: center;
    margin-bottom: 25px;
}

.btn-voice-record {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-voice-record:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-voice-record.recording {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 15px 50px rgba(245, 87, 108, 0.7);
    }
}

.mic-icon {
    font-size: 2.5em;
}

.btn-text {
    font-size: 0.8em;
}

.voice-transcript-container {
    margin-top: 20px;
}

.voice-transcript-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

#voiceTranscript {
    width: 100%;
    padding: 15px;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    transition: all 0.3s ease;
}

#voiceTranscript:focus {
    outline: none;
    border-color: #f5576c;
    box-shadow: 0 0 15px rgba(245, 87, 108, 0.3);
}

.voice-help-box {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e7ff 100%);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.voice-help-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1em;
}

.voice-help-text {
    font-size: 0.9em;
    color: #333;
    margin: 5px 0;
    padding-right: 5px;
}

.voice-help-note {
    font-size: 0.85em;
    color: #f5576c;
    margin-top: 10px;
    font-weight: 500;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
}

/* ==================== INBODY CALCULATOR STYLES ==================== */

.inbody-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Progress Bar */
.progress-bar-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 25%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed {
    background: #28a745;
    color: white;
}

/* Form Steps */
.inbody-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.inbody-step.active {
    display: block;
}

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

.inbody-step h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5em;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Radio and Checkbox Groups */
.radio-group {
    display: flex;
    gap: 15px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover,
.checkbox-label:hover {
    background: #e9ecef;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Activity Cards */
.activity-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.activity-card {
    cursor: pointer;
    position: relative;
}

.activity-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.activity-content {
    padding: 20px;
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.activity-card:hover .activity-content {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.activity-card input[type="radio"]:checked + .activity-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.activity-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.activity-content h4 {
    margin: 10px 0 5px;
    font-size: 1.1em;
}

.activity-content p {
    font-size: 0.85em;
    opacity: 0.8;
    margin: 0;
}

/* Goal Cards */
.goal-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.goal-card {
    cursor: pointer;
    position: relative;
}

.goal-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.goal-content {
    padding: 30px 20px;
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.goal-card:hover .goal-content {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.goal-card input[type="radio"]:checked + .goal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.goal-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.goal-content h4 {
    margin: 10px 0 5px;
    font-size: 1.2em;
}

.goal-content p {
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0;
}

/* Results Page */
.inbody-results {
    animation: fadeIn 0.5s ease;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.results-header h3 {
    margin: 0 0 10px;
    font-size: 2em;
}

.user-info-display {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.metric-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.metric-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.metric-unit {
    font-size: 0.85em;
    color: #6c757d;
}

.metric-status {
    margin-top: 10px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    display: inline-block;
}

.metric-status.underweight {
    background: #fff3cd;
    color: #856404;
}

.metric-status.normal {
    background: #d4edda;
    color: #155724;
}

.metric-status.overweight {
    background: #f8d7da;
    color: #721c24;
}

.metric-status.obese {
    background: #f8d7da;
    color: #721c24;
}

/* Macros Section */
.macros-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.macros-section h4 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
}

.macros-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.macro-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 3px solid;
    transition: all 0.3s ease;
}

.macro-card:hover {
    transform: translateY(-3px);
}

.macro-card.protein {
    border-color: #e74c3c;
}

.macro-card.carbs {
    border-color: #f39c12;
}

.macro-card.fats {
    border-color: #2ecc71;
}

.macro-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.macro-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.macro-value {
    font-size: 2em;
    font-weight: bold;
}

.macro-card.protein .macro-value {
    color: #e74c3c;
}

.macro-card.carbs .macro-value {
    color: #f39c12;
}

.macro-card.fats .macro-value {
    color: #2ecc71;
}

.macro-unit {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
}

/* Recommendations Section */
.recommendations-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recommendations-section h4 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-item {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-right: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.recommendation-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.recommendation-text {
    flex: 1;
    line-height: 1.6;
}

/* Meal Plan Section */
.meal-plan-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.meal-plan-section h4 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
}

.meal-plan-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meal-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.meal-item:hover {
    border-color: #667eea;
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.15);
}

.meal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.meal-icon {
    font-size: 2.5em;
}

.meal-title {
    flex: 1;
}

.meal-title h5 {
    margin: 0 0 5px;
    color: #333;
    font-size: 1.2em;
}

.meal-time {
    font-size: 0.9em;
    color: #6c757d;
}

.meal-foods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.food-suggestion {
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.food-name {
    font-weight: 500;
    color: #333;
}

.food-calories {
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
}

/* Responsive Design for InBody */
@media (max-width: 768px) {
    .inbody-modal-content {
        max-width: 95%;
    }

    .activity-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .goal-options {
        grid-template-columns: 1fr;
    }

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

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

    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* =======================================
   RESPONSIVE DESIGN - COMPREHENSIVE
======================================= */

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 35px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: all 0.3s ease;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu:hover span {
    background: rgba(255, 255, 255, 0.8);
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* =======================================
   LARGE DESKTOP (1440px+)
======================================= */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }

    .food-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }

    .modal-content {
        max-width: 700px;
    }
}

/* =======================================
   DESKTOP (1024px - 1439px)
======================================= */
@media (min-width: 1024px) and (max-width: 1439px) {
    .food-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .container {
        max-width: 1200px;
    }
}

/* =======================================
   TABLET LANDSCAPE (768px - 1023px)
======================================= */
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        padding-top: 220px;
    }

    .navbar {
        padding: 12px 25px;
    }

    .navbar-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }

    .navbar-logo {
        width: 42px;
        height: 42px;
    }

    .food-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .modal-content {
        max-width: 90%;
        padding: 25px;
    }

    .sidebar-panel {
        width: 400px;
    }

    .health-carousel {
        top: 70px;
    }

    .carousel-item {
        padding: 15px 20px;
    }
}

/* =======================================
   TABLET PORTRAIT & MOBILE (max 767px)
======================================= */
@media (max-width: 767px) {
    /* Body and Main Layout */
    body {
        padding-top: 140px;
    }

    /* Navbar Mobile */
    .navbar {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    .navbar-brand {
        order: 1;
        flex: 1;
    }

    .navbar-brand h2 {
        font-size: 1.2em;
    }

    .navbar-logo {
        width: 38px;
        height: 38px;
    }

    .hamburger-menu {
        display: flex;
        order: 2;
    }

    .navbar-menu {
        order: 3;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        flex-direction: column;
        gap: 10px;
        margin-top: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .navbar-menu.active {
        max-height: 300px;
        margin-top: 15px;
    }

    .navbar-btn {
        width: 100%;
        padding: 12px 20px;
        justify-content: center;
        font-size: 0.95em;
        border-radius: 10px;
    }

    .navbar-btn.lang-toggle {
        width: 100%;
        justify-content: center;
    }

    /* Health Carousel */
    .health-carousel {
        top: auto;
        position: relative;
        margin-top: 10px;
        padding: 10px 0;
    }

    .carousel-item {
        padding: 12px 15px;
        min-height: 80px;
    }

    .carousel-item h3 {
        font-size: 1.1em;
    }

    .carousel-item p {
        font-size: 0.85em;
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }

    .carousel-dots .dot {
        width: 8px;
        height: 8px;
    }

    /* Total Calories */
    .total-calories {
        padding: 20px;
        margin: 15px;
    }

    .calorie-display {
        font-size: 2em;
    }

    /* Fixed Calories Display */
    .total-calories-fixed {
        bottom: 15px;
        right: 15px;
        padding: 15px 20px;
    }

    .calorie-display-fixed {
        font-size: 1.5em;
        gap: 8px;
    }

    html[lang="en"] .total-calories-fixed {
        left: 15px;
    }

    /* Meal Sections */
    .meal-section {
        margin: 15px;
        border-radius: 15px;
    }

    .meal-header {
        padding: 15px 20px;
        font-size: 1.1em;
    }

    .meal-calories {
        font-size: 1em;
    }

    /* Food Grid */
    .food-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .food-item {
        padding: 15px;
    }

    .food-name {
        font-size: 1em;
    }

    .food-base-info {
        font-size: 0.8em;
    }

    /* Food Controls */
    .food-controls {
        flex-direction: column;
        gap: 10px;
    }

    .portion-selector {
        width: 100%;
    }

    .portion-input {
        padding: 8px;
        font-size: 0.9em;
    }

    .portion-buttons {
        gap: 6px;
    }

    .portion-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1em;
    }

    .custom-amount {
        flex-direction: column;
        gap: 8px;
    }

    .custom-amount input {
        width: 100%;
    }

    /* Modals */
    .modal-content {
        max-width: 95%;
        width: 95%;
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header h2 {
        font-size: 1.3em;
    }

    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.3em;
    }

    /* Sidebar Panels */
    .sidebar-panel {
        width: 100%;
        max-width: 100%;
    }

    .sidebar-panel.active {
        width: 100%;
    }

    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 0.95em;
    }

    .btn-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    /* Forms */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    /* InBody Modal */
    .inbody-form {
        padding: 15px;
    }

    .form-section {
        margin-bottom: 20px;
    }

    .activity-options,
    .goal-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .activity-option,
    .goal-option {
        padding: 12px;
    }

    /* Results Page */
    .results-header h2 {
        font-size: 1.5em;
    }

    .metrics-grid,
    .macros-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .metric-card,
    .macro-card {
        padding: 15px;
    }

    /* Calendar */
    .calendar-container {
        padding: 15px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        height: 45px;
        font-size: 0.85em;
    }

    /* Log Items */
    .log-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    .log-item-header h4 {
        font-size: 1em;
    }

    /* Voice Recording */
    .btn-voice-record {
        width: 80px;
        height: 80px;
        font-size: 1.8em;
    }

    .recording-indicator {
        width: 40px;
        height: 40px;
    }
}

/* =======================================
   MOBILE SMALL (max 480px)
======================================= */
@media (max-width: 480px) {
    body {
        padding-top: 130px;
        font-size: 14px;
    }

    .navbar {
        padding: 10px 15px;
    }

    .navbar-brand h2 {
        font-size: 1.1em;
    }

    .navbar-logo {
        width: 35px;
        height: 35px;
    }

    .navbar-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .carousel-item {
        padding: 10px;
        min-height: 70px;
    }

    .carousel-item h3 {
        font-size: 1em;
    }

    .carousel-item p {
        font-size: 0.8em;
    }

    .total-calories {
        padding: 15px;
        margin: 10px;
    }

    .calorie-display {
        font-size: 1.8em;
    }

    .total-calories-fixed {
        bottom: 10px;
        right: 10px;
        padding: 12px 16px;
    }

    .calorie-display-fixed {
        font-size: 1.3em;
    }

    html[lang="en"] .total-calories-fixed {
        left: 10px;
    }

    .meal-section {
        margin: 10px;
    }

    .meal-header {
        padding: 12px 15px;
        font-size: 1em;
    }

    .food-grid {
        padding: 12px;
        gap: 12px;
    }

    .food-item {
        padding: 12px;
    }

    .food-name {
        font-size: 0.95em;
    }

    .portion-btn {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .activity-option,
    .goal-option {
        padding: 10px;
        font-size: 0.9em;
    }

    .metric-card,
    .macro-card {
        padding: 12px;
    }

    .metric-value,
    .macro-value {
        font-size: 1.5em;
    }

    .calendar-day {
        height: 40px;
        font-size: 0.8em;
    }
}

/* =======================================
   MOBILE EXTRA SMALL (max 375px)
======================================= */
@media (max-width: 375px) {
    body {
        padding-top: 120px;
        font-size: 13px;
    }

    .navbar {
        padding: 8px 12px;
    }

    .navbar-brand h2 {
        font-size: 1em;
    }

    .navbar-logo {
        width: 32px;
        height: 32px;
    }

    .navbar-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .carousel-item h3 {
        font-size: 0.95em;
    }

    .carousel-item p {
        font-size: 0.75em;
    }

    .calorie-display {
        font-size: 1.5em;
    }

    .meal-header {
        font-size: 0.95em;
    }

    .food-name {
        font-size: 0.9em;
    }

    .food-base-info {
        font-size: 0.75em;
    }

    .btn {
        font-size: 0.85em;
        padding: 8px 16px;
    }
}

/* =======================================
   LANDSCAPE ORIENTATION
======================================= */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-top: 100px;
    }

    .navbar {
        padding: 8px 20px;
    }

    .health-carousel {
        padding: 8px 0;
    }

    .carousel-item {
        padding: 8px 12px;
        min-height: 60px;
    }

    .modal-content {
        max-height: 85vh;
        padding: 15px;
    }

    .total-calories {
        padding: 15px;
    }
}

/* =======================================
   TOUCH DEVICE OPTIMIZATIONS
======================================= */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .navbar-btn,
    .btn,
    .portion-btn,
    .calendar-day,
    button {
        min-height: 44px; /* iOS recommended minimum */
    }

    /* Prevent double-tap zoom */
    button,
    a {
        touch-action: manipulation;
    }

    /* Remove hover effects on touch devices */
    .navbar-btn:hover::before,
    .btn:hover,
    .food-item:hover {
        transform: none;
    }

    /* Improve scrolling */
    .modal-content,
    .sidebar-panel,
    .meal-content {
        -webkit-overflow-scrolling: touch;
    }

    /* Larger form inputs */
    input,
    select,
    textarea {
        min-height: 44px;
    }
}

/* =======================================
   PRINT STYLES
======================================= */
@media print {
    .navbar,
    .health-carousel,
    .total-calories-fixed,
    .hamburger-menu,
    .sidebar-panel,
    .modal,
    .btn,
    button {
        display: none !important;
    }

    body {
        padding-top: 0;
        background: white;
    }

    .meal-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .food-item {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

