/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.tab-icon {
    font-size: 20px;
}

/* Page Styles */
.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Header - Compact with inline actions */
.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.title-icon {
    font-size: 28px;
}

/* Compact Header Action Buttons */
.header-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

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

.action-icon {
    font-size: 20px;
}

.share-btn-native {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.share-btn-native:hover {
    background: rgba(102, 126, 234, 0.4);
}

.share-btn-native svg {
    width: 20px;
    height: 20px;
}

.suggest-btn {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
}

.suggest-btn:hover {
    background: rgba(255, 193, 7, 0.4);
}

.suggest-btn .action-icon {
    font-size: 20px;
}

/* Day Cards Grid */
.days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

/* Day Card - Unified Component */
.day-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.day-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.day-card:active {
    transform: translateY(0);
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================
   DAY CARD HEADERS (All Animated)
   ============================ */
.day-card-header {
    padding: 10px 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    /* Animated Gradient: Blue -> Purple -> Blue */
    background: linear-gradient(90deg, #5b73e8, #764ba2, #5b73e8);
    background-size: 200% 100%;
    animation: gradientFlow 4s ease infinite;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

/* Stagger animation for even cards */
.day-card:nth-child(even) .day-card-header {
    animation-delay: 2s;
}

/* Shine Effect */
.day-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg) translateX(-150%);
    transition: transform 0.5s;
    pointer-events: none;
}

.day-card:hover .day-card-header::before {
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    100% {
        transform: skewX(-20deg) translateX(150%);
    }
}

.day-card-header::after {
    content: '+';
    font-size: 16px;
    font-weight: 700;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.day-card:hover .day-card-header::after {
    opacity: 1;
}

.day-card-content {
    padding: 10px;
    min-height: 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: start;
}

/* Add Food Button (Empty State) */
.add-food-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    grid-column: 1 / -1;
    width: 100%;
    min-height: 80px;
}

.day-card:hover .add-food-btn {
    color: rgba(255, 255, 255, 0.8);
}

.add-icon {
    width: 40px;
    height: 40px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.day-card:hover .add-icon {
    border-color: rgba(102, 126, 234, 0.6);
    color: #667eea;
}

.add-text {
    font-size: 12px;
    font-weight: 500;
}

/* Food Item in Day Card - Grid Equal Width */
.day-card .food-item {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.day-card .food-item .food-emoji {
    font-size: 28px;
}

.day-card .food-item .food-name {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    word-wrap: break-word;
}

.day-card .food-item .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 65, 108, 0.4);
}

.day-card:hover .food-item .remove-btn {
    opacity: 1;
}

/* Dinner Cards - Grid layout */
.dinner-card .day-card-content {
    min-height: 80px;
    gap: 6px;
}

.dinner-card .food-item {
    padding: 6px 4px;
}

.dinner-card .food-item .food-emoji {
    font-size: 24px;
}

.dinner-card .food-item .food-name {
    font-size: 9px;
}

/* Has Items State */
.day-card.has-items .add-food-btn {
    display: none;
}

.day-card:not(.has-items) .food-item {
    display: none;
}

/* Override for template builder cards - always show dragged items */
.builder-card .food-item {
    display: flex !important;
}

/* Desktop Food Container */
.food-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Compact Header - Dark Theme */
/* Compact Header - Dark Theme */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(26, 33, 62, 0.85);
    /* Semi-transparent dark blue matching body */
    backdrop-filter: blur(12px);
    /* Glass effect */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Softer border */
    position: sticky;
    top: 0;
    z-index: 100;
}

.toggle-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 12px;
    display: flex;
    gap: 4px;
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.toggle-icon {
    font-size: 16px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn svg {
    fill: white;
}

/* Hide Nav Tabs (Old) */
.nav-tabs {
    display: none;
}

.food-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.food-icon {
    font-size: 24px;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.category-tab {
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Food Items Grid */
.food-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 100px;
    align-content: flex-start;
}

/* Food Item */
.food-item {
    width: 120px;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    user-select: none;
}

.food-item:hover {
    transform: translateY(-3px) scale(1.03);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.food-item:active {
    transform: scale(0.97);
}

.food-item .food-emoji {
    font-size: 40px;
    margin-bottom: 8px;
}

.food-item .food-name {
    font-size: 11px;
    text-align: center;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

/* ============================================
   BOTTOM SHEET STYLES
   ============================================ */

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1e2a4a 0%, #16213e 100%);
    border-radius: 24px 24px 0 0;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 12px auto;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 600;
}

.bottom-sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bottom-sheet-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bottom-sheet-tabs {
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    align-content: start;
}

.bottom-sheet-content .food-item {
    width: 100%;
    min-height: 100px;
}

.bottom-sheet-content .food-item .food-emoji {
    font-size: 36px;
}

.bottom-sheet-content .food-item .food-name {
    font-size: 10px;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Hide desktop food container on mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    body {
        padding: 15px;
    }

    .tab-navigation {
        margin-bottom: 15px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .tab-icon {
        font-size: 18px;
    }

    .page-header {
        margin-bottom: 15px;
    }

    .page-title {
        font-size: 20px;
    }

    .title-icon {
        font-size: 24px;
    }

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

    .day-card-header {
        padding: 8px 12px;
        font-size: 12px;
    }

    .day-card-content {
        padding: 15px 10px;
        min-height: 90px;
    }

    .add-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .add-text {
        font-size: 11px;
    }
}

/* Show desktop food container on desktop */
@media (min-width: 769px) {
    .days-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .food-item[draggable="true"] {
        cursor: grab;
    }

    .food-item[draggable="true"]:active {
        cursor: grabbing;
    }

    .food-item.dragging {
        opacity: 0.5;
        transform: scale(0.9);
    }

    .day-card.drag-over {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.2);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
    }
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, #00c9ff 0%, #92fe9d 100%);
    color: #1a1a2e;
}

.toast.error {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Version Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    margin: 0;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.feature-item {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.feature-icon {
    font-size: 24px;
    background: #f1f5f9;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.feature-text strong {
    display: block;
    color: #1e293b;
    margin-bottom: 4px;
}

.feature-text p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
}

.modal-btn {
    width: 100%;
    padding: 14px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-btn:active {
    transform: scale(0.98);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Add Custom Dish Feature */
.add-new-dish-item {
    background: #4caf501a !important;
    /* Light green tint */
    border: 1px dashed #4caf50 !important;
    justify-content: center;
    cursor: pointer;
}

.add-new-dish-item .food-emoji {
    color: #4caf50;
}

.add-dish-btn {
    display: none;
    /* Hidden by default (mobile bottom sheet handles it differently) */
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 400px;
    border-radius: 1rem;
    padding: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 1rem;
}

.meal-type-selector {
    display: flex;
    gap: 1rem;
}

.meal-type-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel,
.btn-submit {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel {
    background: transparent;
    color: var(--text-secondary);
}

.btn-submit {
    background: var(--primary-color);
    color: white;
}

@media (min-width: 769px) {
    .add-dish-btn {
        display: block;
        width: 100%;
        margin-top: 1rem;
        padding: 0.85rem;
        background: rgba(102, 126, 234, 0.2);
        border: 2px solid rgba(102, 126, 234, 0.4);
        color: rgba(255, 255, 255, 0.9);
        border-radius: 0.5rem;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 600;
        font-size: 0.95rem;
    }

    .add-dish-btn:hover {
        border-color: #667eea;
        color: white;
        background: rgba(102, 126, 234, 0.35);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
}

/* Recipe Modal Styles */
.recipe-modal-content {
    max-width: 500px;
    width: 95%;
    overflow: hidden;
}

.recipe-modal-content .modal-body {
    overflow: hidden;
    max-width: 100%;
}

.recipe-modal-content .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem 1rem 0 0;
    padding: 1rem 1.5rem;
}

.recipe-modal-content .modal-header h3 {
    color: white;
    font-size: 1.1rem;
}

.recipe-modal-content .close-btn {
    color: rgba(255, 255, 255, 0.8);
}

.recipe-modal-content .close-btn:hover {
    color: white;
}

.recipe-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 80px;
    max-height: 300px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    line-height: 1.6;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.recipe-display p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    margin: 0;
    max-width: 100%;
}

.recipe-empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    text-align: center;
    margin: 0;
    padding: 2rem 0;
}

.recipe-edit-group textarea {
    width: 100%;
    min-height: 150px;
    max-height: 300px;
    resize: vertical;
}

.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    word-wrap: break-word;
}

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

/* Recipe Modal Footer Buttons */
.recipe-modal-content .modal-footer {
    gap: 0.75rem;
}

.recipe-modal-content .btn-cancel,
.recipe-modal-content .btn-submit {
    min-width: 80px;
}

/* Dark theme styling for select dropdowns */
select,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(30, 30, 50, 0.9);
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select:hover,
.form-group select:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background-color: rgba(40, 40, 60, 0.95);
}

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

/* Style the dropdown options */
select option,
.form-group select option {
    background: #1e1e32;
    color: #ffffff;
    padding: 0.75rem;
    font-size: 1rem;
}

select option:hover,
select option:checked,
.form-group select option:hover,
.form-group select option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

/* Input styling for consistency */
.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(30, 30, 50, 0.9);
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Form group label styling */
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   MEAL TYPE SELECTOR - WOW STYLING
   ============================================ */

.meal-type-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    margin-top: 0.5rem;
}

.meal-type-btn {
    position: relative;
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Shimmer effect on inactive buttons */
.meal-type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.5s ease;
}

.meal-type-btn:hover::before {
    left: 100%;
}

.meal-type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* LUNCH - Active State - Sunny Orange/Yellow */
.meal-type-btn[data-meal="lunch"].active {
    background: linear-gradient(135deg, #ff9a56 0%, #ffb347 50%, #ffc371 100%);
    color: #1a1a2e;
    border-color: transparent;
    box-shadow:
        0 8px 25px rgba(255, 179, 71, 0.4),
        0 0 40px rgba(255, 179, 71, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.02);
}

.meal-type-btn[data-meal="lunch"].active::after {
    content: '☀️';
    position: absolute;
    right: 1rem;
    font-size: 1.2rem;
    animation: sunPulse 2s ease-in-out infinite;
}

@keyframes sunPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(15deg);
    }
}

/* DINNER - Active State - Purple/Blue Night */
.meal-type-btn[data-meal="dinner"].active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #a855f7 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 8px 25px rgba(118, 75, 162, 0.4),
        0 0 40px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.02);
}

