* {
    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: 155px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    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: 1px solid rgba(175, 106, 64, 0.1);
    backdrop-filter: blur(10px);
}

.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: 135px;
}

.nav-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #AF6A40;
    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(175, 106, 64, 0.2));
}

.logo-icon-img {
    height: 117px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(175, 106, 64, 0.2));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    order: 2;
    margin-top: 0;
}

.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: 5px;
    white-space: nowrap;
}

.nav-icon {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.nav-menu a:hover {
    color: #AF6A40;
    background: rgba(175, 106, 64, 0.08);
}

.nav-menu a:hover .nav-icon {
    transform: scale(1.15);
}

.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    order: 3;
}

#login-btn {
    order: 1;
}

#signup-btn {
    order: 2;
}

#dark-mode-toggle {
    order: 4;
}

#user-menu {
    order: 3;
}

.auth-btn {
    background: #AF6A40;
    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(175, 106, 64, 0.2);
}

.btn-icon {
    font-size: 1rem;
    opacity: 0.9;
}

.auth-btn:hover {
    background: #8B5230;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 106, 64, 0.35);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn-secondary {
    background: transparent;
    color: #AF6A40;
    border: 2px solid #AF6A40;
    box-shadow: none;
}

.auth-btn-secondary:hover {
    background: #AF6A40;
    color: white;
    box-shadow: 0 4px 12px rgba(175, 106, 64, 0.25);
}

.auth-btn-logout {
    background: transparent;
    color: #AF6A40;
    border: 2px solid #AF6A40;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-left: 18px;
    padding-right: 20px;
}

.auth-btn-logout:hover {
    background: #AF6A40;
    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: #AF6A40;
    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: #AF6A40;
    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: #AF6A40;
    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(175, 106, 64, 0.4);
}

.cta-button:hover {
    background: #8B5230;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(175, 106, 64, 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: #AF6A40;
    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: #AF6A40;
}

.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: #AF6A40;
    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: #AF6A40;
    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: #AF6A40;
}

.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: #AF6A40;
    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: #8B5230;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(175, 106, 64, 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: #AF6A40;
}

.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 #AF6A40;
    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: #AF6A40;
    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: #AF6A40;
    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: #2d2d2d;
    color: #ccc;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 4px solid #AF6A40;
}

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: #AF6A40;
    padding: 1.2rem 1.5rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    text-align: center;
    border-left: 4px solid #AF6A40;
    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: #AF6A40;
    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) {
    .nav-container {
        min-height: auto;
        padding: 12px 16px;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }
    
    .nav-logo {
        font-size: 1.5rem;
        justify-content: flex-start;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .logo-icon {
        font-size: 1.75rem;
    }
    
    .logo-icon-img {
        height: 100px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-menu li:first-child,
    .nav-menu li:nth-child(2) {
        display: none !important;
    }
    
    .nav-menu a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .nav-icon {
        font-size: 1rem;
    }
    
    .auth-buttons {
        justify-content: space-between;
        margin-top: 0;
        gap: 6px;
        flex-direction: row;
        align-items: center;
        display: flex;
        flex: 1;
    }
    
    #login-btn {
        margin-left: auto;
    }
    
    #signup-btn {
        margin-right: auto;
    }
    
    .auth-buttons .icon-btn {
        flex-shrink: 0;
    }
    
    #user-menu {
        display: flex;
        gap: 6px;
        flex-direction: row;
        align-items: center;
    }
    
    .auth-btn {
        padding: 0 14px;
        font-size: 0.75rem;
        height: 36px;
        min-width: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .icon-btn {
        height: 36px;
        width: 36px;
        min-width: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dark-mode-icon {
        font-size: 1rem;
    }
    
    .user-name-display {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    #user-menu {
        flex-direction: row;
        gap: 6px;
        align-items: center;
    }
    
    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: #f8f9fa;
}

.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 #AF6A40;
}

.info-card h4 {
    color: #AF6A40;
    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: #AF6A40;
    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: #AF6A40;
    color: #AF6A40;
}

.delete-btn::before {
    content: '🗑';
    font-size: 0.95rem;
}

.delete-btn:hover {
    background: #AF6A40;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(175, 106, 64, 0.25);
}


/* Hide manage users section */
#manage-users-nav,
#manage-users {
    display: none !important;
}


/* Section headings in ingredients and instructions */
.ingredient-section,
.instruction-section {
    color: #AF6A40;
    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: #AF6A40;
    border: 2px solid #AF6A40;
}

.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: #AF6A40;
}

.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;
}

body.dark-mode .navbar {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-bottom-color: rgba(175, 106, 64, 0.3);
}

body.dark-mode .nav-menu a {
    color: #b0b0b0;
}

body.dark-mode .nav-menu a:hover {
    color: #AF6A40;
    background: rgba(175, 106, 64, 0.15);
}

body.dark-mode .recipe-card {
    background: #2d2d2d;
    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: #2d2d2d;
}

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: #2d2d2d;
    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 .recipe-info {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

body.dark-mode footer {
    background: #0d0d0d;
    color: #888;
}

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: #1a1a1a;
}

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;
}

/* Dark Mode Toggle Button */
.icon-btn {
    background: transparent;
    border: 2px solid #AF6A40;
    color: #AF6A40;
    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;
    min-width: 42px;
}

.icon-btn:hover {
    background: #AF6A40;
    color: white;
}

.dark-mode-icon {
    font-size: 1.1rem;
}

/* 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: #AF6A40;
    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: #AF6A40;
    color: white;
    border-color: #AF6A40;
}

body.dark-mode .tag-btn {
    background: #3a3a3a;
    color: #b0b0b0;
}

body.dark-mode .tag-btn:hover {
    background: #4a4a4a;
}

body.dark-mode .tag-btn.active {
    background: #AF6A40;
    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: 6px;
}

.favorite-btn-large {
    border-color: #AF6A40;
    color: #AF6A40;
}

.favorite-btn-large:hover {
    background: #AF6A40;
    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: #AF6A40;
    border-color: #AF6A40;
    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: #AF6A40;
    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;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
    margin: 1rem 0;
}

.star-rating-input input[type="radio"] {
    display: none;
}

.star-rating-input label {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input[type="radio"]:checked ~ label {
    color: #ffd700;
    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: #AF6A40;
    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: #8B5230;
    transform: translateY(-2px);
}

.login-prompt {
    text-align: center;
    padding: 1.5rem;
    color: #666;
}

.login-prompt a {
    color: #AF6A40;
    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 #AF6A40;
}

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: #fff;
}

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: #AF6A40;
    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 #AF6A40;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #AF6A40;
    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;
}



