/* Main Recipe Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #43984e 0%, #186010 100%);
    min-height: 100vh;
    color: #333;
}

/* ==================== */
/* SITE HEADER STYLES   */
/* ==================== */
.site-header {
    background: linear-gradient(135deg, #1a4d1e 0%, #0d2f0f 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::before {
    transform: scale(1);
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.header-tags {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.header-tags::-webkit-scrollbar {
    display: none;
}

.tags-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.header-tags-list {
    display: flex;
    gap: 10px;
}

.header-tag {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-tag:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ==================== */
/* SITE FOOTER STYLES   */
/* ==================== */
.site-footer {
    background: linear-gradient(135deg, #0d2f0f 0%, #071a08 100%);
    margin-top: 60px;
    border-top: 3px solid #43984e;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 2fr;
    gap: 50px;
    padding: 50px 0;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    width: fit-content;
}

.footer-logo .logo-icon {
    font-size: 2rem;
}

.footer-logo .logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 280px;
}

.footer-nav h4,
.footer-categories h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 10px;
}

.footer-nav h4::after,
.footer-categories h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #43984e;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: fit-content;
}

.footer-nav a:hover {
    color: #5fbe6a;
    transform: translateX(5px);
}

.footer-tags-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.footer-tag {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: block;
}

.footer-tag:hover {
    background: rgba(67, 152, 78, 0.3);
    color: white;
    border-color: rgba(67, 152, 78, 0.5);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 0;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ==================== */
/* RESPONSIVE DESIGN    */
/* ==================== */
@media (max-width: 991px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-categories {
        grid-column: span 2;
    }

    .footer-tags-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .header-top {
        flex-wrap: wrap;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 15px 0;
        gap: 5px;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .header-tags {
        padding: 10px 0;
    }

    .tags-label {
        display: none;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 35px;
        padding: 40px 0;
    }

    .footer-categories {
        grid-column: span 1;
    }

    .footer-tags-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        align-items: center;
        text-align: center;
    }

    .footer-nav h4::after,
    .footer-categories h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-nav {
        align-items: center;
    }

    .footer-nav a:hover {
        transform: none;
    }
}

/* ==================== */
/* EXISTING STYLES      */
/* ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.recipes-grid>a,
.recipes-grid>.recipe-card {
    max-width: 100%;
}

.recipe-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.recipe-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.recipe-card:hover .recipe-image {
    transform: scale(1.05);
}

.recipe-image {
    transition: transform 0.3s ease;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.recipe-image.no-image {
    background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

.recipe-image.has-image {
    background: none;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recipe-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.recipe-description {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.6;
    flex: 1;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.recipe-category {
    background: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.recipe-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e74c3c;
}

.stat-label {
    font-size: 0.8rem;
    color: #95a5a6;
    text-transform: uppercase;
}

.recipe-ingredients {
    margin-bottom: 15px;
}

.ingredients-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.ingredients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ingredient-tag {
    background: #ecf0f1;
    color: #34495e;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: help;
    transition: background-color 0.2s ease;
}

.ingredient-tag:hover {
    background: #d5dbdb;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.tag {
    background: #9b59b6;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background: #8e44ad;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

.api-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
}

.api-info h3 {
    margin-bottom: 15px;
    color: white;
}

.api-endpoints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.endpoint {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Error Page Styles */
.error-page body {
    font-family: Arial, sans-serif;
    text-align: center;
    padding: 50px;
    background: #f5f5f5;
}

.error-page .error {
    color: #d32f2f;
}

.error-page .container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 767px) {
    .header h1 {
        font-size: 2rem;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 15px;
    }
}

/* Recipe Detail Page Styles */
.recipe-detail {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.detail-header {
    text-align: center;
    margin-bottom: 30px;
}

.detail-image-container {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    font-size: 5rem;
}

.detail-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    flex-wrap: wrap;
}

.instruction-step {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.step-number {
    background: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    font-weight: bold;
}

.step-text {
    line-height: 1.6;
    margin-top: 2px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.detail-ingredient-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.detail-ingredient-item:last-child {
    border-bottom: none;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nutrition-item {
    text-align: center;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
}

.nutrition-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.nutrition-value {
    font-weight: 600;
    color: #2c3e50;
}

@media (max-width: 768px) {
    .detail-columns {
        flex-direction: column;
    }

    .detail-image-container {
        height: 250px;
    }
}

/* Search Box Styles */
.search-container {
    margin: 0 20px;
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    outline: none;
    background: white;
    color: #333;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-input:focus::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transition: color 0.3s;
}

.search-input:focus+.search-icon {
    color: #666;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-results.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    overflow: hidden;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2c3e50;
}

.search-result-meta {
    font-size: 0.75rem;
    color: #7f8c8d;
    display: flex;
    gap: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .search-container {
        order: 3;
        margin: 10px 0 0 0;
        max-width: 100%;
        width: 100%;
    }
}

.faq-container {
    max-width: 800px;
    margin: 2rem auto;
}

.faq-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: #f8f9fa;
    font-weight: 500;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

details[open] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e0e0e0;
}


/* Clickable Image Styles */
.clickable-image {
    cursor: zoom-in !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex !important;
}

.image-modal-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
    object-fit: contain;
    cursor: zoom-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 100000;
    line-height: 1;
    background: rgba(0, 0, 0, 0.6);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    cursor: pointer;
}

/* Click hint overlay */
.image-with-hint {
    position: relative;
    display: inline-block;
}

.image-with-hint::after {
    content: "🔍 Click to enlarge";
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.image-with-hint:hover::after {
    opacity: 1;
}