.meal-type-btn[data-meal="dinner"].active::after {
    content: '🌙';
    position: absolute;
    right: 1rem;
    font-size: 1.2rem;
    animation: moonGlow 3s ease-in-out infinite;
}

@keyframes moonGlow {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    }
}

/* Click animation */
.meal-type-btn:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* Ripple effect on click */
.meal-type-btn.ripple {
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }
}

/* Responsive - Stack vertically on very small screens */
@media (max-width: 300px) {
    .meal-type-selector {
        flex-direction: column;
    }
}

/* ============================================
   UNDO TOAST STYLING
   ============================================ */

.undo-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.undo-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.undo-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.undo-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.undo-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.undo-btn:active {
    transform: scale(0.98);
}

/* ============================================
   LOCK BUTTON & LOCKED ITEMS
   ============================================ */

.food-item .lock-btn {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.food-item:hover .lock-btn {
    opacity: 1;
    left: 4px;
}

.food-item .lock-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

/* Locked item styling */
.food-item.locked {
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.food-item.locked .lock-btn {
    opacity: 1;
    left: 4px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #1a1a2e;
}

.food-item.locked .remove-btn {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Adjust food item for lock button */
.day-card-content .food-item {
    position: relative;
    padding-left: 28px;
}

/* ============================================
   LUNCH CARDS - Centered Single Item
   ============================================ */

.lunch-card .day-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.lunch-card .day-card-content .food-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    padding-left: 0.75rem;
    min-width: 80px;
}

.lunch-card .day-card-content .food-item .food-emoji {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.lunch-card .day-card-content .food-item .food-name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

/* Hide drag handle for lunch to keep it clean */
.lunch-card .day-card-content .food-item .drag-handle {
    display: none;
}

/* Lock button - top left */
.lunch-card .day-card-content .food-item .lock-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    font-size: 10px;
    opacity: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.lunch-card .day-card-content .food-item:hover .lock-btn {
    opacity: 1;
}

.lunch-card .day-card-content .food-item.locked .lock-btn {
    opacity: 1;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
}

/* Remove button - top right */
.lunch-card .day-card-content .food-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8rem;
    width: 20px;
    height: 20px;
    opacity: 0;
    background: rgba(255, 100, 100, 0.8);
    border-radius: 50%;
}

.lunch-card .day-card-content .food-item:hover .remove-btn {
    opacity: 1;
}

/* ============================================
   DINNER CARDS - Compact Multiple Items
   ============================================ */

.dinner-card .day-card-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
}

.dinner-card .day-card-content .food-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    padding-left: 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
}

