* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: #fff;
    color: #2d2d2d;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid #f0f0f0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e74c3c;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    color: #2d2d2d;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu a:hover {
    color: #e74c3c;
}

.auth-buttons {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.auth-btn {
    background: #e74c3c;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

#logout-btn {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

#logout-btn:hover {
    background: #e74c3c;
    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: 70px;
}

.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: #e74c3c;
    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(231, 76, 60, 0.4);
}

.cta-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.5);
}

/* Recipes Section */
.recipes-section {
    padding: 60px 0 80px;
    background: #fff;
}

.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: #e74c3c;
    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: #e74c3c;
}

.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: white;
    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;
}

.recipe-card-header {
    padding: 1.5rem 1.5rem 0.5rem;
    background: white;
}

.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: #e74c3c;
    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;
}

/* Add Recipe Section */
.add-recipe-section {
    padding: 80px 0;
    background: #fafafa;
}

.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: #e74c3c;
    margin: 1rem auto 3rem;
}

.recipe-form {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    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: #e74c3c;
}

.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: #e74c3c;
    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: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 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: white;
    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: #e74c3c;
}

.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 #e74c3c;
    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: #e74c3c;
    font-weight: bold;
}

.recipe-detail .instructions ol {
    margin-left: 0;
    padding-left: 1.5rem;
    counter-reset: item;
    list-style: none;
}

.recipe-detail .instructions li {
    padding: 1rem 0;
    padding-left: 3rem;
    position: relative;
    line-height: 1.7;
    counter-increment: item;
}

.recipe-detail .instructions li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 1rem;
    background: #e74c3c;
    color: white;
    width: 28px;
    height: 28px;
    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: #2d2d2d;
    color: #ccc;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 4px solid #e74c3c;
}

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: #e74c3c;
    padding: 1.2rem 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    text-align: center;
    border-left: 4px solid #e74c3c;
    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: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        height: auto;
        min-height: 70px;
        padding: 1rem 20px;
        flex-wrap: wrap;
    }
    
    .nav-logo {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
        font-size: 0.85rem;
    }
    
    .auth-buttons {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .hero {
        padding: 120px 20px 60px;
        margin-top: 70px;
    }
    
    .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-menu {
        gap: 1rem;
        font-size: 0.75rem;
    }
    
    .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: #f8f9fa;
}

.user-management {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-top: 2rem;
}

.create-user-form h3,
.users-list h3 {
    color: #2d2d2d;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.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: #e74c3c;
    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: 15px;
    margin: 1.5rem 0;
    justify-content: center;
    padding: 1.5rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.edit-btn, .delete-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn::before {
    content: '✎';
    font-size: 1.2rem;
    font-weight: normal;
}

.edit-btn:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn::before {
    content: '✕';
    font-size: 1.3rem;
    font-weight: bold;
}

.delete-btn:hover {
    background: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}


/* Hide manage users section */
#manage-users-nav,
#manage-users {
    display: none !important;
}


/* Section headings in ingredients and instructions */
.ingredient-section,
.instruction-section {
    color: #e74c3c;
    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: #e74c3c;
    border: 2px solid #e74c3c;
}

.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;
}
