* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #2d2d2d;
    background-color: #fff;
    padding-top: 120px; /* Reduced padding for shorter navbar */
    /* Position relative for pseudo-element background */
    position: relative;
}

/* Linen background for entire page using pseudo-element */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Same linen image with lighter overlay and enhanced filters */
    background: 
        linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
        url('Pure-Linen-Tablecloth.avif');
    background-size: 100% 100%, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    /* Enhanced filters to make texture more visible */
    filter: saturate(0.4) brightness(1.15) contrast(1.1);
    /* Behind all page content - very low z-index */
    z-index: -10;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Desktop styles - ensure desktop-only elements are visible */
.desktop-only {
    display: block;
}

/* Hide mobile logout button on desktop */
#mobile-logout-btn {
    display: none;
}

/* Mobile logout button visibility controlled by body classes */
@media (max-width: 768px) {
    /* Simple class-based visibility control */
    .mobile-logged-out-only {
        display: flex !important;
    }
    
    .mobile-logged-in-only {
        display: none !important;
    }
    
    /* When body has mobile-logged-in class, reverse the visibility */
    body.mobile-logged-in .mobile-logged-out-only {
        display: none !important;
    }
    
    body.mobile-logged-in .mobile-logged-in-only {
        display: flex !important;
    }
    
    /* Style mobile logout button like other auth buttons */
    #mobile-logout-btn {
        width: 40px !important;
        height: 40px !important;
        background: none !important;
        border: none !important;
        color: #555 !important;
        font-size: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    #mobile-logout-btn:hover {
        background: rgba(109, 19, 19, 0.1) !important;
        color: #6d1313 !important;
    }
    
    #mobile-logout-btn .btn-icon {
        display: block !important;
        font-size: 1.2rem !important;
    }
}

/* Navigation */
.navbar {
    /* Solid background - no overlays or filters */
    background: #fefefe;
    color: #2d2d2d;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-bottom: none;
}

/* Ensure navigation content is above background */
.navbar .nav-container {
    position: relative;
    z-index: 9999;
    isolation: isolate; /* Create new stacking context */
}

/* Ensure navigation menu is properly layered */
.nav-menu {
    position: relative;
    z-index: 10000;
    isolation: isolate; /* Create new stacking context */
}

.nav-menu li {
    position: relative;
    z-index: 10001;
    isolation: isolate; /* Create new stacking context */
}

.nav-menu a {
    position: relative;
    z-index: 10002;
    isolation: isolate; /* Create new stacking context */
}

/* Ensure icons are above everything */
.nav-icon {
    position: relative;
    z-index: 10003;
    isolation: isolate; /* Create new stacking context */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    min-height: 100px; /* Reduced height for landscape logo */
}

.nav-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #6d1313;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    order: 1;
    margin-right: auto;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(109, 19, 19, 0.2));
}

.logo-icon-img {
    height: 117px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(109, 19, 19, 0.2));
}

/* Desktop landscape logo */
.desktop-logo {
    display: block;
    height: 80px; /* Shorter height for landscape format */
    width: auto;
}

/* Mobile portrait logo */
.mobile-logo {
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    order: 2;
    margin-top: 0;
}

/* Desktop-only: Enhanced styling for admin navigation items */
@media (min-width: 769px) {
    .nav-menu {
        gap: 0.5rem; /* More space between items on desktop */
    }
    
    /* Make admin nav items (favorites, add recipe, manage users) bigger on desktop */
    .nav-menu li#favorites-nav a,
    .nav-menu li#add-recipe-nav a,
    .nav-menu li#manage-users-nav a {
        font-size: 0.98rem; /* 15% bigger than 0.85rem */
        padding: 10px 16px; /* More padding for bigger appearance */
        font-weight: 600; /* Slightly bolder */
    }
    
    /* Make admin nav icons 15% bigger on desktop */
    .nav-menu li#favorites-nav .nav-icon,
    .nav-menu li#add-recipe-nav .nav-icon,
    .nav-menu li#manage-users-nav .nav-icon {
        width: 21px; /* 15% bigger than 18px */
        height: 21px;
    }
}

.nav-menu li {
    position: relative;
}

.nav-menu li:first-child,
.nav-menu li:nth-child(2) {
    display: none;
}

.nav-menu a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px; /* Increased from 5px to 8px for more space */
    white-space: nowrap;
    /* Ensure visibility above any overlays */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: none;
}

.nav-icon {
    width: 18px;
    height: 18px;
    opacity: 1; /* Full opacity */
    transition: transform 0.2s ease;
    flex-shrink: 0;
    /* Ensure icon visibility */
    filter: none;
    mix-blend-mode: normal;
}

.nav-menu a:hover {
    color: #6d1313;
    background: rgba(109, 19, 19, 0.08);
}

.nav-menu a:hover .nav-icon {
    transform: scale(1.15);
}

.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center; /* Ensure vertical alignment */
    order: 3;
    position: relative;
    z-index: 9998;
    height: 42px; /* Container height to match button height */
}

#login-btn {
    order: 1;
}

#signup-btn {
    order: 2;
}

