/* 스타일 초기화 및 기본 설정 */

/* 커스텀 폰트 설정 */
@font-face {
    font-family: '성실체';
    src: url('폰트/나눔손글씨\ 성실체.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 모든 요소에 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 전체 문서의 기본 폰트 */
body {
    font-family: '성실체', sans-serif;
}

/* 네비게이션 바 스타일 */
nav {
    background-color: #fff;
    padding: 15px 30px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

/* 로고 스타일 */
nav div {
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

nav img{
    height: 40px; 
    width: auto; 
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ff8c1a;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

/* 네비게이션 링크 스타일 */
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links li {
    display: inline;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 130%;
    cursor: pointer; 
}

.nav-links a:hover {
    color: #ff8c1a;
}

/* 헤더 스타일 */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #ddd;
    background-image: url('기타_이미지/header8.png');
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    height: 350px; 
}

header h1 {
    font-size: 36px;
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 300%;
    text-shadow: 
        -1px -1px 0 black, 
        1px -1px 0 black,  
        -1px 1px 0 black,  
        1px 1px 0 black;  
}

/* 검색창 스타일 */
.search-bar {
    position: relative; 
    width: 100%;
    max-width: 500px; 
    margin: 20px auto 0 auto; 
}

#food-search {
    width: 100%; 
    padding: 10px 40px 10px 15px; 
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 30px; 
    box-sizing: border-box; 
    outline: none;
    background-color: #ffffff;
}

#search-btn {
    position: absolute; 
    top: 50%; 
    right: 10px; 
    transform: translateY(-50%); 
    padding: 5px 15px; 
    font-size: 14px;
    background-color: #ff8c1a; 
    color: #fff;
    border: none;
    border-radius: 20px; 
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-btn:hover {
    background-color: #ff751a;
}

/* 재료 목록 스타일 */
#ingredients-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 30px;
    padding: 10px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

/* 재료 버튼 스타일 */
.ingredient-btn {
    border: 1px solid #ccc;
    background-color: #ffffff;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    border-radius: 30px;
    margin: 5px;
    width: 110px;
    height: 50px;
    box-sizing: border-box;
    position: relative;
}

/* 재료 이미지 스타일 */
.ingredient-btn img {
    width: 30px;
    object-fit: contain;
}

.ingredient-btn:hover {
    transform: scale(1.1);
    background-color: #ffebcc;
}

/* 툴팁 스타일 */
.ingredient-btn:hover::after {
    content: attr(data-title); 
    position: absolute;
    top: -20px; 
    left: 50%;
    transform: translateX(-50%);
    color: black; 
    font-weight: bold;
    font-size: 12px; 
    padding: 5px 10px;
    border-radius: 10px;
    white-space: nowrap; 
    z-index: 10;
    pointer-events: none; 
    opacity: 0; 
    transition: opacity 0.3s ease; 
    background-color: #ffffff;
    border: 1px solid #ccc;
    font-family: '성실체', sans-serif;
    font-size: 120%;
}

.ingredient-btn:hover::after {
    opacity: 1;
}

.ingredient-btn.selected {
    background-color: #ff751a;
    color: white;
}

/* 메뉴 목록 */
#foods-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(auto, 275px));
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.food-card {
    height: 165px;
    width: 275px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.food-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.food-card img {
    width: 100%;
    height: 165px;
    object-fit: cover;
    border-radius: 10px;
}

.black-box-overlay {
    position: absolute;
    background-color: black;
    height: 100%;
    width: 100%;
    top: 0%;
    left: 0%;
    opacity: 30%;
    transition: opacity 0.5s ease;
}

.food-card:hover .black-box-overlay {
    opacity: 0;
}

.food-name-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    font-size: 180%;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
    width: 300px;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: white;
    font-size: 14px;
}

/* 상세 페이지 레이아웃 */
.food-detail-layout {
    display: grid;
    grid-template-areas:
        "image name name"
        "image ingredients ingredients"
        "instructions instructions video";
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    max-width: 75%;
    margin: 0 auto;
    padding: 20px;
    margin-top: 40px;
    grid-auto-rows: auto;
}

/* 음식 영역 */
.food-image {
    grid-area: image;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    height: auto;
}

/* 음식 사진 */
.food-image img {
    width: 100%;
    height: 320px;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
}

/* 음식 이름 */
.food-name {
    grid-area: name;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 10px;
    height: 45px;
    width: 100%;
}

/* 음식 재료 */
.food-ingredients {
    grid-area: ingredients;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 10px;
    height: 250px;
    width: 100%;
    font-size: 130%;
}

.food-ingredients ul {
    overflow-y: auto;
    width: 100%;
}

/* 요리 방법 */
.food-instructions {
    grid-area: instructions;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 10px;
    height: 250px;
    width: 100%;
    font-size: 130%;
}

.food-instructions p {
    overflow-y: auto;
    width: 100%;
}

/* 요리 영상 */
.food-video {
    grid-area: video;
    position: relative;
    padding-bottom: auto;
    height: auto;
    max-height: 250px;
    overflow: hidden;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.food-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* 팝업 스타일 */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1000; 
}

/* 닫기 버튼 */
#close-popup {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background-color: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
}

.popup-content {
    position: relative;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    text-align: center;
}

#recommended-foods {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    gap: 20px;
}

/* 폼 스타일 */
#food-form {
    display: flex;
    flex-direction: column;
    gap: 10px; 
    width: 100%;
    max-width: 500px; 
    margin: 0 auto; 
}

/* 레이블 및 인풋 스타일 */
#food-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

#food-form input,
#food-form textarea,
#food-form fieldset {
    width: 100%; 
    box-sizing: border-box; 
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
}

fieldset label {
    display: flex;
    align-items: center; 
    gap: 5px; 
    margin: 5px 0; 
    padding: 2px 5px; 
    border-radius: 4px; /
}

fieldset label:hover {
    background-color: #f9f9f9; 
}

/* 제출 버튼 스타일 */
#food-form button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#food-form button:hover {
    background-color: #0056b3;
}

/* 팝업 닫기 버튼 스타일 */
#add-close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    font-weight: bold;
}

/* 팝업 콘텐츠 스타일 */
.popup-content {
    position: relative;
    width: 80%;
    max-width: 600px;
    max-height: 80vh; 
    overflow-y: auto; 
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 스크롤바 스타일 (선택 사항) */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background-color: #888;
}

/* 스크롤을 멈추는 스타일 */
.no-scroll {
    overflow: hidden; /* 스크롤 비활성화 */
}