﻿:root {
    --cl-chatbox-font-size: 16px;
}

ul{
    list-style:none;
}

/* 메시지 텍스트에 애니메이션 적용 */
.cl-chatbox--bubble--left .clc-chat-message-text {
    color: #333;
}
.cl-chatbox--bubble--right .clc-chat-message-text {
    padding: 0.9375rem;
}
.ivy-answer .answer-view .clc-chat-message-text {
    padding: 0.9375rem;
}

.clc-chat-message-text {
    font-family: 'Pretendard';
    line-height: 1.6;
    padding: 0 0.3rem;
    font-size: var(--cl-chatbox-font-size);
    box-sizing: border-box;
}

    /* 내부 모든 요소 기본 리셋 */
    .clc-chat-message-text * {
        margin: 0;
        padding: 0;
        box-sizing: inherit;
    }

    /* 문단 및 일반 텍스트 */
    .clc-chat-message-text p {
        line-height: 1.7;
        font-size:var(--cl-chatbox-font-size);
    }

    /* 헤딩 (h1 ~ h6) 스타일 */
    .clc-chat-message-text h1,
    .clc-chat-message-text h2,
    .clc-chat-message-text h3,
    .clc-chat-message-text h4,
    .clc-chat-message-text h5,
    .clc-chat-message-text h6 {
        margin: 20px 0 10px;
        font-weight: bold;
        line-height: 1.2;
    }

    .clc-chat-message-text h1 {
        font-size: 1.5em;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 10px;
    }

    .clc-chat-message-text h2 {
        font-size: 1.4em;
    }

    .clc-chat-message-text h3 {
        font-size: 1.25em;
    }

    .clc-chat-message-text h4 {
        font-size: 1.1em;
    }

    .clc-chat-message-text h5 {
        font-size: 1em;
    }

    .clc-chat-message-text h6 {
        font-size: 0.85em;
    }

    /* 수평선 */
    .clc-chat-message-text hr {
        border: none;
        border-top: 1px dashed #ddd;
        margin: 20px 0;
    }

    /* 목록 스타일 (순서, 무순서, 중첩 목록 포함) */
    .clc-chat-message-text ul,
    .clc-chat-message-text ol {
        margin: 10px 0 10px 20px;
        padding: 0;
        list-style-position: outside;
    }

    .clc-chat-message-text li {
        margin: 8px 0;
    }

    /* 링크 스타일 */
    .clc-chat-message-text a {
        color: #007acc;
        text-decoration: none;
        transition: color 0.3s;
    }

        .clc-chat-message-text a:hover {
            color: #005999;
            text-decoration: underline;
        }

    /* 이미지 스타일 */
    .clc-chat-message-text img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 16px 0;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
.chat-message--bubble_imgwrap {
    padding: 0.9375rem 1.5625rem 0;
}
.chat-message--bubble_imgwrap p{
    color: #333;
}
/* 인용문 (blockquote) 스타일 */
.clc-chat-message-text blockquote {
    border-left: 4px solid #ccc;
    padding-left: 15px;
    margin: 16px 0;
    /*background-color: #f9f9f9;
    color: #666;
    font-style: italic;*/
}

    /* 인라인 코드 스타일 */
    .clc-chat-message-text code {
        background-color: #f4f4f4;
        color: #c7254e;
        padding: 2px 4px;
        font-family: Consolas, 'Courier New', monospace;
        border-radius: 3px;
        font-size: 0.95em;
    }

    /* 코드 블록 및 다중 줄 코드 */
