/* Main CSS Styles for Food Blog - Pinch of Yum Inspired */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: #4a4a4a;
    background-color: #ffffff;
}

a {
    color: #d4756f;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #b85f5a;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    line-height: 1.3;
    color: #2c2c2c;
    margin-bottom: 20px;
}

h1 {
    font-size: 42px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 32px;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 24px;
}

p {
    margin-bottom: 20px;
}

/* Container */
.container {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Header */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 25px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 28px;
    color: #2c2c2c;
    margin: 0;
    letter-spacing: 0.5px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    color: #4a4a4a;
    font-weight: 400;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: #d4756f;
    border-bottom-color: #d4756f;
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #2c2c2c;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-link, .register-link {
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-link {
    background-color: transparent;
    border: 1px solid #d4756f;
    color: #d4756f;
}

.login-link:hover {
    background-color: #d4756f;
    color: #fff;
}

.register-link {
    background-color: #d4756f;
    color: #fff;
    border: 1px solid #d4756f;
}

.register-link:hover {
    background-color: #b85f5a;
    border-color: #b85f5a;
}

.register-link:hover {
    background-color: #c0392b;
    color: #fff;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    padding: 8px 15px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border-radius: 4px;
}

.user-dropdown-content a {
    color: #333;
    padding: 12px 16px;
    display: block;
    border-bottom: 1px solid #eee;
}

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

.user-dropdown-content a:hover {
    background-color: #f9f9f9;
}

.user-dropdown-content.show {
    display: block;
}

/* Footer */
.site-footer {
    background-color: #222;
    color: #ddd;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-about h3, .footer-links h3, .footer-social h3, .footer-newsletter h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #fff;
}

.footer-about p {
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #ddd;
}

.footer-links a:hover {
    color: #e74c3c;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-icon {
    display: inline-block;
    padding: 8px 15px;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
}

.social-icon:hover {
    background-color: #e74c3c;
    color: #fff;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: none;
    border-radius: 4px;
}

.newsletter-form button {
    padding: 10px 15px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.newsletter-form button:hover {
    background-color: #c0392b;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
}

/* Main Content Areas */
main {
    padding: 40px 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-top: 40px;
}

.content-area {
    grid-column: 1;
}

.sidebar {
    grid-column: 2;
}

/* Home Page */
.hero {
    background-color: #e74c3c;
    color: #fff;
    padding: 0;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
}

.hero-image {
    height: auto;
    overflow: hidden;
    width: 100%;
}

.hero-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.hero-content {
    padding: 60px 0;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 25px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background-color: #fff;
    color: #e74c3c;
    border-radius: 4px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #f9f9f9;
}

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 4px;
    font-weight: 600;
}

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

/* Category Header */
.category-header {
    text-align: center;
    margin: 40px 0 30px 0;
}

.category-header h1 {
    margin-bottom: 10px;
}

.category-header p {
    color: #666;
    font-size: 16px;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.category-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: #d4756f;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.category-card h3 {
    font-size: 22px;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.category-count {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* Recipe Cards */
.recipes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    margin-top: 40px;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.recipe-card {
    background-color: #fff;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    transition: none;
}

.recipe-card:hover {
    transform: none;
    box-shadow: none;
}

.recipe-card-link {
    display: block;
    color: inherit;
}

.recipe-card-link:hover {
    color: inherit;
}

.recipe-card-image {
    height: auto;
    overflow: hidden;
    margin-bottom: 25px;
    border-radius: 3px;
}

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

.recipe-card:hover .recipe-card-image img {
    transform: none;
}

.recipe-card-content {
    padding: 0;
}

.recipe-card h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 32px;
    margin-bottom: 15px;
    color: #2c2c2c;
    font-weight: 700;
    line-height: 1.2;
}

.recipe-card h3:hover {
    color: #d4756f;
}

.recipe-card-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recipe-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-card-description {
    color: #4a4a4a;
    font-size: 17px;
    line-height: 1.75;
    margin-bottom: 0;
}

.recipe-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    color: #ddd;
    position: relative;
}

.star {
    display: inline-block;
}

.star-filled {
    color: #ffb400;
}

.rating-value, .rating-count {
    font-size: 14px;
    color: #777;
}

.view-all-link {
    text-align: center;
    margin-top: 30px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-widget h3 {
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
}

.search-form {
    display: flex;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-form button {
    padding: 10px 15px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

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

.category-list li {
    margin-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 8px;
}

.category-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.category-list a {
    color: #333;
    display: flex;
    justify-content: space-between;
}

.category-list a:hover {
    color: #e74c3c;
}

.category-list .count {
    color: #999;
}

/* Recipe Single Page */
.recipe-single {
    background-color: #fff;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 780px;
    margin: 0 auto;
}

.recipe-header {
    margin-bottom: 30px;
    text-align: center;
}

.recipe-header h1 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 42px;
    margin-bottom: 15px;
    line-height: 1.2;
    color: #2c2c2c;
    font-weight: 700;
}

.recipe-header .recipe-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    font-weight: 400;
}

.recipe-header .recipe-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-header .recipe-description {
    font-size: 18px;
    line-height: 1.7;
    color: #4a4a4a;
    max-width: 680px;
    margin: 0 auto 25px;
}

.recipe-featured-image {
    margin-bottom: 40px;
    border-radius: 3px;
    overflow: hidden;
}

.recipe-featured-image img {
    width: 100%;
    height: auto;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    color: #777;
}

.recipe-author, .recipe-date {
    margin-right: 20px;
}

.recipe-categories {
    margin-right: 20px;
}

.recipe-image {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.recipe-description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.recipe-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #666;
}

.detail-value {
    font-size: 18px;
}

.recipe-ingredients, .recipe-instructions {
    margin-bottom: 40px;
}

.recipe-ingredients h2, .recipe-instructions h2, .recipe-rating-form h2, .recipe-comments h2 {
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
}

.scaling-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

.scale-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scale-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scale-button-group {
    display: flex;
    gap: 6px;
}

.scale-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.scale-btn:hover {
    border-color: #d4756f;
    background-color: #fafafa;
}

.scale-btn.active {
    border-color: #d4756f;
    background-color: #d4756f;
    color: #fff;
}

.servings-display {
    font-size: 15px;
    font-weight: 600;
    color: #2c2c2c;
    padding: 8px 12px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.measurement-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.measurement-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.measurement-button-group {
    display: flex;
    gap: 6px;
}

.measurement-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.measurement-btn:hover {
    border-color: #d4756f;
    background-color: #fafafa;
}

.measurement-btn.active {
    border-color: #d4756f;
    background-color: #d4756f;
    color: #fff;
}

/* Recipe Mode Toggle Switch */
.recipe-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #d4756f;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    /* Make all controls fit on one line on mobile */
    .scaling-controls {
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .scale-buttons {
        gap: 4px;
        flex-wrap: nowrap;
    }

    .scale-label,
    .measurement-label,
    .toggle-label {
        display: none; /* Hide labels on mobile to save space */
    }

    .scale-button-group {
        gap: 3px;
    }

    .scale-btn {
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .servings-display {
        font-size: 12px;
        padding: 6px 8px;
        white-space: nowrap;
    }

    .measurement-buttons {
        gap: 4px;
        flex-wrap: nowrap;
    }

    .measurement-button-group {
        gap: 3px;
    }

    .measurement-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .recipe-mode-toggle {
        flex-shrink: 0;
    }

    .toggle-switch {
        width: 40px;
        height: 22px;
    }

    .toggle-slider:before {
        height: 16px;
        width: 16px;
    }

    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(18px);
    }

    /* Fix ingredient image squishing on mobile */
    .ingredient-checkbox-wrapper {
        gap: 10px;
        padding: 12px 0;
    }

    .ingredient-affiliate-image {
        width: 60px;
        height: 60px;
        min-width: 60px; /* Prevent squishing */
        flex-shrink: 0;
    }

    .ingredient-text {
        font-size: 15px;
        line-height: 1.5;
        flex: 1;
        min-width: 0; /* Allow text to wrap properly */
    }

    .checkbox-custom {
        width: 20px;
        height: 20px;
        min-width: 20px; /* Prevent squishing */
        flex-shrink: 0;
    }
}

.ingredients-list {
    list-style: none;
    margin-bottom: 30px;
}

.ingredients-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.ingredient-affiliate-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #fff;
}

.ingredient-text {
    flex: 1;
    min-width: 0;
}

.recipe-content {
    line-height: 1.8;
}

.recipe-content h3 {
    font-size: 20px;
    margin: 25px 0 15px;
}

.recipe-content p {
    margin-bottom: 15px;
}

.recipe-content ul, .recipe-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.recipe-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

/* Rating Form */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    margin: 0 2px;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #f1c40f;
}

.star-rating .selected {
    color: #f1c40f;
}

/* Comments */
.comment-form {
    margin-bottom: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.comment-form h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    resize: vertical;
}

.comments-list {
    margin-top: 20px;
}

.comment {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #777;
    font-size: 14px;
}

.comment-author {
    font-weight: 600;
}

.comment-content {
    line-height: 1.6;
}

.admin-badge, .guest-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: 400;
}

