/* Existing styles... */

.primary-btn {
    background: linear-gradient(90deg, #2563eb, #16a34a);
    color: white;
    border-radius: 9999px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 34px rgba(34, 197, 94, 0.25);
}

.secondary-btn {
    background: white;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 6px 16px rgba(148, 163, 184, 0.25);
}

.secondary-btn:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

.nav-pill {
    padding: 0.5rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.15);
}

.nav-pill:hover {
    color: #0f172a;
    border-color: #a3e635;
    box-shadow: 0 8px 18px rgba(74, 222, 128, 0.15);
}

.hero-card {
    background: white;
    border-radius: 28px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.hero-photo-frame {
    position: absolute;
    inset: 12px;
    border-radius: 24px;
    border: 1px dashed #cbd5e1;
    z-index: 0;
}

.floating-stat {
    position: absolute;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.brand-chip {
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

.step-card {
    background: white;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    padding: 18px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.step-icon {
    height: 48px;
    width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #fef9c3, #ecfccb);
    font-size: 22px;
    margin-bottom: 10px;
}

.step-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.step-text {
    color: #475569;
    font-size: 0.95rem;
}

.recipe-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    min-height: 220px;
    background: #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 30px rgba(15, 23, 42, 0.08);
}

.recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.recipe-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.55) 100%);
    color: white;
    gap: 6px;
}

.recipe-tag {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.14);
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.recipe-title {
    font-weight: 800;
    font-size: 1.1rem;
}

.recipe-meta {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.9);
}

.cta-banner {
    background: linear-gradient(135deg, #115e59, #0f766e);
    border-radius: 24px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 18px 40px rgba(15, 118, 110, 0.25);
}

.cta-button {
    background: white;
    color: #0f172a;
    font-weight: 800;
    padding: 12px 20px;
    border-radius: 9999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.cta-button:hover {
    transform: translateY(-1px);
}

.floating-bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(0px);
    opacity: 0.35;
    z-index: 0;
}

.bubble-amber {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle at 30% 30%, #fde68a, transparent 65%);
    top: -60px;
    left: -120px;
}

.bubble-green {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle at 70% 70%, #befae4, transparent 60%);
    bottom: -80px;
    right: -120px;
}

.bubble-orange {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 40% 40%, #fecdd3, transparent 70%);
    top: 30%;
    right: 30%;
}

/* Fixed modal styles with higher z-index values */
.modal-backdrop {
    z-index: 9000 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal {
    z-index: 9999 !important;
    position: fixed;
    display: none;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10000 !important;
    position: relative;
}

/* Make sure modals display properly */
#recipe-modal, #recipe-details-modal {
    z-index: 9999 !important;
}

/* Larger meal plan table */
.max-w-9xl {
    max-width: 96rem;
  }

#recipe-modal .bg-white, #recipe-details-modal .bg-white {
    z-index: 10000 !important;
}

/* Recipe details modal scrolling fixes */
#recipe-details-modal .sticky {
    position: sticky;
    top: 0;
    z-index: 30 !important;
}

#recipe-details-content {
    scroll-padding-top: 70px; /* Height of the sticky header */
}

/* Updated spinner styles */
#recipe-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.recipe-modal-content {
    position: relative;
    transition: opacity 0.3s ease;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s linear infinite;
}

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

#recipe-spinner p {
    margin-top: 1rem;
    font-weight: bold;
    text-align: center;
}

/* Meal plan table responsive styles */
.meal-plan-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
}

#meal-plan-table {
    min-width: 1200px; /* Minimum width for table */
    width: 100%;
    table-layout: fixed; /* Fixed table layout for consistent column widths */
}

/* On larger screens, increase column widths */
@media (min-width: 1280px) {
    #meal-plan-table {
        min-width: 1380px; /* 120px (meal type) + 7 * 180px (days) = 1380px total */
    }
}

#meal-plan-table th:first-child,
#meal-plan-table td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 10;
    width: 120px; /* Fixed width for meal type column */
    min-width: 120px;
}

#meal-plan-table th,
#meal-plan-table td {
    width: calc((100% - 120px) / 7); /* Distribute remaining width equally among 7 days */
    min-width: 150px;
    padding: 0.5rem;
}

/* On larger screens, use fixed widths for better spacing */
@media (min-width: 1280px) {
    #meal-plan-table th,
    #meal-plan-table td {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }
}

