@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Pretendard:wght@400;500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #fafafa;
    color: #111;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 헤더 */
.chat-header {
    padding: 14px 20px;
    background: linear-gradient(135deg, #daeeff 0%, #eef6ff 60%, #fce4f0 100%);
    border-bottom: 1px solid #d6eaf8;
    flex-shrink: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.logo-text {
    font-family: 'Pacifico', cursive;
    font-size: 22px;
    font-weight: 400;
    color: #5b9bd5;
    letter-spacing: 0.5px;
}

.logo-heart {
    color: #f48fb1;
    font-size: 18px;
}

.header-sub {
    font-size: 12px;
    color: #7aaacc;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-insta-icon {
    font-size: 26px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 대화 영역 */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative; /* 워터마크 position 기준점 */
}

/* Capybara 워터마크 */
.chat-area::before {
    content: "Capybara";
    font-family: 'Pacifico', cursive;
    font-size: 80px;
    position: sticky; /* 스크롤해도 자연스럽게 따라옴 */
    top: 30%;
    left: 0;
    width: 100%;
    text-align: center;
    pointer-events: none; /* 클릭 방해 안 함 */
    background: linear-gradient(135deg, #a8d8f0 0%, #f4b8d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.35;
    z-index: 0; /* 말풍선 뒤로 */
    flex-shrink: 0;
}

.chat-empty {
    margin: auto;
    text-align: center;
    color: #ccc;
}

.chat-empty p {
    font-size: 15px;
}

.chat-empty .sub {
    font-size: 13px;
    margin-top: 6px;
}

/* 입력창 */
.chat-input-area {
    padding: 12px 16px 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.chat-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 24px;
    padding: 8px 12px;
}

.image-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: transform 0.15s;
}

.image-btn:hover {
    transform: scale(1.1);
}

.chat-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    color: #111;
}

.chat-input::placeholder {
    color: #bbb;
}

.send-btn {
    background: linear-gradient(135deg, #a8d8f0, #f4b8d0);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}

.send-btn:hover {
    opacity: 0.85;
}

/* 말풍선 공통 */
.message {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    animation: fadeUp 0.2s ease;
    position: relative; 
    z-index: 1;         
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 봇 말풍선 — 왼쪽 */
.message.bot {
    background: #fff;
    color: #111;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    padding: 16px 20px;
}

/* 사용자 말풍선 — 오른쪽 */
.message.user {
    background: linear-gradient(135deg, #a8d8f0, #f4b8d0);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-size: 15px;
    font-weight: 500;
}

/* 공통 버튼 */
.primary-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #a8d8f0, #f4b8d0);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.15s;
}

.primary-btn:hover {
    opacity: 0.88;
}

/* 옵션 팝업 */
.options-popup {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, 90vw);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 24px 20px;
    z-index: 100;
}

.options-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111;
}

.options-content {
    display: flex;
    flex-direction: column;
}

.options-content label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
    margin-top: 14px;
}

.options-content select,
.options-content input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.15s;
}

.options-content select:focus,
.options-content input[type="text"]:focus {
    border-color: #a8d8f0;
}

.generate-btn {
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    background: linear-gradient(135deg, #a8d8f0, #f4b8d0);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}

.generate-btn:hover {
    opacity: 0.88;
}

/* 로딩 애니메이션 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.message.loading::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid #e0e0e0;
    border-top-color: #f4b8d0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes moodFadeSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   반응형 — 모바일 (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {

    /* 헤더 */
    .chat-header {
        padding: 10px 14px;
    }
    .logo-text {
        font-size: 19px;
    }
    .header-sub {
        font-size: 11px;
    }
    .header-insta-icon {
        font-size: 22px;
    }

    /* 대화 영역 */
    .chat-area {
        padding: 14px 12px;
    }

    /* 워터마크 */
    .chat-area::before {
        font-size: 48px;
    }

    /* 말풍선 */
    .message {
        max-width: 86%;
        font-size: 13px;
        padding: 9px 12px;
    }
    .message.bot {
        padding: 13px 16px;
    }
    .message.user {
        font-size: 14px;
    }

    /* 입력창 */
    .chat-input-area {
        padding: 10px 12px 16px;
    }
    .chat-input {
        font-size: 14px;
    }

    /* 옵션 팝업 (HTML 백업용) */
    .options-popup {
        bottom: 70px;
        width: 94vw;
        padding: 18px 14px;
    }

    /* 음식정보 폼 카드 */
    .form-card {
        max-width: 100% !important;
        padding: 16px !important;
    }

    /* 옵션 버블 (script.js 동적 생성) */
    .options-bubble-wrap {
        width: 100% !important;
        max-width: 92% !important;
    }

    /* 업로드 이미지 미리보기 */
    .upload-preview-img {
        height: 220px !important;
    }

    /* 피드 이미지 스켈레톤 */
    .feed-skeleton {
        height: 220px !important;
    }

    /* 분위기 선택 카드 그리드 — 2열 유지하되 글자 축소 */
    #mood-grid {
        gap: 8px !important;
    }

    /* 온보딩 카드 */
    #onboarding-card {
        max-width: 92vw !important;
        padding: 24px 18px 18px !important;
    }

    /* 피드 카드(다크 테마 모달) */
    .feed-card-scroll {
        max-width: 100% !important;
        border-radius: 14px !important;
    }
}