.bg_green {
    background: #92D050;	
}

#chat_box {
	border: 1px solid white;
    height: 100%;
}

#collection_select {
    margin-left: 15px;
    margin-right: 15px;
	margin-top: 10px;
	margin-bottom: 10px;
    border: 0px solid #ccc;
}

.message_me {
	max-width: 70%;
	margin-left: auto;
	border-radius: 20px;
    padding: 10px;
    margin-top: 20px;
    background-color: #4CAF50;
	color: #fff;
	white-space: pre-wrap;
	word-break:break-all;
}

.message_chatbot {
	max-width: 70%;
	margin-right: auto;
	border-radius: 20px;
	padding: 10px;
    margin-top: 20px;
    background-color: #e6e6e6;
	white-space: pre-wrap;
	word-break:break-all;
}

#chat-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
    overflow-y: scroll;
    padding: 10px;
    display: flex;
    flex-direction: column-reverse;
	white-space: pre-wrap;
	-webkit-overflow-scrolling: touch; /* iOS에서 스크롤 작동을 유도 */
}

#user-input {
    display: flex;
    padding: 10px;
	border-top: 1px solid #ddd;
    background: #f1f1f1;
}

#user-input input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    margin-right: 10px;
    background: #e9e9e9;
}

#fileUploadBtn {
	padding: 5px;
    margin-right: 10px;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

/* 모달 콘텐츠 스타일 */
.modal-content-wrapper {
    overflow-y: auto; /* 콘텐츠가 넘칠 경우 스크롤 생성 */
    max-height: 80%; /* 최대 높이 설정 */
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    background-color: #fefefe;
	white-space: pre-wrap;
}

/* 닫기 버튼 스타일 */
.closeModal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.closeModal:hover,
.closeModal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.bookname:hover {
    background-color: transparent !important; /* hover 상태에서도 배경색 변경 방지 */
}

.pdf {
    margin-right: 10px;	
}

#rerank {
    width: 50px;
	height: 23px;
    display: none;	
}

.file-preview-container {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.file-preview-item {
    position: relative;
}

.preview-wrapper {
    position: relative;
    display: inline-block;
}

.file-preview-item img,
.file-preview-item video {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid #ddd;
}

.file-preview-item img:hover,
.file-preview-item video:hover {
    border-color: #007bff;
}

.remove-file-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 파일 미리보기 모달 전용 스타일 */
#filePreviewModal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(3px);
}

#filePreviewModal .modal-content-wrapper {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    position: relative;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#filePreviewModal img,
#filePreviewModal video {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    object-fit: contain;
}

#filePreviewModal p {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    word-break: break-all;
    max-width: 80%;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close:hover {
    color: #000;
    background: rgba(255,255,255,1);
    transform: scale(1.1);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    #filePreviewModal .modal-content-wrapper {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
        max-height: 85vh;
    }
    
    #filePreviewModal img,
    #filePreviewModal video {
        max-height: 60vh;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    
    #filePreviewModal p {
        font-size: 14px;
        margin-top: 10px;
    }
}

/* 애니메이션 효과 */
.modal {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content-wrapper {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}