body {
    font-family: 'Malgun Gothic', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    overflow-x: hidden; /* 슬라이드 침범 방지 */
}

.hidden { display: none !important; }

/* === 로그인 & 인증 상자 스타일 === */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 340px;
    text-align: center;
}
.login-box h1 { margin-top: 0; color: #ff6b6b; }
.login-box h2 { font-size: 14px; margin-bottom: 20px; color: #777; }
.login-box input, .login-box select {
    width: 90%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}
.login-box button {
    width: 100%;
    padding: 12px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    font-size: 15px;
}
.login-box button:hover { background-color: #ff5252; }
.login-links { margin-top: 15px; font-size: 13px; }
.login-links a { color: #555; text-decoration: none; margin: 0 5px; cursor: pointer; }
.login-links a:hover { text-decoration: underline; color: #ff6b6b; }

/* === 90% 꽉 차는 메인 서비스 레이아웃 === */
#main-page { 
    width: 90%; 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 30px 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ff6b6b;
    padding-bottom: 20px;
    margin-bottom: 30px;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    user-select: none;
}
.header-logo { height: 50px; width: auto; object-fit: contain; }
header h1 { margin: 0; color: #ff6b6b; font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.user-area { display: flex; align-items: center; gap: 15px; font-size: 16px; }
.user-area button { padding: 8px 16px; font-size: 14px; border-radius: 6px; cursor: pointer; }

/* === 메인 콘텐츠 배치 워크스페이스 === */
.workspace {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

/* 💡 [핵심] 상단 가로 정렬 영역 */
.interactive-showcase {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    position: relative;
}

/* 중앙 추천 음식 카드 */
.food-card-center {
    flex: 0 0 550px; /* 크기 고정 */
    z-index: 10;
}
.food-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    text-align: center;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.food-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.18); }
.food-card img { width: 100%; height: 350px; object-fit: cover; }
.food-info { padding: 25px; }
.food-title { font-size: 28px; font-weight: bold; margin: 0 0 10px 0; color: #111; }
.food-notes { font-size: 15px; color: #666; margin-bottom: 15px; font-style: italic; }
.food-price { font-size: 22px; color: #ff6b6b; font-weight: bold; }
.click-hint { font-size: 13px; color: #999; margin-top: 12px; display: block; text-decoration: underline; }

/* 💡 양측 슬라이드 섹션 공통 스타일 */
.side-panel {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    box-sizing: border-box;
    height: 520px; /* 음식 카드 높이와 균형 유지 */
    display: flex;
    flex-direction: column;
    
    /* 슬라이드 애니메이션 세팅 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;

    min-width: 0;
}

/* 왼쪽 메뉴판 좌측 슬라이드 효과 */
.side-panel.left-slide { transform: translateX(50px); }
/* 오른쪽 정보 우측 슬라이드 효과 */
.side-panel.right-slide { transform: translateX(-50px); }

/* 활성화 되었을 때 나타나는 상태 */
.side-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 왼쪽 내용 상세 */
.menu-board-section h3 { margin-top: 0; font-size: 18px; color: #444; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.menu-board-img { 
    width: 100%; height: 100%; max-height: 420px; object-fit: contain; 
    background: #fafafa; border-radius: 10px; border: 1px solid #e0e0e0; 
    cursor: zoom-in; /* 💡 마우스를 올리면 돋보기 모양으로 변함 */
}

/* 오른쪽 내용 상세 */
.store-title { font-size: 24px; font-weight: bold; margin: 0 0 8px 0; color: #ff6b6b; }
.store-loc { font-size: 15px; color: #555; margin: 0 0 20px 0; display: flex; align-items: center; gap: 5px; }
.store-loc a { color: #0068c3; text-decoration: none; font-weight: 500; }
.store-loc a:hover { text-decoration: underline; color: #004d91; }

.reason-box {
    background: #f0f8ff; padding: 15px; border-radius: 8px; font-size: 14px; color: #333; margin-bottom: 15px; border-left: 4px solid #4facfe; line-height: 1.5; 

    word-break: keep-all; 
    overflow-wrap: break-word;
}
.store-notes {
    background: #fff5f5; padding: 15px; border-radius: 8px; font-size: 14px; color: #cb3838; margin-bottom: 15px; border-left: 4px solid #ff6b6b; line-height: 1.5; 

    word-break: keep-all; 
    overflow-wrap: break-word;
}

/* 💡 하단에 안정적으로 깔리는 OpenAI 채팅창 영역 */
.ai-chat-placeholder {
    width: 100%;
    background: #fff;
    border: 2px dashed #ff6b6b;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    font-weight: bold;
    color: #ff6b6b;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    box-sizing: border-box;
    margin-top: 10px;
}
.test-trigger-btn { background: #ff6b6b; color: white; border: none; padding: 10px 20px; font-size: 15px; font-weight: bold; border-radius: 6px; cursor: pointer; margin-top: 12px; }
.test-trigger-btn:hover { background: #ff5252; }

/* 💡 창이 작아졌을 때 상하(세로) 배치로 바꿔주는 반응형 코드 (공백 제거 완벽 적용) */
@media screen and (max-width: 1100px) {
    .interactive-showcase {
        flex-direction: column;
        align-items: center;
    }
    
    /* 1. 음식 카드를 무조건 맨 위(1순위)로 끌어올림 */
    .food-card-center {
        flex: none;
        width: 100%;
        max-width: 500px;
        order: 1; /* ★ 순서를 1번으로 강제 지정 */
    }
    
    /* 2. 왼쪽 패널은 2번, 오른쪽 패널은 3번으로 밑에 배치 */
    #left-panel { order: 2; }
    #right-panel { order: 3; }

    .side-panel {
        width: 100%;
        max-width: 500px;
        height: auto;
        
        /* 3. ★ 핵심: 안 보일 때 투명하게 공간만 차지하는 걸 막기 위해 아예 흔적을 없앰 */
        display: none; 
    }
    
    /* 4. 메뉴 사진을 눌러서 active 클래스가 붙으면 아래쪽에 짠! 하고 나타나게 함 */
    .side-panel.active {
        display: flex; 
        margin-top: 20px; 
        transform: none; /* 모바일에서는 슬라이드 이동 효과 제거 */
        opacity: 1;
    }
}

/* ========================================================
   ✨ 중복을 제거하고 크기를 조절한 AI 채팅창 통합 스타일
   ======================================================== */

/* 1️⃣ 채팅창 전체를 감싸는 컨테이너 */
.chat-container {
    width: 100%;
    
    /* 💡 수정: 음식 카드(550px) 변경! */
    max-width: 850px; 
    
    margin: 15px auto; /* 위아래 여백을 줄여 컴팩트하게 배치 */
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 15px;
    box-sizing: border-box;
}

/* 2️⃣ 채팅 메시지가 쌓여서 스크롤 되는 영역 (ID와 클래스 통합) */
#ai-chat-log, .chat-log {
    /* 💡 높이를 230px~250px로 꽉 묶어서 위쪽 애니메이션 공간을 확보합니다 */
    height: 240px; 
    max-height: 240px;
    
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    
    /* 정렬 속성 일치 */
    display: flex;
    flex-direction: column;
    gap: 15px; /* 말풍선 사이 간격 */
    box-sizing: border-box;
}

/* 3️⃣ 말풍선 공통 스타일 */
.chat-msg {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 16px; 
    line-height: 1.5;
    word-break: keep-all;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.04);
}

/* 🤖 AI 말풍선 (왼쪽) */
.chat-bot {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* 🧑‍💻 내 말풍선 (오른쪽) */
.chat-user {
    align-self: flex-end;
    background: #ff6b6b;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* 4️⃣ 입력창 영역 */
.chat-input-area {
    display: flex;
    padding: 10px 0 0 0; /* 내부 패딩 최적화 */
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.chat-input-area input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255,107,107,0.15);
}

.chat-input-area button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0 25px;
    margin-left: 10px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.chat-input-area button:hover {
    background: #fa5252;
    transform: translateY(-2px);
}