#dark-mode-toggle {
    order: 4;
    position: relative;
    z-index: 9999;
}

#user-menu {
    order: 3;
}

.auth-btn {
    background: #6d1313;
    color: white;
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(109, 19, 19, 0.2);
    height: 42px; /* Fixed height for consistency */
    min-height: 42px;
}

.btn-icon {
    width: 18px; /* 15% bigger than 16px */
    height: 18px;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Specific styling for heart icons in modal to prevent cropping */
.favorite-btn-large .btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.auth-btn:hover {
    background: #4a0e0e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 19, 19, 0.35);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn-secondary {
    background: transparent;
    color: #6d1313;
    border: 2px solid #6d1313;
    box-shadow: none;
}

.auth-btn-secondary:hover {
    background: #6d1313;
    color: white;
    box-shadow: 0 4px 12px rgba(109, 19, 19, 0.25);
}

/* Change sparkles icon to gold on signup button hover in light mode */
body:not(.dark-mode) #signup-btn:hover .btn-icon[src*="sparkles(6d1313)"] {
    content: url('icons/sparkles(c9ac1b).svg');
}

/* Change sparkles icon to gold on signup button hover in dark mode */
body.dark-mode #signup-btn:hover .btn-icon[src*="sparkles(ffffff)"] {
    content: url('icons/sparkles(c9ac1b).svg');
}

/* Change logout icon to white on logout button hover in light mode */
body:not(.dark-mode) #logout-btn:hover .btn-icon[src*="logout(6d1313)"] {
    content: url('icons/logout(ffffff).svg');
}

/* Change logout icon to white on mobile logout button hover in light mode */
body:not(.dark-mode) #mobile-logout-btn:hover .btn-icon[src*="logout(6d1313)"] {
    content: url('icons/logout(ffffff).svg');
}

.auth-btn-logout {
    background: transparent;
    color: #6d1313;
    border: 2px solid #6d1313;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-left: 18px;
    padding-right: 20px;
    height: 42px; /* Same height as other auth buttons */
    min-height: 42px;
}

.auth-btn-logout:hover {
    background: #6d1313;
    color: white;
}

#user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #6d1313;
    border-radius: 50%;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-icon {
    display: none;
}

.user-name-text {
    display: block;
}

#logout-btn:hover {
    background: #6d1313;
    color: white;
}

#user-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#user-name {
    color: white;
    font-weight: bold;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
}

.auth-switch a {
    color: #3498db;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), 
                url('https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=1600&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 140px 0 100px;
    text-align: center;
    margin-top: 0;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -1px;
    line-height: 1.3;
}

.hero-content p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.cta-button {
    background: #6d1313;
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(109, 19, 19, 0.4);
}

.cta-button:hover {
    background: #4a0e0e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(109, 19, 19, 0.5);
}

/* Recipes Section */
.recipes-section {
    padding: 60px 0 80px;
    background: rgba(255, 255, 255, 0.4);
}

.recipes-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.8rem;
    color: #2d2d2d;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.recipes-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #6d1313;
    margin: 1rem auto 3rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #fff;
}

.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: #6d1313;
}

.search-bar input {
    width: 350px;
    max-width: 100%;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.recipe-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.recipe-card-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.recipe-card-image::after {
    content: '🍽️';
    font-size: 4rem;
    opacity: 0.3;
    position: absolute;
    z-index: 1;
}

/* Hide placeholder when background image is loaded */
.recipe-card-image[style*="background-image"]::after {
    display: none;
}

.recipe-card-header {
    padding: 1.5rem 1.5rem 0.5rem;
    background: rgba(255, 255, 255, 0.95);
}

.recipe-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: #2d2d2d;
    font-weight: 700;
    line-height: 1.3;
}

.recipe-category {
    background: #fff5f5;
    color: #6d1313;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-card-body {
    padding: 0 1.5rem 1.5rem;
}

.recipe-card-body p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #999;
    font-weight: 500;
}

.recipe-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Make eye icon 15% bigger */
.meta-icon[src*="eye("] {
    width: 21px;
    height: 21px;
}

/* Add Recipe Section */
.add-recipe-section {
    padding: 80px 0;
    background: rgba(250, 250, 250, 0.4);
}

.add-recipe-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.8rem;
    color: #2d2d2d;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.add-recipe-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #6d1313;
    margin: 1rem auto 3rem;
}

.recipe-form {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #2d2d2d;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6d1313;
}

.form-group textarea {
    resize: vertical;
    line-height: 1.6;
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
    color: #999;
    font-size: 0.85rem;
}

.submit-btn {
    background: #6d1313;
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: #4a0e0e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(109, 19, 19, 0.3);
}

.cancel-btn {
    background: #666;
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.cancel-btn:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 102, 102, 0.3);
}

