/* 기본 폰트 및 여백 설정 (아이폰용 예쁜 폰트 Apple SD Gothic Neo 추가) */
* { box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", 'Malgun Gothic', sans-serif; 
    margin: 0; 
    padding: 0; 
    padding-top: calc(90px + env(safe-area-inset-top)); 
    background-color: #f2f2f2; 
    color: #333;
}

/* --- 대문(홈 화면) 디자인 --- */
#home {
    padding: 3rem 1rem 5rem;
    text-align: center;
    background-color: transparent; 
    color: #333;
}

.home-hero {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.home-logo-img {
    width: 220px; 
    height: auto;
    margin-bottom: 1.5rem; 
    transition: transform 0.3s ease;
}

.home-logo-img:hover {
    transform: scale(1.05);
}

.home-subtitle {
    color: #d3a052;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 1.1rem;
    margin-bottom: -15px;
}

.home-slogan {
    font-size: 2.2rem;
    color: #111;
    margin: 0.5rem 0 0.8rem 0; 
    letter-spacing: 1px;
    word-break: keep-all; 
}

.home-desc {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
    word-break: keep-all;
}

.home-highlights {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
}

.home-highlights span {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #444;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.home-gallery {
    display: flex;
    justify-content: center;
    gap: 1.5rem; 
    width: 100%;
    max-width: 800px;
    margin: 1rem auto;
}

.gallery-img-wrapper {
    flex: 1; 
    position: relative; 
    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;
}

.gallery-img-wrapper:hover {
    transform: translateY(-8px);
}

.home-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4; 
    object-fit: cover; 
    display: block;
}