.admin-badge {
    background-color: #e74c3c;
    color: #fff;
}

.guest-badge {
    background-color: #95a5a6;
    color: #fff;
}

.logged-in-notice {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group select[multiple] {
    height: auto;
    min-height: 100px;
}

.form-actions {
    margin-top: 30px;
}

.help-text {
    font-size: 14px;
    color: #777;
    margin-top: 5px;
}

/* Authentication Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
}

.auth-form-container {
    width: 100%;
    max-width: 500px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.auth-form-container h1 {
    margin-bottom: 20px;
    text-align: center;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links p {
    margin-bottom: 10px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Admin Area */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.admin-header h1 {
    font-size: 24px;
}

.admin-header nav {
    display: flex;
    gap: 15px;
}

.admin-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

.action-links {
    display: flex;
    gap: 10px;
}

.action-links a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.view-link {
    background-color: #3498db;
    color: #fff;
}

.edit-link {
    background-color: #2ecc71;
    color: #fff;
}

.delete-link {
    background-color: #e74c3c;
    color: #fff;
}

/* Admin Recipe Form */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.current-image {
    margin-bottom: 15px;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.remove-ingredient {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#add-ingredient {
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .content-area, .sidebar {
        grid-column: 1;
    }
    
    .recipe-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .ingredient-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

@media (max-width: 768px) {
    /* Tablet and mobile portrait improvements */
    .site-header {
        padding: 15px 0;
    }

    .site-header .container {
        flex-wrap: nowrap;
        position: relative;
    }

    .logo {
        flex: 1;
    }

    .logo h1 {
        font-size: 22px;
    }

    /* Show hamburger menu on mobile */
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    /* Hide main nav by default on mobile */
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #fff;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
        padding-top: 80px;
        overflow-y: auto;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 0;
        padding: 20px;
    }

    .main-nav li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
        border-bottom: none;
    }

    .user-nav {
        order: 1;
        margin-right: 15px;
        gap: 10px;
    }

    .login-link, .register-link {
        padding: 8px 15px;
        font-size: 12px;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

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

    .auth-form-container {
        padding: 15px;
    }

    /* Compact spacing */
    section {
        padding: 15px;
        margin-bottom: 25px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
        margin: 25px 0 15px 0;
    }

    h3 {
        font-size: 20px;
    }

    /* Recipe cards on tablet */
    .recipes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Compact forms */
    .form-group {
        margin-bottom: 15px;
    }

    input, textarea, select {
        padding: 10px;
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    /* Compact layout for small mobile devices */
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .category-card {
        padding: 20px;
    }

    .recipe-single {
        padding: 15px;
    }

    .recipe-header h1 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .recipe-header h2 {
        font-size: 20px;
        margin: 20px 0 12px 0;
    }

    .recipe-header h3 {
        font-size: 18px;
        margin: 15px 0 10px 0;
    }

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

    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
        padding: 12px;
        font-size: 14px;
    }

    /* Compact sections */
    section {
        margin-bottom: 20px;
        padding: 12px;
    }

    .recipe-meta {
        padding: 12px;
        font-size: 14px;
    }

    .recipe-meta-item {
        padding: 8px 12px;
    }

    /* Compact recipe cards */
    .recipe-card {
        padding: 12px;
    }

    .recipe-card-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .recipe-card-description {
        font-size: 13px;
        line-height: 1.5;
    }

    /* Nutrition label mobile */
    .nutrition-label {
        max-width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .nutrition-title {
        font-size: 18px;
    }

    /* Compact ingredient list */
    .ingredient-item {
        padding: 8px 10px;
        font-size: 14px;
    }

    /* Compact header */
    .site-header {
        padding: 12px 0;
    }

    .logo h1 {
        font-size: 22px;
    }

    /* Compact footer */
    .site-footer {
        padding: 20px 0;
        font-size: 13px;
    }

    /* Touch-friendly spacing */
    a, button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Container padding */
    .container {
        padding: 0 15px;
    }
}

/* ============================================
   Nutrition Facts Table
   ============================================ */
.recipe-nutrition {
    margin: 40px 0;
}

.recipe-nutrition h2 {
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
    padding-bottom: 12px;
}

.nutrition-label {
    max-width: 400px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    padding: 25px;
    font-family: 'Lato', Arial, sans-serif;
    border-radius: 3px;
}

.nutrition-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.nutrition-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.nutrition-row.calories {
    font-weight: 700;
    font-size: 18px;
    border-bottom: 2px solid #e0e0e0;
    padding: 12px 0;
    color: #2c2c2c;
}

.nutrition-row.indent {
    padding-left: 25px;
    font-size: 15px;
}

.nutrition-label-text {
    font-weight: 400;
    color: #4a4a4a;
}

.nutrition-value {
    font-weight: 600;
    color: #2c2c2c;
}

.nutrition-divider {
    height: 2px;
    background: #e0e0e0;
    margin: 15px 0;
}

/* ============================================
   Recipe Steps with Images
   ============================================ */
.recipe-steps {
    margin: 20px 0;
}

.recipe-step {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease;
}

.recipe-step:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.recipe-step .step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.recipe-step .step-content {
    flex: 1;
    min-width: 0;
}

.recipe-step .step-instruction {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.recipe-step .step-instruction p {
    margin: 0 0 10px 0;
}

.recipe-step .step-instruction p:last-child {
    margin-bottom: 0;
}

.recipe-step .step-instruction ul,
.recipe-step .step-instruction ol {
    margin: 10px 0;
    padding-left: 20px;
}

.recipe-step .step-instruction li {
    margin-bottom: 5px;
}

.recipe-step .step-image {
    margin-top: 12px;
}

.recipe-step .step-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ============================================
   Modern Recipe Page Components
   ============================================ */

/* Jump to Recipe & Action Buttons */
.recipe-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.btn-jump-recipe,
.btn-print-recipe {
    padding: 12px 26px;
    background-color: #d4756f;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-jump-recipe:hover,
.btn-print-recipe:hover {
    background-color: #c0645f;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-print-recipe {
    background-color: #fff;
    color: #d4756f;
    border: 2px solid #d4756f;
    box-shadow: none;
}

.btn-print-recipe:hover {
    background-color: #d4756f;
    color: #fff;
    box-shadow: 0 2px 4px rgba(212, 117, 111, 0.2);
}

/* Recipe Card Box */
.recipe-card-box {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.recipe-card-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Recipe Categories */
.recipe-categories {
    margin-bottom: 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recipe-category-link {
    color: #d4756f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.recipe-category-link:hover {
    color: #c0645f;
    text-decoration: underline;
}

.recipe-card-box h2 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 36px;
    margin-bottom: 15px;
    color: #2c2c2c;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.recipe-card-description {
    font-size: 17px;
    line-height: 1.6;
    color: #666;
    max-width: 680px;
    margin: 0 auto 25px;
}

/* Recipe Meta Bar (Times & Servings) */
.recipe-meta-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding: 25px 0;
    border-top: 2px solid #e8e8e8;
    border-bottom: 2px solid #e8e8e8;
}

.recipe-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipe-meta-icon {
    width: 24px;
    height: 24px;
    color: #d4756f;
    flex-shrink: 0;
}

.recipe-meta-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.recipe-meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    font-weight: 600;
}

.recipe-meta-value {
    font-size: 16px;
    color: #2c2c2c;
    font-weight: 600;
}

@media (max-width: 768px) {
    .recipe-meta-bar {
        gap: 20px;
    }

    .recipe-meta-item {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }
}

.recipe-card-content-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Nutrition Facts Card - Compact Design */
.nutrition-facts-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 20px;
    min-width: 200px;
    max-width: 200px;
}

.nutrition-facts-card h3 {
    font-size: 14px;
    margin: 0 0 6px 0;
    color: #2c2c2c;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nutrition-per-serving {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    text-align: left;
    margin-bottom: 15px;
}

.nutrition-calories-highlight {
    text-align: left;
    font-size: 28px;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.nutrition-calories-highlight span {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    display: block;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nutrition-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nutrition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}

.nutrition-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.nutrition-item-label {
    color: #666;
    font-weight: 400;
}

.nutrition-item-value {
    color: #2c2c2c;
    font-weight: 600;
}

/* New Nutrition Table Styling - Compact */
.nutrition-table {
    border: 2px solid #2c2c2c;
    background: #fff;
    max-width: 100%;
}

.nutrition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 6px solid #2c2c2c;
}

.nutrition-servings {
    font-size: 12px;
    font-weight: 600;
    color: #2c2c2c;
}

.nutrition-calories {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.calories-amount {
    font-size: 26px;
    font-weight: 700;
    color: #2c2c2c;
    line-height: 1;
}

.calories-label {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nutrition-details .nutrition-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.nutrition-details .nutrition-row:last-child {
    border-bottom: none;
}

.nutrition-details .nutrition-row.indent {
    padding-left: 30px;
    font-size: 13px;
}

.nutrition-name {
    font-weight: 600;
    color: #2c2c2c;
}

.nutrition-value {
    font-weight: 600;
    color: #2c2c2c;
}

/* Responsive adjustments for nutrition card */
@media (max-width: 768px) {
    .recipe-card-content-wrapper {
        grid-template-columns: 1fr;
    }

    .nutrition-facts-card {
        max-width: 100%;
        margin-top: 20px;
    }
}

/* Ingredients Section */
.recipe-ingredients {
    margin: 30px 0 0 0;
}

.recipe-ingredients h2 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c2c2c;
    font-weight: 700;
}

.recipe-ingredients ul {
    list-style: none;
    padding: 0;
    background: #fff;
    border-radius: 4px;
    padding: 20px;
}

/* Ingredient Item with Checkbox */
.ingredient-item {
    padding: 0;
    border-bottom: 1px solid #f5f5f5;
    list-style: none;
}

.ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 14px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.ingredient-checkbox-wrapper:hover {
    background-color: #fafafa;
}

/* Hide default checkbox */
.ingredient-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Custom checkbox */
.checkbox-custom {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #d4756f;
    border-radius: 3px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ingredient-checkbox:checked + .checkbox-custom {
    background-color: #d4756f;
    border-color: #d4756f;
}

.ingredient-checkbox:checked + .checkbox-custom::after {
    display: block;
}

/* Checked state styling */
.ingredient-item.checked .ingredient-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.ingredient-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    transition: opacity 0.2s, text-decoration 0.2s;
}

.ingredient-affiliate-image,
.equipment-affiliate-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #fff;
}

/* Instructions Section */
.recipe-instructions {
    margin: 50px 0;
}

.recipe-instructions h2 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 28px;
    margin-bottom: 25px;
    color: #2c2c2c;
    font-weight: 700;
}

/* Equipment Section */
.recipe-equipment {
    margin: 50px 0;
    background-color: #f8f8f8;
    padding: 35px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.recipe-equipment h2 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 24px;
    margin-bottom: 25px;
    color: #2c2c2c;
    font-weight: 700;
}

.equipment-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.equipment-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    align-items: flex-start;
}

.equipment-item-content {
    flex: 1;
}

.equipment-item-name {
    font-weight: 600;
    color: #2c2c2c;
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.equipment-item-name a {
    color: #d4756f;
}

.equipment-item-name a:hover {
    color: #b85f5a;
}

.equipment-affiliate-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #fff;
}

.equipment-item-description {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.6;
    margin: 0;
}

/* Compact mobile layout */
@media (max-width: 768px) {
    .recipe-step {
        gap: 12px;
        padding: 12px;
        margin-bottom: 15px;
    }

    .recipe-step .step-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .recipe-step .step-instruction {
        font-size: 14px;
        line-height: 1.6;
    }

    .recipe-step .step-image {
        margin-top: 10px;
    }
}

/* ============================================
   Print Styles - Recipe Card Only
   ============================================ */
@media print {
    /* Hide everything except the recipe card */
    .site-header,
    .site-footer,
    .recipe-header,
    .recipe-actions,
    .recipe-featured-image,
    .recipe-content,
    .recipe-rating-form,
    .recipe-comments,
    .no-print {
        display: none !important;
    }

    /* Show only the recipe card */
    body {
        background: white;
        margin: 0;
        padding: 0;
    }

    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .recipe-card-box {
        background: white;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 20px;
        margin: 0;
        page-break-inside: avoid;
    }

    /* Recipe card header */
    .recipe-card-header {
        border-bottom: 2px solid #333;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .recipe-card-box h2 {
        font-size: 28px;
        color: #000;
        margin-bottom: 10px;
    }

    .recipe-card-description {
        font-size: 14px;
        color: #333;
    }

    /* Recipe details grid */
    .recipe-card-content-wrapper {
        display: block;
        margin-bottom: 20px;
    }

    .recipe-details-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        margin-bottom: 20px;
        border-top: 2px solid #333;
        border-bottom: 2px solid #333;
        padding: 15px 0;
    }

    .recipe-detail-label {
        font-size: 10px;
        color: #666;
    }

    .recipe-detail-value {
        font-size: 14px;
        color: #000;
    }

    /* Nutrition card */
    .nutrition-facts-card {
        background: white;
        border: 2px solid #333;
        box-shadow: none;
        padding: 15px;
        margin-top: 20px;
        page-break-inside: avoid;
    }

    .nutrition-facts-card h3 {
        font-size: 16px;
        color: #000;
        border-bottom-color: #333;
    }

    .nutrition-calories-highlight {
        color: #000;
        border-bottom-color: #333;
    }

    /* Ingredients section */
    .recipe-ingredients {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .recipe-ingredients h2 {
        font-size: 20px;
        color: #000;
        margin-bottom: 10px;
    }

    .scaling-controls {
        display: none; /* Hide scaling controls in print */
    }

    .recipe-ingredients ul {
        background: white;
        padding: 10px 0;
    }

    .recipe-ingredients li {
        padding: 8px 0;
        font-size: 13px;
        color: #000;
        border-bottom-color: #ddd;
    }

    .recipe-ingredients li:before {
        color: #000;
    }

    /* Hide affiliate images in print to save ink */
    .ingredient-affiliate-image,
    .equipment-affiliate-image {
        display: none;
    }

    /* Instructions section */
    .recipe-instructions {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .recipe-instructions h2 {
        font-size: 20px;
        color: #000;
        margin-bottom: 10px;
    }

    .recipe-step {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
        padding: 10px;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }

    .recipe-step .step-number {
        background: #333;
        color: white;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .recipe-step .step-instruction {
        font-size: 12px;
        color: #000;
    }

    /* Hide step images to save space/ink */
    .recipe-step .step-image {
        display: none;
    }

    /* Equipment section */
    .recipe-equipment {
        background: white;
        border: 1px solid #ddd;
        padding: 15px;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .recipe-equipment h2 {
        font-size: 18px;
        color: #000;
        margin-bottom: 10px;
    }

    .equipment-list {
        gap: 10px;
    }

    .equipment-item {
        background: white;
        border: 1px solid #ddd;
        padding: 8px;
    }

    .equipment-item-name {
        font-size: 13px;
        color: #000;
    }

    .equipment-item-description {
        font-size: 11px;
        color: #333;
    }

    /* Hide affiliate links in print - just show text */
    .equipment-item-name a,
    .ingredient-text a {
        color: #000;
        text-decoration: none;
    }

    /* Ensure good page breaks */
    h2, h3 {
        page-break-after: avoid;
    }

    ul, ol {
        page-break-before: avoid;
    }
}