/* Image upload preview styles */
.upload-loading {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.upload-success {
    padding: 1rem;
    text-align: center;
    border: 2px dashed #6d1313;
    border-radius: 8px;
    background: rgba(109, 19, 19, 0.05);
}

.upload-success img {
    display: block;
    margin: 0 auto 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-success p {
    margin: 0;
    color: #6d1313;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    margin: 3% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close,
.close-auth {
    color: #999;
    float: right;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    padding: 1rem;
    transition: color 0.2s;
}

.close:hover,
.close-auth:hover {
    color: #6d1313;
}

.recipe-detail {
    padding: 2.5rem;
}

.recipe-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.recipe-detail h2 {
    color: #2d2d2d;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.recipe-detail h3 {
    color: #2d2d2d;
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 3px solid #6d1313;
    padding-bottom: 0.5rem;
}

.recipe-detail .ingredients,
.recipe-detail .instructions {
    margin-bottom: 2rem;
}

.recipe-detail .ingredients ul {
    list-style-type: none;
    margin-left: 0;
    padding-left: 0;
}

.recipe-detail .ingredients li {
    padding: 0.6rem 0;
    position: relative;
    line-height: 1.6;
}

/* Remove checkmark for ingredient items with checkboxes */
.recipe-detail .ingredients .ingredient-item::before {
    content: none;
}

/* Keep checkmark for non-checkbox lists (legacy recipes) */
.recipe-detail .ingredients li:not(.ingredient-item) {
    padding-left: 1.5rem;
}

.recipe-detail .ingredients li:not(.ingredient-item)::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #6d1313;
    font-weight: bold;
}

.recipe-detail .instructions ol {
    margin-left: 30px;
    padding-left: 0;
    counter-reset: item;
    list-style: none;
}

.recipe-detail .instructions li {
    padding: 1rem 0;
    padding-left: 0.5rem;
    position: relative;
    line-height: 1.7;
    counter-increment: item;
}

.recipe-detail .instructions li::before {
    content: counter(item);
    position: absolute;
    left: -30px;
    top: 1rem;
    background: #6d1313;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.recipe-detail .recipe-info {
    display: flex;
    justify-content: space-around;
    background: #fafafa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #f0f0f0;
}

.recipe-detail .recipe-info span {
    text-align: center;
    font-weight: 600;
    color: #666;
}

.recipe-detail p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 50%, #1a1a1a 100%);
    color: #ccc;
    text-align: center;
    padding: 3rem 0;
    margin-top: 0;
    border-top: 4px solid #6d1313;
    /* Position relative for pseudo-element background */
    position: relative;
}

/* Linen background for footer using pseudo-element */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Linen image with dark overlay for footer */
    background: 
        linear-gradient(rgba(45, 45, 45, 0.8), rgba(45, 45, 45, 0.8)),
        url('Pure-Linen-Tablecloth.avif');
    background-size: 100% 100%, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    /* Apply filters for footer */
    filter: saturate(0.3) brightness(0.7) contrast(1.1);
    /* Behind footer content */
    z-index: -1;
}

/* Ensure footer content is above background */
footer .container {
    position: relative;
    z-index: 1;
}

footer p {
    font-size: 0.9rem;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.1rem;
    color: #999;
    font-style: italic;
}

.error {
    background: #fff5f5;
    color: #6d1313;
    padding: 1.2rem 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    text-align: center;
    border-left: 4px solid #6d1313;
    font-weight: 500;
}

.success {
    background: #f0fdf4;
    color: #16a34a;
    padding: 1.2rem 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    text-align: center;
    border-left: 4px solid #16a34a;
    font-weight: 500;
}

/* Auth Modal Styling */
#auth-content {
    padding: 2rem;
}

#auth-content h2 {
    color: #2d2d2d;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
}