/* On extra large screens, provide even more space */
@media (min-width: 1536px) {
    #meal-plan-table {
        min-width: 1500px; /* 120px + 7 * 197px ≈ 1500px */
    }
    
    #meal-plan-table th,
    #meal-plan-table td {
        width: 197px;
        min-width: 197px;
        max-width: 197px;
    }
}

.meal-select {
    width: 100% !important;
    min-width: 120px;
}

.flex-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    width: 100%;
}

.add-recipe,
.remove-recipe {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

/* Make the table header stick to the top when scrolling */
#meal-plan-table thead th {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 20;
}

/* Ensure the first header cell (corner) has highest z-index */
#meal-plan-table thead th:first-child {
    z-index: 30;
}

/* Styling for notes rows */
#meal-plan-table .bg-blue-50 th:first-child,
#meal-plan-table .bg-green-50 th:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
}

#meal-plan-table .bg-blue-100 {
    background-color: #dbeafe !important;
}

#meal-plan-table .bg-green-100 {
    background-color: #dcfce7 !important;
}

/* Notes textarea styling */
.meal-prep-notes,
.day-plan-notes {
    font-size: 0.875rem;
    line-height: 1.25;
    resize: vertical;
    min-height: 3rem;
}

/* Instacart button styling */
.instacart-button:hover {
    background-color: #F5EBD8 !important;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    flex: 1;
}

/* Custom dropdown placeholder should expand to fill available space */
.custom-dropdown-placeholder {
    flex: 1;
    min-width: 0; /* Allow shrinking below content size */
}

.dropdown-button {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.5rem;
    background-color: white;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 30;
}

.options-container {
    max-height: 12rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.option-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
}

.option-item:hover {
    background-color: #f3f4f6;
}

.recipe-search {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    background-color: #f9fafb;
}

/* Navigation button stability fixes */
nav a {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure logout button remains visible */
nav a[href*="logout"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
}

/* Prevent unwanted transitions on navigation buttons */
nav .transition-colors {
    transition-property: background-color, color, border-color !important;
    transition-timing-function: ease-in-out !important;
}

/* Recipe container in meal plan cells */
.recipe-container {
    width: 100%;
}

.recipe-container .flex-container:first-child {
    margin-top: 0;
}

/* Ensure consistent button sizing and alignment */
.recipe-container button {
    flex-shrink: 0;
}

/* Meal Rating Styles */
.rating-buttons {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    align-items: center;
}

.rating-btn {
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s ease;
    font-size: 16px;
    padding: 2px;
    border: none;
    background: none;
    line-height: 1;
}

.rating-btn:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.rating-btn.active {
    opacity: 1;
    transform: scale(1.2);
}

/* Compact rating display for meal plan cells */
.meal-plan-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 14px;
}

.meal-plan-rating .rating-btn {
    font-size: 14px;
}

/* Rating display for recipe cards */
.recipe-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.recipe-rating .rating-btn {
    font-size: 20px;
}

/* Loading state for rating buttons */
.rating-btn.loading {
    opacity: 0.5;
    pointer-events: none;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.3; }
    100% { opacity: 0.5; }
}

/* Tooltip for rating buttons */
.rating-btn[title] {
    position: relative;
}

/* Ensure rating buttons don't break layout in meal plan */
.recipe-container .rating-buttons {
    flex-shrink: 0;
}

/* Rating filter buttons in dropdown */
.rating-filter-btn {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.rating-filter-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.rating-filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.rating-filter-btn.active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Icon sizing fixes to prevent meal_plan_v2 CSS bleeding */
/* Only target icons that don't have explicit Tailwind size classes */
nav svg:not([class*="w-"]):not([class*="h-"]) {
    width: 1.25rem;
    height: 1.25rem;
}

/* Protect Tailwind utility classes from being overridden */
.w-5 { width: 1.25rem !important; }
.h-5 { height: 1.25rem !important; }
.w-6 { width: 1.5rem !important; }
.h-6 { height: 1.5rem !important; }
.w-7 { width: 1.75rem !important; }
.h-7 { height: 1.75rem !important; }
.w-8 { width: 2rem !important; }
.h-8 { height: 2rem !important; }
.w-10 { width: 2.5rem !important; }
.h-10 { height: 2.5rem !important; }
.w-12 { width: 3rem !important; }
.h-12 { height: 3rem !important; }
.w-20 { width: 5rem !important; }
.h-20 { height: 5rem !important; }

/* Fix flash icon sizes specifically */
.meal-plan-v2-container .flash-icon {
    width: 20px !important;
    height: 20px !important;
}

/* Rest of existing styles... */