.dinner-card .day-card-content .food-item .food-emoji {
    font-size: 1rem;
}

.dinner-card .day-card-content .food-item .food-name {
    font-size: 0.7rem;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Smaller controls for dinner */
.dinner-card .day-card-content .food-item .drag-handle {
    display: none;
}

/* Lock button - top left */
.dinner-card .day-card-content .food-item .lock-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    font-size: 8px;
    opacity: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.dinner-card .day-card-content .food-item:hover .lock-btn {
    opacity: 1;
}

.dinner-card .day-card-content .food-item.locked .lock-btn {
    opacity: 1;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
}

/* Remove button - top right */
.dinner-card .day-card-content .food-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    padding: 0;
    opacity: 0;
    background: rgba(255, 100, 100, 0.8);
    border-radius: 50%;
}

.dinner-card .day-card-content .food-item:hover .remove-btn {
    opacity: 1;
}

/* ============================================
   NUTRITION SUMMARY PANEL
   ============================================ */

.nutrition-panel {
    max-width: 1400px;
    margin: 0 auto 1rem auto;
    padding: 0 20px;
}

.nutrition-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.nutrition-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.toggle-arrow {
    transition: transform 0.3s ease;
}

.nutrition-panel.expanded .toggle-arrow {
    transform: rotate(180deg);
}

