/* Global Styles */
:root {
    --primary-color: #059669;
    --secondary-color: #10b981;
    --text-color: #1f2937;
    --header-text-color: #064e3b;
    --light-gray: #ecfdf5;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--header-text-color);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
    background-color: var(--light-gray);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Navigation */
/* Navigation */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.primary-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
    background: white;
}

/* Mobile Navigation Handing */
@media (max-width: 768px) {

    .primary-nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        position: relative;
        /* Anchor for absolute positioning */
        min-height: 60px;
        /* Ensure height for absolute elements */
        justify-content: center;
    }

    .secondary-nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 1rem;
    }

    /* Hide links by default on mobile */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        /* Space below the header row */
        gap: 1rem;
    }

    /* Show links when active */
    .nav-links.active {
        display: flex;
        animation: fadeIn 0.3s ease;
    }

    .logo {
        width: 100%;
        display: flex;
        justify-content: center;
        /* Center the logo */
        align-items: center;
        z-index: 1001;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        width: 30px;
        height: 25px;
        z-index: 1100;

        /* Absolute Position: Left */
        position: absolute;
        top: 0.8rem;
        left: 1rem;
        /* Padding from left edge */
        right: auto;
        /* Reset right */
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--primary-color);
        margin: 5px 0;
        transition: 0.3s;
        border-radius: 3px;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* Mobile User Menu - HIDDEN (Moved to Header) */
    .user-menu-container {
        display: none !important;
    }

    /* Mobile Header Auth Actions */
    .mobile-auth-actions {
        display: flex !important;
        align-items: center;
        gap: 15px;

        /* Absolute Position: Right */
        position: absolute;
        top: 0.8rem;
        right: 1rem;
        /* Padding from right edge */
        left: auto;
        z-index: 1100;
    }

    #mobile-login-btn {
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 20px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 0.9rem;
    }

    /* Ensure legacy profile link is VISIBLE on mobile (restored) */
    #profile-nav-item {
        display: block !important;
    }

    /* Mobile Dropdown Styling */
    .mobile-dropdown-content {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: white;
        min-width: 160px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        z-index: 1200;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        margin-top: 10px;
        flex-direction: column;
    }

    .mobile-dropdown-content a {
        color: var(--text-color);
        padding: 12px 16px;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
        transition: background-color 0.2s;
        border-bottom: 1px solid #f1f5f9;
        white-space: nowrap;
    }

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

    .mobile-dropdown-content a:hover {
        background-color: #f8fafc;
        color: var(--primary-color);
    }
}

@media (min-width: 769px) {
    .mobile-auth-actions {
        display: none !important;
    }

    .primary-nav {
        max-width: 100%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
    }

    .secondary-header {
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
    }

    .secondary-nav {
        max-width: 100%;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        padding: 0 2rem;
    }

    .nav-links {
        display: flex;
        gap: 2rem;
        align-items: center;
    }

    .nav-links.primary-links {
        gap: 2rem;
    }

    .nav-links.secondary-links {
        gap: 0;
        /* Tabs usually have no gap if using padding, or small gap */
    }

    .nav-links.secondary-links li a {
        display: block;
        padding: 1rem 1.5rem;
        color: #64748b;
        font-weight: 500;
        border-bottom: 3px solid transparent;
        transition: all 0.3s ease;
        font-size: 0.95rem;
    }

    .nav-links.secondary-links li a:hover,
    .nav-links.secondary-links li a.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
        background: #f1f5f9;
    }

    .nav-links.secondary-links li a i {
        margin-right: 0.5rem;
    }

    .logo {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary-color);
    }

    .nav-links a {
        font-weight: 500;
        transition: var(--transition);
        position: relative;
        text-decoration: none;
        color: var(--text-color);
    }

    .primary-links a:hover {
        color: var(--primary-color);
    }

    .user-menu-container {
        position: relative;
    }

    .user-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--white);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        padding: 0.5rem 0;
        min-width: 200px;
        z-index: 1100;
        margin-top: 0.5rem;
    }

    /* User Dropdown Arrow */
    .user-dropdown::before {
        content: '';
        position: absolute;
        top: -0.5rem;
        left: 0;
        width: 100%;
        height: 0.5rem;
        background: transparent;
    }

    .user-menu-container.logged-in:hover .user-dropdown {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .user-dropdown a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1.5rem;
        color: var(--text-color);
        font-weight: 500;
        text-decoration: none;
        transition: var(--transition);
    }

    .user-dropdown a:hover {
        background-color: var(--light-gray);
        color: var(--primary-color);
    }

    .user-dropdown a::after {
        display: none;
    }


}

