@font-face {
    font-family: 'SCDream';
    font-style: normal;
    src: url('../fonts/SCDream3.otf') format('opentype');
    font-weight: 300;
}
@font-face {
    font-family: 'SCDream';
    font-style: normal;
    src: url('../fonts/SCDream4.otf') format('opentype');
    font-weight: 400;
}
@font-face {
    font-family: 'SCDream';
    font-style: normal;
    src: url('../fonts/SCDream5.otf') format('opentype');
    font-weight: 500;
}
@font-face {
    font-family: 'SCDream';
    font-style: normal;
    src: url('../fonts/SCDream6.otf') format('opentype');
    font-weight: 600;
}
@font-face {
    font-family: 'SCDream';
    font-style: normal;
    src: url('../fonts/SCDream7.otf') format('opentype');
    font-weight: 700;
}
@font-face {
    font-family: 'SCDream';
    font-style: normal;
    src: url('../fonts/SCDream9.otf') format('opentype');
    font-weight: 900;
}

@font-face {
    font-family: 'Tenada';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2210-2@1.0/Tenada.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

* {
    font-family: 'SCDream', 'Segoe UI', sans-serif;
    font-weight: 400;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: url('../images/blue.png') no-repeat center center fixed;
    background-size: 50% auto; 
}

body.dark-mode {
    background: url('../images/bg_dark.svg') no-repeat center center fixed;
    background-size: cover;
}

/* 라이트모드일 때 sun.svg 아이콘으로 교체 */
body.light-mode .sidebar-icon.darkmode {
    background-image: url('../images/icon/sun.svg');
}

/* 포커스 시 outline 통일 처리 */
input:focus, textarea:focus {
    outline: none;
}

/* ✅ textarea 리사이즈 핸들 제거 */
textarea {
    resize: none;
}

/* 레이아웃 - 채팅 전체 컨테이너 */
.chat-container {
    margin:1rem;
    height: 89vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

/* 중앙 인사말 */
.greeting {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #111;
    width: 100%;
}
.greeting .sub-text {
    font-size: 1.3rem;
    font-weight: 600;
    color:#ff6200;
}
.greeting .main-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0 30px;
}

/* 하단 입력 및 옵션 영역 */
.bottom-area {
    position: absolute;
    bottom: 30px;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    left: 50%;
    transform: translateX(-50%);
}

/* 옵션 카드 리스트 */
.chat-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 20px;
    width: 100%;
}
.chat-card {
    position: relative;
    width: 100%;
    aspect-ratio: 3.3 / 1;
    background: url('../images/ask_component.svg') no-repeat center center;
    background-size: 100% 100%;
    border-radius: 15px;
    cursor: pointer;
    overflow: hidden;
}
.chat-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('../images/ask_component_hover.svg') no-repeat center center;
    background-size: 100% 100%;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}
.chat-card:hover::after {
    opacity: 1;
}

/* 입력창 영역 및 스타일 */
.chat-input-wrapper {
    width: 100%;
    position: relative;
    border-radius: 20px;
    padding: 2px;
    border: 1px solid #ff6200;
}
.chat-input-inner {
    border-radius: 20px;
    padding: 0.6rem;
    display: flex;
    align-items: center;
}

body.dark-mode .chat-input-inner{
        background-color:#2c2c2c;
          color: #fff;
}

/* 텍스트 영역 */
.chat-msg {
    width: 100%;
    font-size: 1rem;
    color: #000;
    /* resize: none; (여기에 이미 적용된 .chat-msg에도 적용되지만, textarea 태그 자체에 resize: none;을 적용하는 것이 더 일반적입니다) */
    min-height: 20px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    padding: 6px 10px;
    border: none;
    height: 33px;
}

/* 버튼 및 아이콘 */
.chat-input {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
}

body.dark-mode .chat-input{
    background-color:#2c2c2c;
}

.add-btn {
    width: 40px;
    height: 40px;
    background: url('../images/icon/plus.svg') no-repeat center center;
    border: none;
    cursor: pointer;
}
.add-image-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    width: 100%;
}

.add-image-btn .icon {
    width: 40px;
    height: 40px;
    background: url('../images/icon/img.svg') no-repeat center center;
    background-size: contain;
}
.add-image-btn .text {
    color: #333;
    font-size: 14px;
}

body.dark-mode .add-image-btn .text {
    color: #ffffff;
}

.send-btn {
    width: 50px;
    height: 50px;
    background: url('../images/icon/btn.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    transition: background-image 0.2s ease;
}
/* .send-btn:hover {
    background-image: url('../images/icon/send_after.svg');
} */

/* 채팅 메시지 리스트 */
.chat-message-list {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column-reverse; /* 최신 메시지 아래 표시 */
    overflow-y: auto;
    max-height: 80%;
    padding: 10px;
}

/* 메시지 한 줄 래퍼 */
.chat-bubble-row {
    width: 100%;
    display: flex;
    margin-bottom: 10px;
}

/* 공통 말풍선 */
.chat-bubble {
    padding: 10px 15px;
    border-radius: 16px;
    max-width: 85%;
    width: fit-content;
    word-break: break-word;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 사용자 말풍선 */
.chat-bubble.user {
    margin-left: auto;
    padding: 2px; /* 테두리 두께 */
    border-radius: 18px;
    background: #111;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.chat-bubble.user .chat-bubble-inner {
    color: #fff;
        background:#111;
    border-radius: 16px;
    padding: 10px 15px;
    word-break: break-word;
    font-size: 0.95rem;
}

/* AI 말풍선 */
.chat-bubble.ai {
    margin-right: auto;
    border-bottom-left-radius: 0;
    padding-bottom: 30px; /* 복사 아이콘 공간 확보 */
    background-color: #FFEFE5;
    
}

/* AI 복사 아이콘 */
.chat-bubble.ai .copy-icon {
    position: absolute;
    bottom: 0;
    right: 10px;
    width: 30px;
    height: 30px;
    background: url('../images/icon/copy.svg') no-repeat center center;
    background-size: contain;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

body.dark-mode .chat-bubble.ai .copy-icon {
    background: url('../images/icon/copy_dark.svg') no-repeat center center;
}

.chat-bubble.ai .copy-icon:hover {
    opacity: 1;
}

/* 타이핑 인디케이터 (dots 애니메이션) */
.typing-indicator {
    display: inline-block;
    width: 54px;
    text-align: left;
    padding: 10px 15px;
    border-radius: 16px;
    /* background-color: #f0f0f0; */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 1px;
    background: #999;
    border-radius: 50%;
    opacity: 0.4;
    animation: blink 1.4s infinite both;
}
.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}




body.dark-mode .chat-msg {
    background-color:#2c2c2c;
                color: #fff;
}

body.dark-mode .chat-bubble.ai {
    background-color: #333;
    color:white;
}

body.dark-mode .chat-bubble.user .chat-bubble-inner {
    background-color: #111;
    color:white;
}

body.dark-mode .main-text {
    color: #eee;
}

  @media (max-width: 1024px) {
    .greeting .main-text{
        font-size: 1.5rem;
    }
  }

  