/* for navbar */
.recipe-navbar {
    background-color:#6C739C;
}

/* Nunito font for all */
body {
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

h1,
h2,
h3 {
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 600;
}

/* Login */
.form-signin {
    max-width: 330px;
    padding: 1rem;
}

.form-signin .form-floating:focus-within {
    z-index: 2;
}

.form-signin input[name="username"] {
    margin-bottom: -1px;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

.form-signin input[name="password"] {
    margin-bottom: 10px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.theme-icon,
.theme-icon-active {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

[data-bs-theme-value].active .theme-icon:last-child {
    display: block !important;
}


/* inherit Nunito font in recipe detail sections too */
.recipe-detail-section pre {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.parsed-ingredient,
.parsed-ingredient-section {
    line-height: 1.5;
}

.parsed-ingredient-section {
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

#parsed-ingredients .parsed-ingredient-section:first-child {
    margin-top: 0;
}

.recipe-scale-input {
    width: 6rem;
}


/* for carousel */
.carousel-image {
    height: 600px;
    object-fit: cover;
}

.carousel-caption-panel {
    background-color: rgba(0, 0, 0, 0.68);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.carousel-caption-panel p {
    margin-bottom: 0;
}

/* for Gallery */
.gallery-card-img {
    height: 260px;
    object-fit: cover;
    width: 100%;
}

/* for name in recipe list */
.recipe-list-name {
    text-decoration: none;
    color: inherit;
}


/* for recipe list search and sort styling*/
.recipe-controls {
    top: 56px;
    z-index: 100;
}

.recipe-controls .form-control,
.recipe-controls .form-select {
    border-color: var(--bs-border-color);
}

.recipe-controls .form-control:focus,
.recipe-controls .form-select:focus {
    border-color: #8E9A98;
    box-shadow: 0 0 0 0.2rem rgba(142, 154, 152, 0.35);
}



/* recipe detail table */
.recipe-detail-table {
    table-layout: fixed;
    width: 100%;
}

.recipe-detail-table th:first-child,
.recipe-detail-table td:first-child {
    width: 7rem;
}

.recipe-detail-table td,
.recipe-detail-table a {
    overflow-wrap: anywhere;
}



/* Recipe Detail Photos */
.recipe-photo-gallery {
    --primary-photo-size: 250px;
    --photo-gap: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: var(--photo-gap);
}

.recipe-primary-photo {
    width: var(--primary-photo-size);
    height: var(--primary-photo-size);
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: zoom-in;
}

.recipe-photo-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--photo-gap);
    width: var(--primary-photo-size);
}

.recipe-photo-thumbs-mobile {
    display: none;
}

.recipe-photo-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.25rem;
    background-color: #fff;
    cursor: zoom-in;
}

.recipe-photo-more {
    aspect-ratio: 1 / 1;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #f8f9fa;
    font-weight: 700;
    color: #495057;
}

.photo-modal-image {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.hidden-photo-modal-thumb {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

@media (max-width: 575.98px) {
    .recipe-photo-gallery {
        --primary-photo-size: min(68vw, 320px);
    }

    .recipe-photo-thumbs-desktop {
        display: none;
    }

    .recipe-photo-thumbs-mobile {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--photo-gap);
        width: calc(var(--primary-photo-size) / 3);
    }
}



/* for recipe chat*/
#recipeChatPanel .offcanvas-body {
    min-height: 0;
    box-sizing: border-box;
}

.chat-status {
    flex: 0 0 auto;
    padding: 0 0 0.75rem 0;
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.25rem;
}

.chat-composer {
    flex: 0 0 auto;
    display: grid;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

#chat-message-input {
    min-height: 80px;
    resize: vertical;
}

.chat-message-user {
    background: #f6f8d9;
    color: #5a5f1a;
    margin-left: 2rem;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.chat-message-assistant {
    background: #eaf2ff;
    color: #17406b;
    margin-right: 2rem;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}



@media (min-width: 992px) {
    .recipe-chat {
        position: sticky;
        top: calc(56px + 3rem);
        height: calc(100dvh - 56px - 3rem);
        border-left: 1px solid var(--bs-border-color);
        padding-left: 1.5rem;
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
    }

    #recipeChatPanel {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    #recipeChatPanel .offcanvas-body {
        flex: 1 1 auto;
        min-height: 0;
    }

    .chat-composer {
        grid-template-columns: 1fr auto;
        align-items: end;
    }
}



/* for Buttons */
/* for gallery - can be reused to remove */
.favorite-remove-btn {
    --bs-btn-close-opacity: 0.7;
    --bs-btn-close-hover-opacity: 1;
    background-color: white;
    border-radius: 999px;
    padding: 0.5rem;
}

/* BUTTONS */
/* favorite button in recipe list */
.favorite-button .favorite-heart {
    fill: none;
    stroke: #E5AEA9;
    stroke-width: 1.5;
    transition: fill 0.2s ease, stroke 0.2s ease, transform 0.2s ease;
}

.favorite-button.is-favorited .favorite-heart {
    fill: #E5AEA9;
    stroke: #E5AEA9;
}

.favorite-button:hover .favorite-heart {
    transform: scale(1.08);
}


/* pinning in recipe list */
.pin-button {
    color: #A6A9D0;
}

.pin-button:hover,
.pin-button:focus,
.pin-button:active {
    color: #A6A9D0;
}

.pin-button .pin-filled {
    display: none;
}

.pin-button.is-pinned .pin-outline {
    display: none;
}

.pin-button.is-pinned .pin-filled {
    display: inline-block;
}

.pin-button svg {
    transition: transform 0.2s ease;
}

.pin-button:hover svg {
    transform: scale(1.08);
}


/* More button */
.more-button {
    border-color: #35627A;
    color: #35627A;
}

.more-button:hover,
.more-button:focus,
.more-button:active {
    color: #35627A;
}


/* Update Button */
.update-button {
    border-color: #A1C3E7;
    color: white;
    background-color: #A1C3E7;
}

.update-button:hover,
.update-button:focus,
.update-button:active {
    border-color: #A1C3E7;
    color: white;
    background-color: #A1C3E7;
    transform: scale(1.08);
    transition: transform 0.2s ease;
}