.clc-chat-message-text pre {
    background-color: var(--clc-assign-base-50);
    text-shadow: none;
    padding: 15px;
    overflow-x: auto;
    border-radius: 5px;
    margin: 16px 0;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.95em;
    line-height: 1.5;
}

        /* 코드 블록 내부의 code 태그 */
        .clc-chat-message-text pre code {
            background: none;
            padding: 0;
            border: none;
            color: inherit;
            overflow-x:auto;
        }

    /* 표 스타일 */
    .clc-chat-message-text table {
        width: 100%;
        border-collapse: collapse;
        margin: 16px 0;
    }

    .clc-chat-message-text th,
    .clc-chat-message-text td {
        border: 1px solid #ddd;
        padding: 10px;
        text-align: left;
    }

    .clc-chat-message-text th {
        background-color: #f5f5f5;
    }

    /* 체크박스 및 작업 목록 스타일 */
    .clc-chat-message-text .contains-task-list {
        list-style: none;
        padding-left: 0;
    }

    .clc-chat-message-text .task-list-item {
        display: flex;
        align-items: center;
        margin: 8px 0;
    }

        .clc-chat-message-text .task-list-item input[type="checkbox"] {
            margin-right: 10px;
        }

    /* 이모지 등 특수문자 스타일 (필요시 추가 가능) */
    .clc-chat-message-text li {
        /* 이모지의 크기나 간격 등 추가 디자인을 여기에 적용 */
    }

    /* HTML 태그 내 인라인 스타일 보완 */
    .clc-chat-message-text [style] {
        /* 인라인 스타일을 기본 스타일과 조화롭게 보이도록 설정 */
        color: inherit;
        font-size: inherit;
    }

    /* 텍스트 강조 */
    .clc-chat-message-text strong {
        font-weight: bold;
    }

    .clc-chat-message-text em {
        font-style: italic;
    }

    .clc-chat-message-text del {
        text-decoration: line-through;
    }

    /* 전반적인 부드러운 렌더링 */
    .clc-chat-message-text *:not(pre) {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

/* KaTeX 수학 렌더링 스타일 */

/* 기본 수학 표기법 컨테이너 스타일 */
.math-inline, .math-block {
    font-family: 'KaTeX_Math', 'Times New Roman', serif;
    line-height: 1.5;
}

/* 인라인 수학 표기법 스타일 */
.math-inline {
    display: inline-block;
    vertical-align: middle;
    padding: 0 3px;
}

/* 블록 수학 표기법 스타일 */
.math-block {
    display: block;
    margin: 1em 0;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
}

/* 수학 섹션 제목 스타일 */
.math-section-title {
    font-weight: bold;
    color: #2c3e50;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* KaTeX 공식 레이아웃 수정 */
.katex-display {
    margin: 1em 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
}

    /* 공식이 큰 경우 가로 스크롤 처리 */
    .katex-display > .katex {
        max-width: 100%;
    }

/* 수식 내 HTML 태그 렌더링 스타일 */
.html-tag-in-math {
    font-family: monospace;
    color: #888;
    background-color: #f8f9fa;
    padding: 0 3px;
    border-radius: 3px;
}

/* 수학 표기법 에러 메시지 스타일 */
.katex-error {
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    background-color: #fdecea;
    font-family: monospace;
    font-size: 0.9em;
}

/* 모바일 화면에서의 수식 조정 */
@media (max-width: 768px) {
    .math-block, .katex-display {
        font-size: 0.9em;
    }
}

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .math-section-title {
        color: #e0e0e0;
        border-bottom-color: #444;
    }

    .html-tag-in-math {
        background-color: #2a2a2a;
        color: #aaa;
    }

    .katex-error {
        background-color: rgba(231, 76, 60, 0.2);
        color: #ff6b6b;
        border-color: #e74c3c;
    }
/* 파일 업로드 진행도 표시 바 스타일 */
.file-upload-progress-indicator {
    margin: 10px 0;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.progress-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.file-name {
    font-size: 14px;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.progress-percent {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    flex: 0 0 auto;
}

.progress-bar-container {
    flex: 2;
    min-width: 100px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #529AFF 0%, #8ECFFF 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cancel-button {
    flex: 0 0 auto;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

    .cancel-button:hover {
        background-color: #f1f3f5;
    }

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .file-upload-progress-indicator {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .file-name {
        color: #e2e8f0;
    }

    .progress-bar-container {
        background-color: #4a5568;
    }

    .cancel-button:hover {
        background-color: #4a5568;
    }

    .file-name {
        color: #e2e8f0;
    }

    .progress-percent {
        color: #a0aec0;
    }

    .progress-bar-container {
        background-color: #4a5568;
    }
}
}

/* 개별 파일 업로드 진행 상태 표시를 위한 원형 프로그레스 바 스타일 */
.circular-progress-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    z-index: 10;
}

.circular-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 3;
}

.circle-progress {
    fill: none;
    stroke: #529AFF;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.progress-text {
    fill: #333;
    font-size: 8px;
    text-anchor: middle;
    dominant-baseline: middle;
    font-weight: bold;
}

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .circle-bg {
        stroke: #4a5568;
    }
    
    .circle-progress {
        stroke: #8ECFFF;
    }
    
    .progress-text {
        fill: #e2e8f0;
    }
}
/* 파일 미리보기 영역의 텍스트 기반 진행 상태 표시 스타일 */
.upload-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000; /* z-index 값을 더 크게 설정 */
    white-space: nowrap;
    display: block; /* display 속성을 block으로 설정 */
}

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .upload-progress-text {
        background-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
}

/* 파일 미리보기 항목에 대한 스타일 */
.img_preview .wrap ul li {
    position: relative;
}

/* 다운로드 버튼 스타일 */
.download-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.download-link:hover {
    background-color: #e0e0e0;
}

/* 다운로드 아이콘 스타일 */
.download-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('./images/download-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 만료일 텍스트 스타일 */
.chat-message--bubble_filename.expired {
    font-size: 12px;
    color: #ff0000;
}

/* 동그란 다운로드 버튼 스타일 */
.download-link.circular {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.download-link.circular:hover {
    background-color: #e0e0e0;
}

/* 만료일 텍스트 스타일 */
.chat-message--bubble_file-expiredate {
    font-size: 12px;
    color: inherit;
}

.chat-message--bubble_file-expiredate.expired {
    font-size: 12px;
    color: red;
}

/* 만료일과 다운로드 버튼 컨테이너 */
.expiredate-download-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 흰색 다운로드 버튼 스타일 */
.download-link.circular {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    background-color: #ffffff;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    border: 1px solid #ccc;
}

.download-link.circular:hover {
    background-color: #f0f0f0;
}

/* 다운로드 아이콘 스타일 */
.download-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url('./images/download-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