#auth-content .form-group {
    margin-bottom: 1.2rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-switch a {
    color: #6d1313;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.form-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* MOBILE ONLY - Container adjustments */
    .navbar .nav-container {
        min-height: auto !important;
        padding: 8px 8px !important; /* Reduced padding for more space */
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 4px !important; /* Small gap between sections */
    }
    
    /* MOBILE LOGGED IN - Adjust container for 5-icon layout */
    body.mobile-logged-in .navbar .nav-container {
        justify-content: flex-start !important; /* Allow proper distribution */
        gap: 2px !important; /* Minimal gap */
    }
    
    /* MOBILE ONLY - Hide desktop-only elements */
    .desktop-only {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* MOBILE ONLY - Logo switching */
    .desktop-logo {
        display: none !important;
    }
    
    .mobile-logo {
        display: block !important;
        height: 60px !important; /* Smaller height for mobile */
    }
    
    /* MOBILE ONLY - Logo (left side, smaller, no shadow) */
    .navbar .nav-logo {
        order: 1 !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        font-size: 1.2rem !important;
    }
    
    .navbar .logo-icon-img {
        height: 50px !important; /* Smaller logo for more space */
        filter: none !important;
        box-shadow: none !important;
    }
    
    /* MOBILE ONLY - Hide regular nav menu items completely */
    .navbar .nav-menu li:first-child,
    .navbar .nav-menu li:nth-child(2) {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* MOBILE ONLY - Force hide user menu completely on mobile (both logged in and out) */
    .navbar #user-menu,
    .navbar #user-menu *,
    .navbar .user-name-display,
    .navbar #logout-btn,
    .navbar #user-name,
    .navbar .user-icon,
    .navbar .user-name-text {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* MOBILE LOGGED OUT - Center auth buttons as icons */
    .navbar .auth-buttons {
        order: 2 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: space-evenly !important; /* Evenly distribute login/signup buttons */
        gap: 0 !important; /* Remove gap for even distribution */
        padding: 0 15px !important; /* Padding from edges */
    }
    
    /* MOBILE LOGGED IN - Show mobile logout button in auth-buttons */
    body.mobile-logged-in .navbar .auth-buttons {
        order: 2 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: space-evenly !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 0 10px !important;
    }
    
    /* MOBILE LOGGED IN - Hide login/signup buttons */
    body.mobile-logged-in .navbar #login-btn,
    body.mobile-logged-in .navbar #signup-btn {
        display: none !important;
    }
    
    /* MOBILE LOGGED IN - Show mobile logout button */
    body.mobile-logged-in .navbar #mobile-logout-btn {
        display: flex !important;
        order: 4 !important; /* After the nav icons */
    }
    
    /* MOBILE ONLY - Mobile logout button styling (controlled by JavaScript) */
    .navbar #mobile-logout-btn {
        width: 40px !important;
        height: 40px !important;
        background: none !important;
        border: 2px solid #6d1313 !important;
        color: #6d1313 !important;
        font-size: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        box-shadow: none !important;
        padding: 0 !important;
        display: none !important; /* Hidden by default, shown by JavaScript when needed */
    }
    
    /* When JavaScript sets display: flex, ensure it shows properly */
    .navbar #mobile-logout-btn[style*="flex"] {
        display: flex !important;
    }
    
    .navbar #mobile-logout-btn:hover {
        background: #6d1313 !important;
        color: white !important;
        transform: none !important;
        box-shadow: none !important;
    }
    
    .navbar #mobile-logout-btn .btn-icon {
        display: block !important;
        font-size: 1.2rem !important;
    }
    
    /* MOBILE ONLY - Ensure auth-buttons container doesn't show user menu */
    .navbar .auth-buttons #user-menu,
    .navbar .auth-buttons .user-name-display,
    .navbar .auth-buttons #logout-btn {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* MOBILE LOGGED IN - Show admin nav icons in nav-menu (center) */
    .navbar .nav-menu {
        display: none !important; /* Hidden by default */
        justify-content: flex-start !important; /* Start from left within the center area */
        align-items: center !important;
        order: 2 !important;
        margin: 0 !important;
        flex: 2 !important; /* Take more space for the 3 admin icons */
        gap: 0 !important;
        padding: 0 5px 0 20px !important; /* Add left padding to shift icons right */
        position: relative !important;
        z-index: 10010 !important;
    }
    
    /* Show nav-menu only when logged in on mobile */
    body.mobile-logged-in .navbar .nav-menu {
        display: flex !important;
        justify-content: space-evenly !important; /* Evenly distribute the 3 admin icons */
    }
    
    /* Only admin nav items should be visible and distributed on mobile */
    .navbar .nav-menu li#favorites-nav,
    .navbar .nav-menu li#add-recipe-nav,
    .navbar .nav-menu li#manage-users-nav {
        display: flex !important;
        flex: 1 !important; /* Each visible item takes equal space */
        justify-content: center !important;
    }
    
    .navbar .nav-menu li {
        position: relative !important;
        z-index: 10011 !important;
        flex: 0 0 auto !important; /* Don't grow or shrink, but allow even distribution */
    }
    
    /* Only admin nav items should be visible and distributed on mobile */
    .navbar .nav-menu li#favorites-nav,
    .navbar .nav-menu li#add-recipe-nav,
    .navbar .nav-menu li#manage-users-nav {
        display: flex !important;
        flex: 1 !important; /* Each visible item takes equal space */
        justify-content: center !important;
    }
    
    .navbar .nav-menu a {
        padding: 8px !important; /* Slightly more padding for bigger touch targets */
        font-size: 0 !important;
        width: 36px !important; /* 15% bigger than 32px */
        height: 36px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        z-index: 10012 !important; /* Ensure mobile nav links are above everything */
    }
    
    .navbar .nav-icon {
        width: 18px !important; /* 15% bigger than 16px */
        height: 18px !important;
        position: relative !important;
        z-index: 10013 !important; /* Highest z-index for mobile icons */
    }
    
    /* MOBILE AUTH BUTTONS - Controlled by body class only */
    body:not(.mobile-logged-in) .navbar #login-btn {
        display: flex !important;
        width: 46px !important; /* 15% bigger than 40px */
        height: 46px !important;
        background: none !important;
        border: none !important;
        color: #555 !important;
        font-size: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        box-shadow: none !important;
    }
    
    body:not(.mobile-logged-in) .navbar #signup-btn {
        display: flex !important;
        width: 46px !important; /* 15% bigger than 40px */
        height: 46px !important;
        background: none !important;
        border: none !important;
        color: #555 !important;
        font-size: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        box-shadow: none !important;
    }
    
    /* MOBILE LOGGED IN - When signup button becomes logout button */
    .navbar #signup-btn.auth-btn-logout {
        border: 2px solid #6d1313 !important;
        color: #6d1313 !important;
    }
    
    .navbar #signup-btn.auth-btn-logout:hover {
        background: #6d1313 !important;
        color: white !important;
    }
    
    .navbar #signup-btn:hover {
        background: rgba(109, 19, 19, 0.1) !important;
        color: #6d1313 !important;
        transform: none !important;
        box-shadow: none !important;
    }
    
    .navbar #signup-btn .btn-icon {
        display: block !important;
        font-size: 1.3rem !important;
        width: 21px !important; /* 15% bigger than 18px */
        height: 21px !important;
    }
    
    /* Mobile login button icon size */
    body:not(.mobile-logged-in) .navbar #login-btn .btn-icon {
        display: block !important;
        font-size: 1.3rem !important;
        width: 21px !important; /* 15% bigger than 18px */
        height: 21px !important;
    }
    
    /* Ensure logout icon shows properly when signup becomes logout */
    .navbar #signup-btn.auth-btn-logout .btn-icon {
        display: block !important;
        font-size: 1.2rem !important;
    }
    
    /* MOBILE LOGOUT BUTTON - Icon only, no button styling */
    .navbar #mobile-logout-btn {
        width: 40px !important;
        height: 40px !important;
        background: none !important;
        border: none !important;
        color: #555 !important;
        font-size: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .navbar #mobile-logout-btn:hover {
        background: rgba(109, 19, 19, 0.1) !important;
        color: #6d1313 !important;
    }
    
    .navbar #mobile-logout-btn .btn-icon {
        display: block !important;
        font-size: 1.2rem !important;
    }
    
    /* Style logout button like nav icons */
    .nav-logout-btn {
        background: none !important;
        border: none !important;
        color: #555 !important;
        padding: 6px !important;
        font-size: 0 !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .nav-logout-btn:hover {
        color: #6d1313 !important;
        background: rgba(109, 19, 19, 0.08) !important;
    }
    
    .nav-logout-btn .nav-icon {
        width: 16px !important;
        height: 16px !important;
        opacity: 0.8 !important;
        transition: transform 0.2s ease !important;
    }
    
    .nav-logout-btn:hover .nav-icon {
        transform: scale(1.15) !important;
    }
    
    /* MOBILE ONLY - Dark mode (right side) */
    .navbar #dark-mode-toggle {
        order: 3 !important;
        flex: 0 0 auto !important;
        width: 40px !important;
        height: 40px !important;
        background: none !important;
        border: none !important;
        color: #555 !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
        padding: 0 !important; /* Remove padding for consistent sizing */
    }
    
    .navbar #dark-mode-toggle:hover {
        background: rgba(109, 19, 19, 0.1) !important;
        color: #6d1313 !important;
    }

    /* Icon responsive sizing for mobile */
    .btn-icon {
        width: 18px !important;
        height: 18px !important;
    }
    
    .dark-mode-icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .section-icon {
        width: 20px !important;
        height: 20px !important;
    }

    
    /* MOBILE ONLY - Other responsive adjustments */
    body {
        padding-top: 120px;
    }
    
    .hero {
        padding: 120px 20px 60px;
        margin-top: 0;
    }
    
    .hero-content h2 {
        font-size: 2.2rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .recipes-section h2,
    .add-recipe-section h2 {
        font-size: 2rem;
    }
    
    .search-bar {
        flex-direction: column;
        padding: 0 20px;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .recipe-form {
        padding: 2rem 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .recipe-detail {
        padding: 1.5rem;
    }
    
    .recipe-detail h2 {
        font-size: 1.8rem;
    }
    
    .recipe-detail .recipe-info {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        font-size: 1.4rem;
    }
    
    .logo-icon-img {
        height: 80px;
    }
    
    .auth-btn {
        padding: 0 10px;
        font-size: 0.7rem;
        height: 32px;
        min-width: 60px;
    }
    
    .icon-btn {
        height: 32px;
        width: 32px;
        min-width: 32px;
        padding: 0;
    }
    
    body {
        padding-top: 100px;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .recipe-card-image {
        height: 200px;
    }
}

/* 
User Management Section */
.manage-users-section {
    padding: 80px 0;
    background: rgba(248, 249, 250, 0.4);
}

.user-management {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.invite-admin-form h3,
.user-info-panel h3 {
    color: #2d2d2d;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.invitation-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invitation-result.loading {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1976d2;
}

.invitation-result.success {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.invitation-result.error {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

.invitation-result h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.invitation-result code {
    background: rgba(0,0,0,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
}

.invitation-result ol {
    margin: 1rem 0 0 1.5rem;
    line-height: 1.8;
}

.invitation-result .info-note {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    font-size: 0.9rem;
}

.error-details {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.user-info-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.info-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #6d1313;
}

.info-card h4 {
    color: #6d1313;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-card ol {
    margin: 0 0 0 1.5rem;
    line-height: 1.8;
}

.info-card ol li {
    margin-bottom: 0.5rem;
}

.info-card .info-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.9rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.users-table thead {
    background: #6d1313;
    color: white;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
}

.users-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.users-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-force_change_password {
    background: #fff3cd;
    color: #856404;
}

.status-unconfirmed {
    background: #f8d7da;
    color: #721c24;
}

.alert {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .user-management {
        grid-template-columns: 1fr;
    }
    
    .users-table {
        font-size: 0.85rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
}


/* Edit Recipe Button */
.edit-recipe-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    margin: 1rem 0;
    transition: background 0.2s;
}

.edit-recipe-btn:hover {
    background: #2980b9;
}

/* Form Buttons */
.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cancel-btn {
    background: #95a5a6;
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

/* Recipe Actions (Edit/Delete buttons) */
.recipe-actions {
    display: flex;
    gap: 12px;
    margin: 2rem 0 1.5rem;
    justify-content: center;
}

.edit-btn, .delete-btn {
    padding: 10px 24px;
    border: 2px solid;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: white;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.edit-btn {
    border-color: #3498db;
    color: #3498db;
}

.edit-btn::before {
    content: '✏';
    font-size: 1rem;
}

.edit-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.25);
}

.delete-btn {
    border-color: #6d1313;
    color: #6d1313;
}

.delete-btn::before {
    content: '🗑';
    font-size: 0.95rem;
}

.delete-btn:hover {
    background: #6d1313;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(109, 19, 19, 0.25);
}


/* Manage users section - controlled by JavaScript based on admin status */


/* Section headings in ingredients and instructions */
.ingredient-section,
.instruction-section {
    color: #6d1313;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.8rem;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.ingredient-section:first-child,
.instruction-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.ingredients ul + h4,
.instructions ol + h4 {
    margin-top: 1.5rem;
}


/* Ingredient checkboxes */
.ingredient-list {
    list-style: none;
    padding-left: 0;
}

.ingredient-item {
    padding: 0.6rem 0;
    transition: opacity 0.3s ease;
}

.ingredient-item label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 0.8rem;
}

.ingredient-checkbox {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #6d1313;
    border: 2px solid #6d1313;
}

.ingredient-text {
    flex: 1;
    line-height: 1.6;
}

.ingredient-item.checked .ingredient-text {
    text-decoration: line-through;
    opacity: 0.5;
    color: #999;
}

.clear-checks-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: background 0.2s;
}

.clear-checks-btn:hover {
    background: #7f8c8d;
}

.ingredients h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.password-strength.medium {
    background: #ffeaa7;
    color: #d63031;
    border: 1px solid #fdcb6e;
}

.password-strength.strong {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Recipe Sharing */
.recipe-share {
    margin: 1.5rem 0;
    text-align: center;
    display: block !important;
    visibility: visible !important;
}

.share-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.share-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.share-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.share-btn:active {
    transform: translateY(0);
}

.share-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.share-modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.share-close {
    color: #999;
    float: right;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.share-close:hover {
    color: #6d1313;
}

.share-modal-content h3 {
    color: #2d2d2d;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.share-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.share-url-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.copy-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #2980b9;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-social-btn {
    padding: 14px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-social-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.share-social-btn span {
    font-size: 0.9rem;
}

.share-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.share-social-btn:active {
    transform: translateY(0);
}

.email-btn {
    background: #ea4335;
    color: white;
}

.email-btn:hover {
    background: #d33426;
}

.facebook-btn {
    background: #1877f2;
    color: white;
}

.facebook-btn:hover {
    background: #0d65d9;
}

.twitter-btn {
    background: #1da1f2;
    color: white;
}

.twitter-btn:hover {
    background: #0c8bd9;
}

.whatsapp-btn {
    background: #25d366;
    color: white;
}

.whatsapp-btn:hover {
    background: #1fb855;
}

@media (max-width: 768px) {
    .recipe-share {
        margin: 1rem 0;
        display: block !important;
    }
    
    .share-btn {
        width: 100%;
        max-width: 300px;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .share-modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
        margin: 5% auto;
    }
    
    .share-modal-content h3 {
        font-size: 1.3rem;
    }
    
    .share-url-container {
        flex-direction: column;
    }
    
    .share-url-container input {
        font-size: 0.85rem;
    }
    
    .copy-btn {
        width: 100%;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .share-social-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .share-social-btn svg {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .share-btn {
        font-size: 0.9rem;
        padding: 12px 18px;
    }
    
    .share-modal-content {
        padding: 1.5rem 1rem;
    }
}


/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* Dark mode linen background for entire page */
body.dark-mode::before {
    background: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('Pure-Linen-Tablecloth.avif');
    background-size: 100% 100%, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    /* Enhanced contrast for dark mode */
    filter: contrast(1.2) brightness(0.8);
}

body.dark-mode .navbar {
    /* Solid dark background */
    background: #2d2d2d;
    border-bottom: none;
}

body.dark-mode .nav-menu a {
    color: #b0b0b0;
    background: rgba(45, 45, 45, 0.9);
}

body.dark-mode .nav-menu a:hover {
    color: #6d1313;
    background: rgba(109, 19, 19, 0.15);
}

body.dark-mode .auth-btn-logout {
    color: #b0b0b0;
    border-color: #6d1313; /* Keep dark red border */
    background: rgba(45, 45, 45, 0.9);
}

body.dark-mode .auth-btn-logout:hover {
    background: #6d1313; /* Dark red background on hover */
    color: white; /* White text on hover for better contrast */
    border-color: #6d1313;
}

body.dark-mode .recipe-card {
    background: rgba(45, 45, 45, 0.95);
    border-color: #3a3a3a;
}

body.dark-mode .recipe-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .recipe-card h3 {
    color: #e0e0e0;
}

body.dark-mode .recipe-card-header {
    background: rgba(45, 45, 45, 0.95);
}

body.dark-mode .recipe-card-body p {
    color: #b0b0b0;
}

body.dark-mode .recipe-form,
body.dark-mode .modal-content,
body.dark-mode .user-info-panel,
body.dark-mode .info-card {
    background: rgba(45, 45, 45, 0.95);
    border-color: #3a3a3a;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea,
body.dark-mode .search-bar input,
body.dark-mode .search-bar select {
    background: #1a1a1a;
    color: #e0e0e0;
    border-color: #3a3a3a;
}

body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .recipe-info {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

body.dark-mode footer {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #000000 100%);
    color: #888;
}

/* Dark mode linen background for footer */
body.dark-mode footer::before {
    background: 
        linear-gradient(rgba(13, 13, 13, 0.9), rgba(13, 13, 13, 0.9)),
        url('Pure-Linen-Tablecloth.avif');
    background-size: 100% 100%, cover;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    /* Enhanced contrast for dark mode footer */
    filter: contrast(1.3) brightness(0.5);
}

body.dark-mode .recipe-detail h2,
body.dark-mode .recipe-detail h3 {
    color: #e0e0e0;
}

body.dark-mode .add-recipe-section,
body.dark-mode .recipes-section,
body.dark-mode .favorites-section {
    background: rgba(26, 26, 26, 0.4);
}

body.dark-mode .add-recipe-section h2,
body.dark-mode .recipes-section h2,
body.dark-mode .favorites-section h2 {
    color: #e0e0e0;
}

body.dark-mode #auth-content h2 {
    color: #e0e0e0;
}

body.dark-mode .auth-switch {
    color: #b0b0b0;
}

body.dark-mode .form-description {
    color: #b0b0b0;
}

body.dark-mode .form-group small {
    color: #b0b0b0;
}

/* Dark Mode Toggle Button */
.icon-btn {
    background: transparent;
    border: 2px solid #6d1313;
    color: #6d1313;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px; /* Same height as auth buttons */
    min-width: 42px;
    min-height: 42px;
}

.icon-btn:hover {
    background: #6d1313;
    color: white;
}

.dark-mode-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.section-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.favorite-icon {
    width: 20px;
    height: 20px;
    transition: all 0.2s ease;
}

/* Favorite Button on Cards */
.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.favorite-btn.favorited {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

body.dark-mode .favorite-btn {
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
}

/* Recipe Card Enhancements */
.recipe-card {
    position: relative;
}

.recipe-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.recipe-difficulty {
    background: #fff5f5;
    color: #6d1313;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
    font-weight: 600;
    text-transform: capitalize;
}

.recipe-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
    font-size: 0.9rem;
}

.rating-text {
    color: #666;
    font-size: 0.85rem;
}

body.dark-mode .rating-text {
    color: #b0b0b0;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.recipe-tag {
    background: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

body.dark-mode .recipe-tag {
    background: #3a3a3a;
    color: #b0b0b0;
}

/* Search and Filter Container */
.search-filter-container {
    margin-bottom: 3rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 250px;
}

.search-bar select {
    min-width: 150px;
}

/* Tags Filter */
.tags-filter {
    text-align: center;
}

.tags-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

body.dark-mode .tags-label {
    color: #b0b0b0;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tag-btn {
    background: #f0f0f0;
    color: #666;
    border: 2px solid transparent;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.tag-btn.active {
    background: #6d1313;
    color: white;
    border-color: #6d1313;
}

body.dark-mode .tag-btn {
    background: #3a3a3a;
    color: #b0b0b0;
}

body.dark-mode .tag-btn:hover {
    background: #4a4a4a;
}

body.dark-mode .tag-btn.active {
    background: #6d1313;
    color: white;
}

/* Recipe Actions Bar */
.recipe-actions-bar {
    display: flex;
    gap: 12px;
    margin: 1.5rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: white;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Increased gap for better spacing */
}

.favorite-btn-large {
    border-color: #6d1313;
    color: #6d1313;
    padding: 12px 24px; /* Extra padding for heart icon */
}

.favorite-btn-large:hover {
    background: #6d1313;
    color: white;
}

.share-btn-small {
    border-color: #3498db;
    color: #3498db;
}

.share-btn-small:hover {
    background: #3498db;
    color: white;
}

.print-btn {
    border-color: #95a5a6;
    color: #95a5a6;
}

.print-btn:hover {
    background: #95a5a6;
    color: white;
}

body.dark-mode .action-btn {
    background: #2d2d2d;
}

body.dark-mode .action-btn:hover {
    background: #6d1313;
    border-color: #6d1313;
    color: white;
}

/* Recipe Detail Tags */
.recipe-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1.5rem 0;
}

.recipe-detail-tags .recipe-tag {
    font-size: 0.9rem;
    padding: 6px 14px;
}

/* Rating Section */
.rating-section {
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

body.dark-mode .rating-section {
    background: #1a1a1a;
}

.rating-section h3 {
    margin-bottom: 1.5rem;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.rating-stars-large {
    font-size: 2rem;
}

.rating-info {
    display: flex;
    flex-direction: column;
}

.rating-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6d1313;
    line-height: 1;
}

.rating-count {
    color: #666;
    font-size: 0.9rem;
}

body.dark-mode .rating-count {
    color: #b0b0b0;
}

/* Rating Form */
.rating-form {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

body.dark-mode .rating-form {
    background: #2d2d2d;
    border-color: #3a3a3a;
}

.rating-form h4 {
    margin-bottom: 1rem;
    color: #2d2d2d;
}

body.dark-mode .rating-form h4 {
    color: #e0e0e0;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    gap: 5px;
    margin: 1rem 0;
    justify-content: flex-start;
    align-items: center;
}

.star-input {
    font-size: 2rem;
    color: #ccc; /* Light grey for unselected */
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    filter: grayscale(100%); /* Make unselected stars grey */
}

.star-input:hover,
.star-input.hover {
    color: #ffd700; /* Gold for hover */
    filter: grayscale(0%); /* Remove grey filter */
    transform: scale(1.1);
}

.star-input.selected {
    color: #ffd700; /* Gold for selected */
    filter: grayscale(0%); /* Remove grey filter */
}

.clear-rating-btn {
    margin-left: 15px;
    padding: 5px 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
    transition: all 0.2s ease;
}

.clear-rating-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

body.dark-mode .clear-rating-btn {
    background: #2d2d2d;
    border-color: #3a3a3a;
    color: #b0b0b0;
}

body.dark-mode .clear-rating-btn:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

/* Simple Star Rating */
.simple-star-rating {
    display: flex;
    gap: 5px;
    margin: 1rem 0;
    justify-content: center;
}

.simple-star-rating .star {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.simple-star-rating .star:hover {
    transform: scale(1.1);
}

.rating-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    margin: 1rem 0;
    resize: vertical;
}

body.dark-mode .rating-form textarea {
    background: #1a1a1a;
    color: #e0e0e0;
    border-color: #3a3a3a;
}

.submit-rating-btn {
    background: #6d1313;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.submit-rating-btn:hover {
    background: #4a0e0e;
    transform: translateY(-2px);
}

.login-prompt {
    text-align: center;
    padding: 1.5rem;
    color: #666;
}

.login-prompt a {
    color: #6d1313;
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* Reviews List */
.reviews-list {
    margin-top: 2rem;
}

.reviews-list h4 {
    margin-bottom: 1rem;
    color: #2d2d2d;
}

body.dark-mode .reviews-list h4 {
    color: #e0e0e0;
}

.review-item {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #6d1313;
}

body.dark-mode .review-item {
    background: #2d2d2d;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-stars {
    font-size: 1.1rem;
}

.review-date {
    color: #999;
    font-size: 0.85rem;
}

.review-text {
    color: #555;
    line-height: 1.6;
}

body.dark-mode .review-text {
    color: #b0b0b0;
}

/* Favorites Section */
.favorites-section {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.4);
}

body.dark-mode .favorites-section {
    background: #1a1a1a;
}

.favorites-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.8rem;
    color: #2d2d2d;
    font-weight: 700;
}

body.dark-mode .favorites-section h2 {
    color: #e0e0e0;
}

.favorites-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #6d1313;
    margin: 1rem auto 3rem;
}

.no-recipes {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.1rem;
    color: #999;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        padding: 0 20px;
    }
    
    .search-bar input,
    .search-bar select {
        width: 100%;
        min-width: 0;
    }
    
    .rating-display {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .star-rating-input label {
        font-size: 2rem;
    }
    
    .recipe-actions-bar {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .tags-list {
        padding: 0 20px;
    }
    
    .favorite-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .recipe-badges {
        font-size: 0.7rem;
    }
    
    .recipe-rating {
        font-size: 0.8rem;
    }
    
    .rating-section {
        padding: 1.5rem 1rem;
    }
    
    .rating-number {
        font-size: 2rem;
    }
}

/* Accessibility Improvements */
.recipe-card:focus-within {
    outline: 3px solid #6d1313;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #6d1313;
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button, a, input, select, textarea {
    transition: all 0.2s ease;
}



/* MOBILE OVERRIDE - Highest priority rules to hide user menu elements */
@media (max-width: 768px) {
    /* Force hide all user menu related elements on mobile with maximum specificity */
    html body .navbar #user-menu,
    html body .navbar #user-menu *,
    html body .navbar .user-name-display,
    html body .navbar #logout-btn,
    html body .navbar #user-name,
    html body .navbar .user-icon,
    html body .navbar .user-name-text,
    html body .navbar .auth-buttons #user-menu,
    html body .navbar .auth-buttons .user-name-display,
    html body .navbar .auth-buttons #logout-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        z-index: -1 !important;
    }
}