.nutrition-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.nutrition-panel.expanded .nutrition-content {
    max-height: 300px;
    padding: 1rem 0;
}

.nutrition-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    margin-top: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.stat-item.total {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    color: #ffffff;
    font-weight: 600;
}

.stat-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}

.stat-empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 1rem;
}

/* ============================================
   DRAG TO REORDER
   ============================================ */

.food-item .drag-handle {
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
    letter-spacing: -2px;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    user-select: none;
}

.food-item:hover .drag-handle {
    opacity: 1;
}

.food-item .drag-handle:hover {
    color: rgba(255, 255, 255, 0.7);
}

.food-item .drag-handle:active {
    cursor: grabbing;
}

.food-item.dragging-reorder {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.food-item.drag-over-top {
    border-top: 3px solid #667eea !important;
    margin-top: -3px;
}

.food-item.drag-over-bottom {
    border-bottom: 3px solid #667eea !important;
    margin-bottom: -3px;
}

/* Adjust food item padding to accommodate drag handle */
.day-card-content .food-item {
    padding-left: 32px;
}

/* ============================================
   DELETE CONFIRMATION MODAL
   ============================================ */

.delete-modal-content {
    max-width: 350px;
    text-align: center;
}

.delete-modal-content h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.delete-modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
}

/* ============================================
   ENHANCED TOGGLE BUTTONS (Lunch/Dinner)
   ============================================ */