.room-badge {
    position: absolute;
    top: 15px;  
    right: 15px;
    background: rgba(211, 160, 82, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- 상단 네비게이션 바 --- */
.navbar {
    position: fixed; 
    top: 0; left: 0; width: 100%;
    padding: calc(20px + env(safe-area-inset-top)) 0 20px 0; 
    background-color: #ffffff;
    border-bottom: 1px solid #eeeeee;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center; 
    align-items: center; 
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 3rem; 
    margin: 0; padding: 0;
}

.nav-links a {
    color: #333333;
    text-decoration: none;
    font-size: 1.05rem; 
    font-weight: bold;
}
.nav-links a:hover { color: #d3a052; }

/* --- 섹션 공통 및 메뉴 카드 --- */
section { 
    padding: 5rem 2rem; 
    max-width: 950px; 
    margin: auto; 
    text-align: center;
}

section h2 { 
    font-size: 2rem; 
    color: #111; 
    margin-bottom: 3rem; 
    border-bottom: 3px solid #d3a052;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.menu-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    padding: 0;
    flex-wrap: wrap; 
}

.menu-item {
    background: #ffffff; 
    border-radius: 12px;
    border: 1px solid #e0e0e0; 
    box-shadow: 0 6px 20px rgba(0,0,0,0.08); 
    width: 300px;
    overflow: hidden;
    transition: 0.3s; 
}

.menu-img { width: 100%; height: 200px; object-fit: cover; }
.menu-text { padding: 1.5rem; text-align: left; }
.menu-item h3 { margin-top: 0; font-size: 1.4rem; color: #111; margin-bottom: 10px; }
.menu-item p { color: #666; line-height: 1.6; font-size: 0.95rem; margin: 0; }

.menu-tabs { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 3rem; flex-wrap: wrap; }
.notice-btn, .tab-btn {
    border: none; background: #e0e0e0; color: #666; padding: 10px 22px;
    font-size: 0.95rem; font-weight: bold; border-radius: 25px; cursor: pointer;
}
.notice-btn.active, .tab-btn.active { background: #d3a052; color: white; }

.menu-category, .event-category { display: none; }
.menu-category.active, .event-category.active { display: block; }

.event-list { list-style: none; padding: 0; text-align: left; max-width: 600px; margin: 0 auto; }
.event-item { display: flex; align-items: center; padding: 1.5rem 0; border-bottom: 1px solid #ddd; cursor: pointer; }
.event-info { flex: 1; }
.event-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-bottom: 5px; }
.badge-notice { background-color: #fff3e0; color: #ef6c00; }
.badge-ongoing { background-color: #e3f2fd; color: #1976d2; }
.badge-closed { background-color: #f5f5f5; color: #9e9e9e; }
.event-title { font-size: 1.1rem; font-weight: bold; color: #333; margin: 0 0 5px 0; }
.event-desc { font-size: 0.9rem; color: #666; margin: 0; line-height: 1.4; }

/* --- ★ 이벤트 팝업(모달) 레이아웃 - 수익률 대회 예외 처리 ★ --- */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 15px;
    max-width: 450px;
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 80vh; 
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    z-index: 10;
}

.modal-img { order: 1; width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; margin-bottom: 1.5rem; display: none; cursor: pointer; }
#modal-title { order: 2; font-size: 1.4rem; color: #111; margin: 0 0 1rem 0; word-break: keep-all; }
#modal-desc { order: 3; font-size: 1rem; color: #555; line-height: 1.6; margin: 0; word-break: keep-all; text-align: left; }

.modal-content.text-first #modal-title { order: 1; margin-top: 1rem; }
.modal-content.text-first #modal-desc { order: 2; margin-bottom: 1.5rem; }
.modal-content.text-first .modal-img { order: 3; margin-bottom: 0; }

/* 이미지 원본 확대 모달 (이중 팝업) */
.zoom-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 4000; justify-content: center; align-items: center; overflow: auto; 
    touch-action: pan-x pan-y pinch-zoom;
}
.zoom-close { position: absolute; top: 20px; right: 25px; font-size: 3.5rem; color: #fff; cursor: pointer; z-index: 4010; line-height: 1; }
#zoom-img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* --- ★ AI 홈페이지 팝업 스타일 --- */
.popup-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 3000; justify-content: center; align-items: center; padding: 1rem;
}
.popup-content {
    background: #ffffff; padding: 2rem; border-radius: 15px; max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3); animation: popupSlideUp 0.4s ease-out; max-height: 80vh; overflow-y: auto;
}
@keyframes popupSlideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.popup-title { color: #e74c3c; font-size: 1.5rem; margin-top: 0; margin-bottom: 1.5rem; }
.popup-message { font-size: 1.05rem; color: #444; line-height: 1.7; margin-bottom: 2rem; word-break: keep-all; }
.popup-message strong { color: #d3a052; font-size: 1.1rem; }
.popup-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; padding-top: 1rem; }
.popup-close-btn { background: #333; color: white; border: none; padding: 8px 20px; border-radius: 5px; font-weight: bold; cursor: pointer; }

/* --- ★ 장사일기 인스타 피드형 스타일 구조 추가 */
.diary-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    max-width: 500px;
    margin: 0 auto;
}
.diary-card {
    background: #ffffff; border-radius: 15px; border: 1px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06); width: 100%; overflow: hidden; text-align: left; display: flex; flex-direction: column;
}
.diary-card-header {
    padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0;
}
.diary-card-tag {
    background: #fff3e0; color: #ef6c00; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: bold;
}
.diary-card-date { color: #999; font-size: 0.85rem; }
.diary-card-img {
    width: 100%; height: auto; max-height: 450px; object-fit: cover; border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.diary-card-body { padding: 1.5rem; }
.diary-card-body p { margin: 0; font-size: 1rem; color: #444; line-height: 1.6; word-break: break-all; }

/* 방명록 & 푸터 */
.guestbook-form { display: flex; flex-direction: column; gap: 1rem; max-width: 500px; margin: 2rem auto; background: white; padding: 2rem; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.guestbook-form input, .guestbook-form textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; }
.guestbook-form button { background-color: #d3a052; color: white; border: none; padding: 12px; border-radius: 5px; font-weight: bold; cursor: pointer; }

footer { background-color: #1a1a1a; color: #999; text-align: left; padding: 4rem 2rem; margin-top: 5rem; font-size: 0.85rem; line-height: 2; border-top: 1px solid #333; }
.footer-content { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.footer-logo-img { width: 100px; height: auto; margin-bottom: 1.5rem; display: block; border-radius: 12px; opacity: 0.95; cursor: pointer; }
.footer-bottom { max-width: 900px; margin: 2rem auto 0; padding-top: 2rem; border-top: 1px solid #222; font-size: 0.75rem; }

.page-section { display: none; }
.page-section.active { display: block; }

/* =========================================
   📱 모바일 화면 맞춤 설정 (기기 대응 강화)
   ========================================= */
@media (max-width: 600px) {
    .navbar { padding: calc(15px + env(safe-area-inset-top)) 0 15px 0; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.85rem; }
    section { padding: 3rem 1rem; }
    section h2 { font-size: 1.5rem; margin-bottom: 2rem; }
    .home-logo-img { width: 140px; margin-bottom: 1rem; }
    .home-slogan { font-size: 1.4rem; letter-spacing: 0; }
    .home-desc { font-size: 0.9rem; }
    .home-highlights span { font-size: 0.75rem; padding: 5px 10px; }
    .menu-tabs { gap: 6px; }
    .tab-btn, .notice-btn { padding: 8px 12px; font-size: 0.8rem; }
    .home-gallery { flex-direction: column; gap: 1rem; }
    .room-badge { font-size: 0.8rem; padding: 6px 12px; }
    .diary-grid { gap: 1.5rem; }
    .diary-card-body { padding: 1.1rem; }
    .diary-card-body p { font-size: 0.9rem; }
}

/* =========================================
   ★ 장사일기 인스타 피드형 공감 & 댓글 스타일
   ========================================= */
.diary-interaction { 
    padding: 0 1.5rem 1rem; 
    border-bottom: 1px solid #f0f0f0; 
}
.like-btn { 
    background: none; border: 1px solid #ddd; padding: 6px 14px; 
    border-radius: 20px; cursor: pointer; font-size: 0.9rem; color: #555; 
    display: inline-flex; align-items: center; gap: 5px; transition: 0.2s; 
}
.like-btn.liked { 
    border-color: #ff4b4b; color: #ff4b4b; background: #fff5f5; 
}
.diary-comments { 
    padding: 1rem 1.5rem; background: #fafafa; 
}
/* 댓글 개별 한 줄 구조 레이아웃 수정 */
.comment-item { 
    font-size: 0.85rem; 
    margin-bottom: 8px; 
    color: #444; 
    line-height: 1.4; 
    display: flex;
    justify-content: space-between; /* 내용물은 왼쪽, 삭제 버튼은 오른쪽 끝 배치 */
    align-items: center;
    gap: 10px;
}

.comment-content {
    word-break: break-all;
    text-align: left;
    flex: 1; /* 글씨 공간을 최대로 확보 */
}

.comment-item strong { 
    color: #111; 
    margin-right: 6px; 
}

/* ❌ 댓글 삭제 텍스트 버튼 스타일 디자인 */
.comment-del-btn {
    color: #bbb;
    cursor: pointer;
    font-size: 0.75rem;
    white-space: nowrap;
    padding: 2px 4px;
    transition: color 0.2s;
}

.comment-del-btn:hover {
    color: #ff4b4b; /* 마우스 올리거나 터치하면 빨갛게 경고 표시 */
}
/* 수정된 댓글 입력창 박스 및 버튼 스타일 */
.comment-input-box { 
    display: flex; 
    gap: 5px; 
    margin-top: 12px; 
    width: 100%; /* 화면 꽉 차게 설정 */
    box-sizing: border-box;
}
.comment-input-box input { 
    border: 1px solid #ddd; 
    padding: 10px; 
    border-radius: 5px; 
    font-size: 0.85rem; 
    min-width: 0; /* 핵심⭐: 입력창이 화면 밖으로 무한정 늘어나는 것을 방지 */
}
.comment-input-box button { 
    background: #d3a052; 
    color: white; 
    border: none; 
    padding: 0 15px; 
    border-radius: 5px; 
    font-weight: bold; 
    cursor: pointer; 
    white-space: nowrap; 
    font-size: 0.85rem;
    flex-shrink: 0; /* 핵심⭐: 버튼은 절대 찌그러지거나 잘리지 않도록 고정! */
}
/* ❌ 장사일기 게시물 삭제 버튼 (관리자 전용) */
.post-del-btn {
    background: #ff4b4b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(255, 75, 75, 0.3);
}
.post-del-btn:hover {
    background: #e63939;
}