/*
 * 새 디자인 chat.css 에 없는 추가 컴포넌트 스타일.
 * - 타이핑 인디케이터 (AI 응답 대기 점 애니메이션)
 * - 대화 종료 버튼 (요약/카드 생성 트리거)
 * - 요약 모달 (기억 카드 생성 → 미리보기 → 저장)
 */

/* 대화 상단 액션(처음부터 / 대화 종료) — 새 디자인은 단일 버튼이라 nowrap 필요 */
.conversation-actions {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.small-control-button.end-button {
    background: #3F563D;
    color: #fff;
    border-color: transparent;
}

.small-control-button.end-button:hover {
    background: #2f4530;
}

/* 다온 목소리 on/off 토글 */
.small-control-button.voice-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.small-control-button.voice-toggle-button .voice-toggle-icon {
    font-size: 16px;
    line-height: 1;
}

.small-control-button.voice-toggle-button.is-on {
    background: #FFF6E5;
    color: #C28A4E;
    border-color: #E6C99A;
}

.small-control-button.voice-toggle-button.is-on:hover {
    background: #FBEAC8;
}

.small-control-button.voice-toggle-button.is-off {
    background: #F2EFE7;
    color: #8A8275;
    border-color: #D9D3C5;
}

.small-control-button.voice-toggle-button.is-off:hover {
    background: #E8E4D8;
}

/* 타이핑 인디케이터 */
.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 12px 18px !important;
}

.typing-bubble span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C28A4E;
    opacity: 0.45;
    animation: typingDot 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingDot {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* 음성 버튼 active 상태 */
.voice-demo-button.is-listening {
    background: #C28A4E !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* 요약/카드 저장 모달 */
.summary-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-modal[hidden] { display: none; }

.summary-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(43, 35, 25, 0.55);
    backdrop-filter: blur(4px);
}

.summary-dialog {
    position: relative;
    width: min(540px, 92vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #FCF4E7;
    border-radius: 16px;
    box-shadow: 0 32px 70px rgba(40, 28, 14, 0.28);
    overflow: hidden;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid rgba(180, 145, 95, 0.22);
}

.summary-header h2 {
    margin: 0;
    color: #3F563D;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.summary-close {
    border: 0;
    background: transparent;
    color: #6e5a3f;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.summary-body {
    padding: 26px;
    overflow-y: auto;
    color: #3F2E1E;
}

.summary-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 26px;
    border-top: 1px solid rgba(180, 145, 95, 0.22);
    background: rgba(255, 250, 238, 0.55);
}

.summary-btn {
    padding: 11px 22px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.summary-btn:disabled { opacity: 0.55; cursor: progress; }

.summary-btn-primary {
    background: #3F563D;
    color: #fff;
}

.summary-btn-primary:hover:not(:disabled) { background: #2f4530; }

.summary-btn-secondary {
    background: rgba(63, 86, 61, 0.08);
    color: #3F563D;
}

.summary-btn-secondary:hover { background: rgba(63, 86, 61, 0.16); }

.summary-card-preview h3.summary-card-title {
    margin: 0 0 14px;
    color: #3F563D;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.summary-highlights {
    margin: 0 0 18px;
    padding: 14px 18px;
    background: rgba(194, 138, 78, 0.1);
    border-radius: 10px;
    list-style: disc inside;
    color: #5a4226;
    font-size: 14px;
    line-height: 1.7;
}

.summary-highlights li { margin: 2px 0; }

.summary-card-essay p {
    margin: 0 0 12px;
    color: #3F2E1E;
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: -0.02em;
}

.summary-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 28px 0;
    color: #6e5a3f;
}

.summary-loading p { margin: 0; font-size: 14px; }

.summary-loading > span {
    width: 10px; height: 10px; border-radius: 50%;
    background: #C28A4E; opacity: 0.5;
    display: inline-block;
    animation: typingDot 1.2s infinite ease-in-out;
}

.summary-loading > span + span { margin-left: 6px; }
.summary-loading > span:nth-child(2) { animation-delay: 0.15s; }
.summary-loading > span:nth-child(3) { animation-delay: 0.3s; }

/* 가로로 점 3개를 정렬하기 위한 트릭 */
.summary-loading {
    text-align: center;
}

.summary-loading > span:nth-of-type(-n+3) {
    display: inline-block;
    margin: 0 4px;
}

.summary-error {
    padding: 24px 0;
    color: #a04b2e;
    font-size: 14px;
    text-align: center;
}

.summary-saved {
    padding: 28px 0;
    color: #3F563D;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 1.7;
}

/* sr-only (스크린리더 전용) */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