.toggle-container {
    display: flex;
    gap: 0.5rem;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.toggle-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.toggle-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Lunch active - sunny gradient */
.toggle-btn[data-tab="lunch"].active {
    background: linear-gradient(135deg, #ff9a56 0%, #ffb347 50%, #ffc371 100%);
    color: #1a1a2e;
    border-color: transparent;
    box-shadow:
        0 4px 15px rgba(255, 179, 71, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Dinner active - night gradient */
/* Dinner active - night gradient with animation */
.toggle-btn[data-tab="dinner"].active {
    background: linear-gradient(90deg, #5b73e8, #764ba2, #5b73e8);
    background-size: 200% 100%;
    animation: gradientFlow 4s ease infinite;
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 4px 15px rgba(118, 75, 162, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.toggle-icon {
    font-size: 1.1rem;
}

/* ============================================
   FOOD DRAWER (Collapsible Sidebar)
   ============================================ */

.food-drawer {
    margin-top: 1rem;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drawer-toggle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.drawer-icon {
    font-size: 1.5rem;
}

.drawer-title {
    flex: 1;
    text-align: left;
}

.drawer-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.food-drawer.expanded .drawer-arrow {
    transform: rotate(180deg);
}

.drawer-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
}

.food-drawer.expanded .drawer-content {
    max-height: 600px;
    padding: 1rem;
    transition: max-height 0.3s ease-in, padding 0.2s ease-in;
}

/* Adjust food-items inside drawer */
.drawer-content .food-items {
    max-height: 300px;
    overflow-y: auto;
    margin: 0.5rem 0;
}

.drawer-content .category-tabs {
    margin-bottom: 0.75rem;
}

.drawer-content .add-dish-btn {
    margin-top: 0.75rem;
}

/* ============================================
   KEBAB MENU BUTTON & DROPDOWN
   ============================================ */

.kebab-menu-wrapper {
    position: relative;
    z-index: 1000;
}

.kebab-btn {
    border-radius: 50%;
    /* Make it circular like Google's */
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.kebab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.header-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(30, 42, 74, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;

    /* Animation state: hidden */
    opacity: 0;
    visibility: hidden;
    /* Ensure it's not clickable when hidden */
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: top right;
}

.header-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.menu-item.delete-item {
    color: #ff6b81;
}

.menu-item.delete-item:hover {
    background: rgba(255, 71, 87, 0.15);
}

/* ============================================
   HELP MODAL
   ============================================ */

.help-modal-content {
    background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%);
    max-width: 450px !important;
}

.help-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    text-align: left;
}

.help-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.help-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.help-text strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
    font-size: 1rem;
}

.help-text p {
    color: #a0aec0;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.btn-cosmic {
    background: linear-gradient(90deg, #5b73e8, #764ba2, #5b73e8);
    background-size: 200% 100%;
    animation: gradientFlow 4s ease infinite;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
    font-family: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-cosmic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #a855f7 100%);
}

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

/* ===============================
   TEMPLATES & BUILDER
   =============================== */
.template-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Initial View */
#templatesInitialView {
    text-align: center;
    padding: 2rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Builder View */
.builder-grid {
    margin: 1rem 0;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.days-grid-small {
    display: flex;
    gap: 10px;
    min-width: 800px;
    /* Ensure 7 days fit */
}

.builder-card {
    flex: 1;
    min-width: 100px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow-y: auto;
}

/* Re-use Header style but smaller */
.builder-card .day-card-header {
    font-size: 0.8rem;
    padding: 5px;
    /* Ensure gradient fits small space */
    background-size: 200% 100%;
}

.builder-card .day-card-content {
    min-height: 100px;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    /* Allow items to stack */
    justify-content: center;
    align-content: flex-start;
    gap: 4px;
}

/* Mini Items in Grid */
.mini-card-item {
    font-size: 1.5rem;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: default;
    transition: transform 0.2s;
}

.mini-card-item:hover {
    transform: scale(1.1);
}

/* Mini Remove Button */
.mini-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(255, 65, 108, 0.9);
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.mini-card-item:hover .mini-remove-btn {
    opacity: 1;
}

.mini-remove-btn:hover {
    background: rgba(255, 0, 50, 1);
    transform: scale(1.2);
}

/* Builder Drawer */
.builder-drawer {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.builder-drawer h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    opacity: 0.8;
}

.food-items-small {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 4px;
}

.food-item.mini {
    padding: 6px 12px;
    font-size: 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: grab;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.food-item.mini:active {
    cursor: grabbing;
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .days-grid-small {
        min-width: 180vw;
        /* Allow scrolling on mobile */
        padding-right: 20px;
    }
}

/* ============================================
   TEMPLATE MODAL ENHANCEMENTS
   ============================================ */

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 65, 108, 0.6);
    transform: scale(1.1);
}

/* Template Name Input */
.template-name-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.template-name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.template-name-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Builder Card Selected State (for mobile tap) */
.builder-card.selected {
    border: 3px solid #667eea !important;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.builder-card.selected .day-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    animation: none;
}

/* Mobile tap hint */
@media (max-width: 768px) {
    .food-item.mini {
        cursor: pointer;
    }

    .food-item.mini:active {
        background: rgba(102, 126, 234, 0.3);
        transform: scale(0.95);
    }

    .builder-instruction {
        text-align: center;
        font-size: 12px;
        opacity: 0.7;
        margin-bottom: 10px;
        padding: 8px;
        background: rgba(102, 126, 234, 0.2);
        border-radius: 8px;
    }
}

/* ============================================
   ACTION TOOLBAR (Replaces Hamburger Menu)
   ============================================ */

.action-toolbar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toolbar-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.toolbar-btn:active {
    transform: scale(0.9);
}

.toolbar-icon {
    font-size: 20px;
}

.toolbar-btn-danger:hover {
    background: rgba(255, 65, 108, 0.4);
}

/* Mobile: smaller buttons */
@media (max-width: 768px) {
    .action-toolbar {
        padding: 3px;
    }

    .toolbar-btn {
        width: 36px;
        height: 36px;
    }

    .toolbar-icon {
        font-size: 16px;
    }
}