/* Hero Section */
/* Main Tab Content Logic */
.main-tab-content {
    display: none;
    padding-top: 180px;
    /* Account for fixed header height */
    min-height: 100vh;
}

.main-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Hero Section override for tab view */
.hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    /* Padding is now handled by main-tab-content, but we need some internal spacing */
    padding: 180px 1rem 4rem 1rem !important;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #4b5563;
}

.hero-filter-section {
    margin: 2rem 0;
}

.hero-filter-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

/* Sections */
section {
    padding: 6rem 2rem;
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

/* Filter Tabs (used in hero section) */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.filter-tab {
    background-color: var(--white);
    color: var(--text-color);
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-tab.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.filter-tab.active:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
}

/* Featured Recipes Section */
.featured-recipes {
    background-color: var(--white);
    padding: 4rem 2rem;
}

/* Meal Planner Section */
.meal-planner {
    background-color: var(--light-gray);
    padding: 4rem 10rem;
}

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

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--secondary-color);
}

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

.day-column {
    background: var(--white);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.day-column h4 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.meal-slot {
    margin-bottom: 1rem;
}

.meal-type {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meal-content {
    background: var(--light-gray);
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.meal-content:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.selected-meal {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selected-meal strong {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.selected-meal small {
    color: #6b7280;
    font-size: 0.75rem;
    font-style: italic;
}

.empty-slot {
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Meal Selection Dropdown */
.meal-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-content {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    min-width: 400px;
    max-width: 90vw;
}

.dropdown-content h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

#meal-selector {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    background: var(--white);
    color: var(--text-color);
}

#meal-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.dropdown-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.dropdown-btn.confirm:hover {
    background: var(--secondary-color);
}

.dropdown-btn.cancel {
    background: #e5e7eb;
    color: var(--text-color);
}

.dropdown-btn.cancel:hover {
    background: #d1d5db;
}

/* My Recipes Button in Header */
.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.login-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Restored My Account Button Style */
.my-account-btn {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-radius: 6px;
    margin: 0.5rem 1rem;
    justify-content: center;
    text-align: center;
    width: auto !important;
    padding: 0.5rem 1rem !important;
}

.my-account-btn:hover {
    background-color: var(--secondary-color) !important;
    color: white !important;
    transform: translateY(-1px);
}


/* My Recipes Modal */
.my-recipes-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 15px;
    width: 90vw;
    max-width: 1000px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: none;
}

.modal-header h2 {
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: #9ca3af;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-tabs {
    display: flex;
    background: #f8fafc;
    padding: 0.5rem 0.5rem 0 0.5rem;
    gap: 0.25rem;
    margin: 0 2rem;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    font-weight: 500;
    border-radius: 8px;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.tab-btn:hover:not(.active) {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.modal-body {
    padding: 0;
    max-height: 50vh;
    overflow-y: auto;
    background: var(--white);
}

.tab-content {
    padding: 2rem;
    min-height: 300px;
}

.tab-content:not(.active) {
    display: none;
}

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

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.recipe-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.recipe-card-mini {
    background: var(--light-gray);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.recipe-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.recipe-card-mini.favorite {
    border-left-color: #ef4444;
}

.recipe-card-mini.weekly-menu {
    border-left-color: #10b981;
}

.recipe-card-mini h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.recipe-card-mini p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 3rem;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

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

.meal-actions .action-btn {
    background: var(--primary-color);
    margin-top: inherit;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meal-actions .action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Shopping List Section */
.shopping-list {
    background: var(--white);
    padding: 4rem 2rem;
}

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

.list-header {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.list-header .action-btn {
    background: var(--primary-color);
    margin-top: inherit;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-header .action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.shopping-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.category-section {
    background: var(--light-gray);
    border-radius: 10px;
    padding: 0.75rem;
    min-width: 0;
    /* Prevents overflow */
}

.category-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 1rem;
    /* Slightly smaller font */
    white-space: nowrap;
    /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.shopping-items {
    list-style: none;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.shopping-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.shopping-item label {
    flex: 1;
    cursor: pointer;
}

.shopping-item input[type="checkbox"]:checked+label {
    text-decoration: line-through;
    color: #6b7280;
}

.remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Contributors Section */
.profile {
    background: var(--light-gray);
    padding: 4rem 2rem;
}

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

.favorites-section,
.weekly-menu-section {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.favorites-section h3,
.weekly-menu-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorites-section h3 i {
    color: #ef4444;
}

.weekly-menu-section h3 i {
    color: #10b981;
}

.favorites-list,
.weekly-menu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.favorite-item,
.weekly-menu-item {
    background: var(--light-gray);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
}

.favorite-item {
    border-left-color: #ef4444;
}

.weekly-menu-item {
    border-left-color: #10b981;
}

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.contributor-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.contributor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.contributor-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.contributor-avatar i {
    font-size: 3rem;
    color: var(--primary-color);
}

.contributor-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contributor-info p {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.contributor-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contributor-stat {
    text-align: center;
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
}

.contributor-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.contributor-stat-label {
    color: #6b7280;
    font-size: 0.8rem;
}

.contributor-recipes {
    margin-top: 1rem;
}

.contributor-recipes h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.recipe-list {
    list-style: none;
}

.recipe-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    color: #6b7280;
    font-size: 0.9rem;
}

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

.recipe-origin-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.origin-tag {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Import Section */
.import-section {
    background: var(--white);
    padding: 4rem 2rem;
}

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

.import-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.import-card {
    background: var(--light-gray);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.import-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.import-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.import-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.import-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.import-form {
    display: flex;
    gap: 0.5rem;
}

.import-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.9rem;
}

.import-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 10;
}

.import-btn:hover {
    background: var(--secondary-color);
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.file-label:hover {
    background: var(--secondary-color);
}

.recipe-showcase {
    max-width: 85%;
    margin: 0 auto;
    display: -ms-inline-grid;
    justify-content: center;
    gap: 2rem;
}

.recipe-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    width: 95%;
    max-width: 1650px;
    margin: 0 auto;
    padding: 0;
}

/* Ensure the image area keeps a consistent aspect ratio inside the card */
.recipe-card .recipe-image {
    width: 85%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-card .recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-actions {
    position: absolute;
    bottom: 1rem;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.favorite-toggle,
.weekly-menu-toggle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorite-toggle:hover,
.weekly-menu-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.favorite-toggle i,
.weekly-menu-toggle i {
    font-size: 1.2rem;
    color: #d1d5db;
    transition: var(--transition);
}

/* Recipe Detail Page Styles */
.recipe-detail-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.recipe-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.recipe-header {
    display: block;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    color: var(--text-color);
    margin-top: 0;
    width: 100%;
}

.recipe-image img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
}

.recipe-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--header-text-color);
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.recipe-meta span {
    background: rgba(6, 78, 59, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    color: var(--text-color);
}

.recipe-actions {
    display: block;
    gap: 1rem;
}

.btn-favorite,
.btn-weekly-menu {
    padding: 0.75rem 1.5rem;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-favorite:hover,
.btn-weekly-menu:hover {
    background: white;
    color: var(--primary-color);
}

.btn-favorite.active,
.btn-weekly-menu.active {
    background: white;
    color: var(--primary-color);
}

.recipe-actions-section {
    padding: 1rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.recipe-content {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-top: 0;
}

.ingredients-section,
.instructions-section,
.nutrition-section {
    margin-bottom: 2rem;
}

.ingredients-section h2,
.instructions-section h2,
.nutrition-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ingredients-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

#ingredients-list {
    list-style: none;
    padding: 0;
}

#ingredients-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#ingredients-list li:last-child {
    border-bottom: none;
}

#ingredients-list li i {
    color: var(--success-color);
}

.instructions-list {
    counter-reset: step-counter;
    padding-left: 0;
    list-style: none;
}

.instructions-list li {
    counter-increment: step-counter;
    margin-bottom: 1rem;
    padding: 1rem 1rem 1rem 2.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    position: relative;
    list-style: none;
}

.instructions-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.nutrition-section {
    grid-column: 1 / -1;
    background: #f0f9ff;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #bae6fd;
}

/* Recipe Parts Styling */
.recipe-part {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.recipe-part h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.part-ingredients,
.part-instructions {
    margin-bottom: 1rem;
}

.part-ingredients h4,
.part-instructions h4 {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.part-ingredients .ingredients-list {
    list-style: none;
    padding: 0;
    margin-left: 1rem;
}

.part-ingredients .ingredients-list li {
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.part-ingredients .ingredients-list li i {
    color: var(--success-color);
    font-size: 0.9rem;
}

.part-instructions .instructions-list {
    margin-left: 1rem;
    counter-reset: part-step-counter;
    list-style: none;
    padding-left: 0;
}

.part-instructions .instructions-list li {
    counter-increment: part-step-counter;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    background: white;
    border-radius: 5px;
    border-left: 3px solid #e5e7eb;
    position: relative;
    list-style: none;
}

.part-instructions .instructions-list li::before {
    content: counter(part-step-counter);
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    background: #6b7280;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Assembly Section Styling */
.recipe-assembly {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border-radius: 15px;
    border: 2px solid #f59e0b;
}

.recipe-assembly h3 {
    color: #92400e;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    justify-content: center;
}

.assembly-list {
    counter-reset: assembly-counter;
    padding-left: 0;
    max-width: 800px;
    margin: 0 auto;
    list-style: none;
}

.assembly-list li {
    counter-increment: assembly-counter;
    margin-bottom: 1rem;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    position: relative;
    font-weight: 500;
    list-style: none;
}

.assembly-list li::before {
    content: counter(assembly-counter);
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: #f59e0b;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .recipe-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .recipe-content {
        grid-template-columns: 1fr;
    }

    .recipe-actions {
        flex-direction: column;
    }

    .recipe-info h1 {
        font-size: 2rem;
    }

    .recipe-part {
        padding: 1rem;
    }

    .recipe-assembly {
        padding: 1.5rem;
    }
}

.favorite-toggle.favorited i {
    color: #ef4444;
}

.weekly-menu-toggle.added i {
    color: #10b981;
}

.favorite-toggle:hover i {
    color: #ef4444;
}

.weekly-menu-toggle:hover i {
    color: #10b981;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.recipe-image {
    width: 100%;
    height: 400px;
    border-radius: 15px 0 0 15px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-sizing: border-box;
}

.recipe-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.recipe-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.recipe-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.recipe-author i {
    font-size: 1.2rem;
}

.recipe-author-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
    color: #6c757d;
    font-size: 0.9rem;
    flex-wrap: wrap;
    font-weight: 500;
}

.recipe-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

.recipe-date i {
    color: var(--primary-color);
    font-size: 1rem;
}

.recipe-info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.main-ingredient {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
}

.recipe-continent {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
}

.recipe-country {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
}

.recipe-info p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.recipe-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-meta span:not(.meta-label) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.recipe-meta i {
    color: var(--primary-color);
}

.recipe-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
    align-self: flex-start;
}

.recipe-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* View Recipe Button Styling */
.view-recipe-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-block;
    width: auto;
    text-transform: none;
    letter-spacing: 0.3px;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.view-recipe-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.view-recipe-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Services Section */
.services {
    background-color: var(--light-gray);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Contact Section */
.contact {
    max-width: 600px;
    margin: 0 auto;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#contact-form input,
#contact-form textarea {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

#contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Buttons */
.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Mobile Menu */
.hamburger {
    display: none;
    cursor: pointer;
    padding: 10px;
}

.line {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: block;
        z-index: 1001;
        /* Ensure above the menu */
    }

    .nav-links {
        position: fixed;
        top: 0;
        /* Cover full screen or start from top */
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: var(--transition);
        z-index: 1000;
        /* Ensure above other content */
        padding-top: 60px;
        /* Space for close button if needed, or just header */
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    .user-menu-container {
        position: relative;
        /* Ensure dropdown is positioned correctly on mobile */
        width: auto;
    }

    .hamburger.active .line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .hamburger.active .line:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    /* Fix header fixed positioning overlapping content */
    body {
        padding-top: 0;
        /* Reset if set elsewhere, handled by section padding */
    }

    /* Ensure specific sections adjust padding on mobile */
    .hero,
    .main-tab-content {
        padding-top: 100px !important;
        /* Adjust for header height */
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

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

    .recipe-card {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .recipe-image {
        height: 250px;
        border-radius: 15px 15px 0 0;
        order: -1;
        /* Ensure image is on top */
    }


    .recipe-info {
        padding: 1.5rem;
    }

    .recipe-meta {
        gap: 1rem;
    }

    .filter-tabs {
        gap: 0.75rem;
    }

    .filter-tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .meal-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .day-column {
        margin-bottom: 1rem;
    }

    .meal-actions {
        flex-direction: column;
        align-items: center;
    }

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

    .contributor-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .contributor-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .import-methods {
        grid-template-columns: 1fr;
    }

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

    .recipe-showcase {
        grid-template-columns: 1fr;
    }

    /* Profile Page Mobile */
    .user-profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .user-info-large h1 {
        font-size: 1.8rem;
    }

    .profile-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
        flex: 0 0 auto;
        /* Don't shrink */
    }

    /* Account Page Mobile */
    .account-container {
        padding: 1rem;
        padding-top: 80px;
    }

    .profile-tabs {
        margin-bottom: 1.5rem;
    }

    /* Modals Mobile */
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 1.5rem;
        max-height: 80vh;
        overflow-y: auto;
    }

    .my-recipes-modal .modal-content {
        width: 95%;
        height: 80vh;
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        max-height: calc(80vh - 120px);
    }

    /* Recipe Detail Mobile Fixes */
    .recipe-header {
        padding-top: 2rem;
    }

    .recipe-info h1 {
        font-size: 1.8rem !important;
    }

    .recipe-content {
        padding: 1rem !important;
        margin-top: 1rem !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .recipe-actions-section {
        flex-direction: column;
        padding: 1rem;
    }

    .servings-control {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .servings-control>div {
        width: 100%;
        justify-content: space-between;
    }

    /* Import Section Mobile */
    .import-card {
        padding: 1.5rem;
    }
}

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

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

.animate {
    animation: fadeIn 1s ease-out forwards;
}

/* Page-specific override: maximize images inside their containers without cropping (contain) */
.recipe-card .recipe-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Ensure images scale to the largest possible size inside the div, keep aspect ratio, no cropping */
.recipe-card .recipe-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
}

/* Ensure images are vertically and horizontally centered inside their containers */
.recipe-card .recipe-image,
.recipe-image {

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make sure images are centered (object-position) and constrained to container */
.recipe-card .recipe-image img,
.recipe-image img {
    object-position: center center;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.recipe-card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.recipe-card-actions .btn-favorite,
.recipe-card-actions .btn-weekly-menu,
.recipe-card-actions .btn-follow {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    background: transparent;
    color: #4b5563;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.recipe-card-actions .btn-favorite:hover {
    background: #fecdd3;
    border-color: #fb7185;
    color: #be123c;
}

.recipe-card-actions .btn-weekly-menu:hover {
    background: #ede9fe;
    border-color: #d8b4fe;
    color: #7c3aed;
}

.recipe-card-actions .btn-follow:hover {
    background: #cffafe;
    border-color: #67e8f9;
    color: #0891b2;
}

.recipe-card-actions .btn-favorite.active {
    background: #f43f5e;
    border-color: #f43f5e;
    color: white;
}

.recipe-card-actions .btn-weekly-menu.added {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.recipe-card-actions .btn-follow.active {
    background: #06b6d4;
    border-color: #06b6d4;
    color: white;
    cursor: not-allowed;
}

/* Login Modal */
.login-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.login-modal .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
}

.login-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.login-modal .close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.login-modal .form-group {
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.login-modal .form-group label {
    display: block;
    margin-bottom: 5px;
}



.login-modal .form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.login-modal .btn-login,
.login-modal .btn-create-account {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}


.recipe-card-actions .btn-view-recipe {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.3px;
}

.recipe-card-actions .btn-view-recipe:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}



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

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal .modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal .close:hover,
.modal .close:focus {
    color: #000;
}

.modal h2 {
    margin-top: 0;
    color: var(--text-color);
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.modal input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal button[type="submit"]:hover {
    background-color: var(--secondary-color);
}

.modal p {
    text-align: center;
    margin-top: 15px;
}

.modal p a {
    color: var(--primary-color);
    text-decoration: none;
}

.modal p a:hover {
    text-decoration: underline;
}

/* Manual Entry Modal Styles */
.recipe-modal {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: var(--header-text-color);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Profile Page Recipe Card Buttons */
.recipe-card .action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    text-decoration: none;
}

.recipe-card .action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    color: white;
}

/* Override the .btn-favorite styles from detail page if they leak */
.recipe-card .btn-favorite,
.recipe-card .btn-weekly-menu {
    border: none;
    color: white;
}

/* Active state (Remove) - Red for remove */
.recipe-card .action-btn.active {
    background-color: #ef4444;
}

.recipe-card .action-btn.active:hover {
    background-color: #dc2626;
}

/* Filter Dropdowns in Hero Section */
.filter-select {
    background-color: var(--white);
    color: var(--text-color);
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65em auto;
    padding-right: 2.5rem;
    /* Space for arrow */
    min-width: 150px;
}

.filter-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* Account Page Buttons */
.remove-recipe-btn {
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: absolute;
    top: -8px;
    right: -8px;
    transition: background 0.3s ease;
}

.remove-recipe-btn:hover {
    background: var(--header-text-color) !important;
}

#clear-weekly-menu {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

#clear-weekly-menu:hover {
    background-color: var(--header-text-color);
}

/* Shopping List Toggles */
.list-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 600px) {
    .list-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.shopping-toggles {
    display: flex;
    background: #e0e0e0;
    border-radius: 20px;
    padding: 4px;
    gap: 0;
}

.shopping-toggle-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s ease;
}

.shopping-toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.shopping-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
}

.list-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Contributors Controls */
.contributors-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-color);
}

.toggle-buttons {
    display: flex;
    background: #f3f4f6;
    border-radius: 25px;
    padding: 4px;
}

.toggle-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 20px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover:not(.active) {
    color: var(--text-color);
}

@media (max-width: 600px) {
    .contributors-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Map Section Styles */
.map-section {
    padding: 2rem;
    background: #f9fafb;
    border-radius: 15px;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.map-wrapper {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#world-map {
    width: 100%;
    height: auto;
    display: block;
}

#world-map path {
    fill: #e5e7eb;
    stroke: #ffffff;
    stroke-width: 0.5;
    transition: fill 0.3s ease;
    cursor: default;
}

#world-map path.has-recipes {
    fill: #93c5fd;
    cursor: pointer;
}

#world-map path.has-recipes:hover {
    fill: #3b82f6;
}

#world-map path.active-country {
    fill: #2563eb !important;
}

.map-tooltip {
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.2s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

#map-results-container {
    padding-top: 2rem;
    border-top: 1px solid #eee;
    animation: fadeIn 0.5s ease;
}

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

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

/* Map Recipe List - Override Grid */
#map-recipes-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem;
    grid-template-columns: none !important;
}

/* Map Recipe Card Styles */
.map-recipe-card {
    display: flex;
    flex-direction: row;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #eee;
    align-items: center;
    width: 100%;
}

.map-recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.map-recipe-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.map-recipe-info {
    flex: 1;
}

.map-recipe-title {
    font-size: 1.2rem;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-family: var(--heading-font);
}

.map-recipe-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.map-recipe-title a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.map-recipe-meta {
    font-size: 0.9rem;
    color: #6b7280;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.map-recipe-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.map-recipe-meta i {
    color: var(--primary-color);
}

.map-recipe-actions {
    margin-left: 2rem;
    display: flex;
    gap: 0.5rem;
}

/* Hide legacy elements in map card context if reusing classes */
.map-recipe-card .recipe-image {
    display: none;
}

/* Map Recipe Card Buttons */
.map-recipe-actions button {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    background: transparent;
    color: #4b5563;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.map-recipe-actions .btn-favorite:hover {
    background: #fecdd3;
    border-color: #fb7185;
    color: #be123c;
}

.map-recipe-actions .btn-weekly-menu:hover {
    background: #ede9fe;
    border-color: #d8b4fe;
    color: #7c3aed;
}

.map-recipe-actions button.active.btn-favorite {
    background: #f43f5e;
    border-color: #f43f5e;
    color: white;
}

.map-recipe-actions button.active.btn-weekly-menu {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

/* Nutrition Tooltips */
.nutrition-item {
    position: relative;
    cursor: help;
}

.nutrition-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    width: 220px;
    z-index: 9999;
    border: 1px solid #cbd5e1;
    margin-bottom: 12px;
    pointer-events: none;
    white-space: normal;
    text-align: left;
}

.nutrition-item:hover .nutrition-tooltip {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Arrow */
.nutrition-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.nutrition-tooltip strong {
    display: block;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.25rem;
}

.nutrition-tooltip ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nutrition-tooltip li {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
    padding: 4px 0;
    border-bottom: 1px solid #f8fafc;
}

.nutrition-tooltip li:last-child {
    border-bottom: none;
}

.nutrition-tooltip li span:first-child {
    font-weight: 500;
    text-transform: capitalize;
}

.nutrition-tooltip li span:last-child {
    font-family: monospace;
    font-weight: 600;
}

/* Cooking Mode Drawer */
.cooking-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cooking-drawer.open {
    transform: translateX(0);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

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

.drawer-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#close-drawer-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

.drawer-controls {
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.drawer-controls label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #475569;
    font-weight: 500;
}

.drawer-controls input[type="time"] {
    padding: 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    color: #1e293b;
}

.time-set-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.time-set-btn:hover {
    background: #059669;
    /* Darker primary */
}

.timeline-steps {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.timeline-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 30px;
    bottom: -24px;
    width: 2px;
    background: #e2e8f0;
}

.timeline-step:last-child::before {
    display: none;
}

.step-time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.step-calculated-time {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
    background: #e0f2fe;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.step-duration-edit {
    font-size: 0.75rem;
    color: #64748b;
    border: none;
    background: transparent;
    width: 40px;
    text-align: center;
    border-bottom: 1px dashed #cbd5e1;
}

.step-content {
    flex: 1;
    padding-top: 2px;
}

.step-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}

.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.total-time-summary {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #1e293b;
}

/* Shopping List Tooltip */
.shopping-item {
    position: relative;
    cursor: help;
}

.shopping-item:hover::after {
    content: "From: " attr(data-source);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}

.shopping-item:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}

/* Servings Control in Weekly Menu */
.servings-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 12px;
}

.serv-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

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

.servings-display {
    font-weight: 600;
    color: #4b5563;
    min-width: 45px;
    text-align: center;
}

/* Custom Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    margin-bottom: -6px;
    /* Overlap slightly */
    z-index: 1000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Compact Recipe Card (Shared between Profile and Account) */
.recipe-card-compact {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.recipe-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: #d1d5db;
}

.recipe-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .recipe-list {
        grid-template-columns: 1fr;
    }
}

/* High specificity to override any legacy styles */
/* High specificity to override any legacy styles */
body .recipe-card-compact img,
.compact-thumb {
    width: 90px !important;
    height: 60px !important;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #f3f4f6;
    max-width: none;
    /* Prevent responsive constraints */
}

.recipe-card-compact .compact-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recipe-card-compact h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #1f2937;
    font-weight: 600;
}

.recipe-card-compact .compact-meta {
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-card-compact .attempt-badge {
    color: var(--primary-color, #10b981);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Import Section Styles - Added to fix Upload Button sizing */
.import-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.import-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

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

.import-card i.fa-file-upload,
.import-card i.fa-link,
.import-card i.fa-edit {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.import-card h3 {
    margin: 0;
    color: var(--header-text-color);
}

.import-card p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.file-upload {
    width: 100%;
    display: flex;
    justify-content: center;
}

.file-upload input[type='file'] {
    display: none;
}

.file-label,
.import-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 3rem;
    /* Extra padding for icon space */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    width: auto;
    min-width: 200px;
    /* Ensure enough width for the layout */
    text-decoration: none;
    text-align: center;
}

.file-label i,
.import-btn i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.file-label:hover,
.import-btn:hover {
    background-color: var(--secondary-color);
}

.import-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.import-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

/* Mobile Meal Planner Fixes */
@media (max-width: 768px) {
    .meal-planner {
        padding: 2rem 1rem;
    }

    .meal-planner-container {
        width: 100%;
        padding: 0;
    }

    .week-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    .week-header h3 {
        font-size: 1.1rem;
        margin: 0;
    }

    .nav-btn {
        width: 100%;
    }

    .meal-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }


    .day-column {
        padding: 1rem;
    }

    /* Shopping List Mobile Fixes */
    .shopping-list {
        padding: 160px 1rem 2rem 1rem;
        /* Increase top padding to clear fixed header */
    }

    .shopping-categories {
        grid-template-columns: 1fr;
        /* Stack categories vertically */
        gap: 1.5rem;
    }

    /* Hardware acceleration for smoother scrolling */
    .shopping-item {
        transform: translateZ(0);
        will-change: transform;
        opacity: 1 !important;
        /* Force visibility */
        visibility: visible !important;
    }

    /* Aggressive overrides to prevent clipping */
    .shopping-list,
    .shopping-container,
    .shopping-categories,
    .category-section {
        height: auto !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    .shopping-items {
        display: block !important;
        /* Prevent grid collapse */
        height: auto !important;
        overflow: visible !important;
    }

    .list-header {
        flex-direction: column;
        gap: 1rem;
    }

    .list-header .action-btn {
        width: 100%;
        justify-content: center;
    }

    /* Mobile Header/User Menu Fixes */
    .nav-links li {
        width: 100%;
        display: block;
    }

    .user-menu-container {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .login-btn,
    .my-account-btn {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        padding: 0.75rem !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Ensure dropdown is visible/inline on mobile if needed, or rely on existing click hover? 
       Actually, for mobile, it's better to just show the links directly or ensure the hover/click works.
       Let's force the dropdown to be relative/block if the container is active/hovered, or just style the account button to go to account page directly if logic permits.
       For now, let's just make sure the container and button are visible.
    */
    .user-dropdown {
        position: static;
        /* Stack properly in mobile menu */
        width: 100%;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        background: #f8fafc;
        display: none;
        /* Controlled by JS or hover */
    }

    .user-menu-container.logged-in:hover .user-dropdown,
    .user-menu-container.logged-in .user-dropdown {
        display: block;
        /* Ensure it can be seen when interacting */
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.close-modal {
    color: #6b7280;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #1f2937;
    text-decoration: none;
}

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

.secondary-btn {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background-color: #e5e7eb;
}