:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #10b981; /* Emerald */
    --accent-hover: #059669;
    --secondary: #6366f1; /* Indigo */
    --warning: #f59e0b; /* Amber */
    --danger: #ef4444; /* Red */
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.logo i {
    width: 28px;
    height: 28px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-links li:hover, .nav-links li.active {
    background: var(--card-bg);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-links li.active {
    border-left: 4px solid var(--accent);
    background: rgba(16, 233, 129, 0.05);
}

.nav-links li i {
    width: 20px;
    height: 20px;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--card-border);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info .name {
    display: block;
    font-weight: 600;
}

.user-info .plan {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem 3rem;
    max-width: calc(100vw - 260px);
}

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

.content-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent);
    color: #0f172a;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: rgba(16, 185, 129, 0.1);
}

.btn-outline.active {
    background: var(--accent);
    color: #0f172a;
}

.btn-text {
    background: transparent;
    color: var(--accent);
    padding: 0.5rem 0;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--danger);
}

/* Cards & Glassmorphism */
.glass {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.5rem;
    transition: var(--transition);
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
}

/* Fasting Widget */
.fasting-widget {
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.timer-display {
    font-size: 3rem;
    font-weight: 800;
    margin: 1.5rem 0;
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(to right, #6366f1, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fasting-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Lists */
.item-list {
    list-style: none;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
}

.status-urgent { color: var(--danger); font-weight: 600; }
.status-warning { color: var(--warning); font-weight: 600; }

/* Table Styling */
.table-card {
    overflow-x: auto;
    padding: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Recipe Cards */
.recipe-cards, .recipe-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recipe-suggestion-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.tag {
    align-self: flex-start;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Checklist */
.checklist {
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
}

.checklist input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

/* Days Selector */
.days-selector {
    display: flex;
    gap: 0.5rem;
}

.day-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.day-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.day-btn.active {
    background: var(--accent);
    color: #0f172a;
    border-color: var(--accent);
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    display: flex;
    gap: 2rem;
    align-items: center;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--secondary);
    border: 4px solid #0f172a;
}

.timeline-date {
    min-width: 100px;
    font-weight: 600;
    font-size: 0.9rem;
}

.timeline-content {
    flex: 1;
    padding: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: var(--transition);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 95%;
    max-width: 500px;
    padding: 1.75rem;
    overflow-y: auto; /* enables scrolling inside modal form */
    max-height: 90vh; /* ensures modal fits comfortably within viewport bounds */
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    margin-bottom: 2rem;
    font-family: 'Space Grotesk', sans-serif;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px; /* Explicitly 16px to prevent iOS auto-zoom */
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Helper Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
    }
    .logo span, .nav-links li span, .user-info {
        display: none;
    }
    .main-content {
        margin-left: 80px;
        max-width: calc(100vw - 80px);
        padding: 2rem;
    }
    .logo {
        justify-content: center;
        padding-left: 0;
    }
    .nav-links li {
        justify-content: center;
    }
}

/* Profile Tab Styles */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.tag-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tag-btn.active {
    background: var(--accent);
    color: #0f172a;
    border-color: var(--accent);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

.result-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
}

/* Meal Planner Styles */
.meal-planner-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.day-column {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--card-border);
}

.day-column h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.meal-slot {
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px dashed var(--card-border);
}

.meal-slot:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.meal-slot.filled {
    border-style: solid;
    border-color: var(--secondary);
    background: rgba(99, 102, 241, 0.1);
}

/* Allergy Alert Styles */
.status-risk {
    color: var(--danger);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.risk-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.risk-bar-fill {
    height: 100%;
    background: var(--danger);
    transition: width 0.5s ease;
}

/* Mobile Friendly Styles */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid var(--card-border);
        padding: 0.5rem;
        flex-direction: row;
        justify-content: space-around;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: var(--glass-blur);
    }

    .logo {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .nav-links li {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
        align-items: center;
        border-radius: 0;
    }

    .nav-links li span {
        display: block;
    }

    .nav-links li.active {
        border-left: none;
        border-top: 2px solid var(--accent);
        background: rgba(16, 185, 129, 0.05);
        transform: none;
    }

    .user-profile {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
        margin-bottom: 70px;
        padding: 1.5rem;
        max-width: 100vw;
    }

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

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-grid, .profile-grid, .meal-planner-container {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(80px, 1fr));
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .table-card {
        overflow-x: auto;
    }

    .data-table th, .data-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Premium Modal Side-by-Side Search System */
/* Premium Modal Side-by-Side Search System */
.modal-wrapper {
    display: flex;
    gap: 1.5rem;
    max-width: 95vw;
    width: auto;
    align-items: stretch;
    justify-content: center;
    transition: var(--transition);
    max-height: 85vh; /* Fits to screen with space on the bottom and top */
}

#search-results-panel {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100%;
}

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

/* Custom Premium Glassmorphic Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* Interactive Food Result Cards */
.online-food-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.online-food-card:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.food-img-container {
    width: 88px;
    height: 72px; /* Taller height-wise to display ample info and clear photo spacing */
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.online-food-card:hover .food-img-container {
    border-color: rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

/* Expanded Card Nutrition Facts Area */
.food-card-expandable-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px dashed transparent;
    padding-top: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.online-food-card.expanded {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--secondary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.online-food-card.expanded .food-card-expandable-details {
    max-height: 250px;
    opacity: 1;
    border-top-color: var(--card-border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

/* Premium Glassmorphic Search Input */
.input-search {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 30px !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    height: 48px !important;
    padding: 0.5rem 1.5rem 0.5rem 3rem !important;
    transition: var(--transition) !important;
    backdrop-filter: var(--glass-blur) !important;
}

.input-search:focus {
    outline: none !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25) !important;
}

/* Category Tabs navigation */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.category-tab {
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: var(--glass-blur);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
    color: #0f172a;
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* Grocery Premium Styles */
.grocery-checklist-theme li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border) !important;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.grocery-checklist-theme li:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.grocery-checklist-theme li.checked-off {
    opacity: 0.55;
    background: rgba(255, 255, 255, 0.01);
}

.grocery-checklist-theme li.checked-off span {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* Spinner Animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile responsive styles for the modal wrapper */
@media (max-width: 900px) {
    .modal-wrapper {
        flex-direction: column;
        max-height: 95vh;
        overflow-y: auto;
        padding: 1.5rem 1rem;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }
    
    .modal-content {
        max-width: 100%;
        width: 100%;
        margin-bottom: 0;
    }
    
    #search-results-panel {
        width: 100% !important;
        max-height: 380px;
        min-height: auto;
    }
}

/* Circular Timer Pulsing & Premium Glowing HALO */
.fasting-pulsing .progress-ring__circle {
    animation: pulse-glow 2s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse-glow {
    0% {
        filter: drop-shadow(0 0 6px var(--accent));
        stroke-width: 8;
    }
    100% {
        filter: drop-shadow(0 0 18px var(--accent)) drop-shadow(0 0 4px var(--accent));
        stroke-width: 9.5;
    }
}

/* Premium Autocomplete Dropdown list */
#autocomplete-dropdown {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

#autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}
#autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
#autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    margin-bottom: 0.25rem;
}

.autocomplete-item:hover, .autocomplete-item.highlighted {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.autocomplete-item-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.autocomplete-item-name img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--card-border);
}

.autocomplete-item-name .placeholder-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 1px dashed var(--card-border);
}

.autocomplete-item-brand {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 0.35rem;
    opacity: 0.8;
}

/* Modal Nutrition Facts Card */
.nutrition-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    animation: fadeIn 0.3s ease;
}

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

.nutrition-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.nutrition-stat {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 0.6rem 0.4rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nutrition-stat .num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nutrition-stat .unit {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.nutrition-stat.calories {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.03);
}

.nutrition-stat.calories .num {
    color: var(--accent);
}

/* Sub-pills under inventory item name */
.macro-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.macro-pill {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.macro-pill.cal {
    color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
}

.macro-pill.pro {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.05);
    border-color: rgba(96, 165, 250, 0.15);
}

.macro-pill.carb {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.15);
}

.macro-pill.fat {
    color: #f87171;
    background: rgba(248, 113, 113, 0.05);
    border-color: rgba(248, 113, 113, 0.15);
}


