/**
 * Taste of Universe - Frontend Styles
 * BEM Methodology with tou- prefix
 *
 * @package TOU
 * @version 1.0.0
 */

/* =====================================
   Frontend Recipes Container
   ===================================== */
.tou-recipes-frontend {
    padding: 40px 20px;
}

.tou-recipes-frontend__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* =====================================
   Recipe Card
   ===================================== */
.tou-recipe-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tou-recipe-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.tou-recipe-card__image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.tou-recipe-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tou-recipe-card:hover .tou-recipe-card__image img {
    transform: scale(1.05);
}

.tou-recipe-card__content {
    padding: 20px;
}

.tou-recipe-card__title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.4;
}

.tou-recipe-card__meta {
    margin: 0;
    font-size: 14px;
    color: #50575e;
}

/* =====================================
   Recipe Popup
   ===================================== */
.tou-recipe-popup {
    max-width: 100%;
}

.tou-recipe-popup__image {
    margin-bottom: 30px;
}

.tou-recipe-popup__image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.tou-recipe-popup__content {
    padding: 0;
}

.tou-recipe-popup__title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
}

.tou-recipe-popup__meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #c3c4c7;
    font-size: 14px;
    color: #50575e;
}

.tou-recipe-popup__ingredients,
.tou-recipe-popup__instructions {
    margin-bottom: 30px;
}

.tou-recipe-popup__ingredients h3,
.tou-recipe-popup__instructions h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.tou-recipe-popup__ingredients ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tou-recipe-popup__ingredients li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #50575e;
}

.tou-recipe-popup__instructions ol {
    padding-left: 20px;
}

.tou-recipe-popup__instructions li {
    padding: 8px 0;
    font-size: 14px;
    color: #50575e;
    line-height: 1.6;
}

/* =====================================
   Modal Styles
   ===================================== */
.tou-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.tou-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.tou-modal__content {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.tou-modal__content--popup {
    max-width: 700px;
}

.tou-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
}

.tou-modal__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
}

.tou-modal__close {
    background: none;
    border: none;
    font-size: 32px;
    color: #50575e;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
}

.tou-modal__close:hover {
    color: #d63638;
}

.tou-modal__body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.tou-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    background: #f6f7f7;
    border-top: 1px solid #c3c4c7;
}

.tou-modal__button {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tou-modal__button--save {
    background: #E81E63;
    color: #fff;
}

.tou-modal__button--save:hover {
    background: #C2154D;
}

.tou-modal__button--cancel {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.tou-modal__button--cancel:hover {
    background: #e5e5e5;
}

/* =====================================
   Responsive
   ===================================== */
@media (max-width: 768px) {
    .tou-recipes-frontend__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tou-modal__content {
        margin: 10vh 5%;
        max-width: 90%;
    }

    .tou-modal__body {
        padding: 20px;
    }

    .tou-modal__footer {
        flex-direction: column;
        padding: 15px;
    }

    .tou-modal__button {
        width: 100%;
    }

    .tou-recipe-popup__title {
        font-size: 22px;
    }

    .tou-recipe-popup__meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* =====================================
   Recent Recipes Container
   ===================================== */
.tou-recent-recipes {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tou-recent-recipes__header {
    margin-bottom: 30px;
}

.tou-recent-recipes__title {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
}

.tou-recent-recipes__filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tou-recent-recipes__filter-btn {
    padding: 10px 20px;
    border: 2px solid #c3c4c7;
    border-radius: 6px;
    background: #fff;
    color: #50575e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tou-recent-recipes__filter-btn:hover {
    border-color: #E81E63;
    color: #E81E63;
}

.tou-recent-recipes__filter-btn.is-active {
    border-color: #E81E63;
    background: #E81E63;
    color: #fff;
}

.tou-recent-recipes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.tou-recent-recipes__empty {
    padding: 40px;
    text-align: center;
    color: #50575e;
    font-size: 16px;
}

.tou-recent-recipes__footer {
    text-align: center;
    padding: 20px 0;
}

.tou-recent-recipes__show-more-btn {
    padding: 12px 30px;
    border: 2px solid #E81E63;
    border-radius: 6px;
    background: #fff;
    color: #E81E63;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tou-recent-recipes__show-more-btn:hover {
    background: #E81E63;
    color: #fff;
}

.tou-recent-recipes__show-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tou-recipe-card__date {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #8c8f94;
}

/* Recent Recipes Responsive */
@media (max-width: 768px) {
    .tou-recent-recipes {
        padding: 20px 15px;
    }

    .tou-recent-recipes__title {
        font-size: 24px;
    }

    .tou-recent-recipes__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tou-recent-recipes__filters {
        flex-direction: column;
    }

    .tou-recent-recipes__filter-btn {
        width: 100%;
    }
}