/* ========================================
   AI 교육과정 생성기 챗봇 테마
   hrdflex.ai-generator.theme.css
   ======================================== */

/* 페이지 컨테이너 */
.ai-chatbot-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.ai-chatbot-header {
    text-align: center;
    margin-bottom: 24px;
}

.ai-chatbot-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.ai-chatbot-header h1 i {
    color: #2563EB;
}

.ai-chatbot-header p {
    font-size: 14px;
    color: #6B7280;
    margin: 8px 0 0 0;
}

/* 챗봇 메인 컨테이너 */
.chatbot-container {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 500px;
    max-height: 700px;
}

/* 챗봇 헤더 */
.chatbot-header {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header-info h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chatbot-header-info span {
    font-size: 12px;
    opacity: 0.8;
}

.chatbot-header-actions {
    margin-left: auto;
}

.chatbot-reset-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-reset-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 메시지 영역 */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F9FAFB;
}

/* 메시지 공통 */
.chat-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: chatSlideInLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-msg.user {
    flex-direction: row-reverse;
    animation: chatSlideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-msg.bot .chat-msg-avatar {
    background: #2563EB;
    color: white;
}

.chat-msg.user .chat-msg-avatar {
    background: #E5E7EB;
    color: #6B7280;
}

.chat-msg-content {
    max-width: 75%;
}

.chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.chat-msg.bot .chat-msg-bubble {
    background: #FFFFFF;
    color: #1F2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
}

.chat-msg.bot .chat-msg-bubble:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chat-msg.user .chat-msg-bubble {
    background: #2563EB;
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: box-shadow 0.3s ease;
}

.chat-msg.user .chat-msg-bubble:hover {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.chat-msg-time {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-msg.user .chat-msg-time {
    text-align: right;
}

/* 선택 옵션 버튼들 */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
    animation: optionsFadeIn 0.4s ease-out 0.3s both;
}

.chat-option-btn {
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    animation: btnFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chat-option-btn:nth-child(1) { animation-delay: 0.35s; }
.chat-option-btn:nth-child(2) { animation-delay: 0.45s; }
.chat-option-btn:nth-child(3) { animation-delay: 0.55s; }

@keyframes btnFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-option-btn:hover {
    border-color: #2563EB;
    background: #EFF6FF;
    color: #2563EB;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.chat-option-btn:active {
    transform: translateY(0) scale(0.98);
}

.chat-option-btn.selected {
    border-color: #2563EB;
    background: #2563EB;
    color: white;
}

.chat-option-btn i {
    font-size: 14px;
}

/* 정보 아이콘 */
.chat-option-btn .info-tip {
    width: 16px;
    height: 16px;
    background: #9CA3AF;
    border-radius: 50%;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 4px;
    cursor: help;
    position: relative;
}

.chat-option-btn:hover .info-tip {
    background: #2563EB;
}

.chat-option-btn .info-tip .tip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

.chat-option-btn .info-tip:hover .tip-text {
    opacity: 1;
    visibility: visible;
}

/* 입력 영역 */
.chatbot-input-area {
    padding: 16px 20px;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
}

.chatbot-input-row {
    display: flex;
    gap: 10px;
}

.chatbot-textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Pretendard', sans-serif;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    background: #FFFFFF;
    color: #1F2937;
    transition: border-color 0.2s;
}

.chatbot-textarea:focus {
    outline: none;
    border-color: #2563EB;
}

.chatbot-textarea::placeholder {
    color: #9CA3AF;
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    background: #2563EB;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send-btn:hover {
    background: #1D4ED8;
}

.chatbot-send-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

/* 숫자 입력 (교육량) */
.chat-number-input {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 12px;
}

.chat-number-input input {
    width: 80px;
    padding: 10px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    background: #FFFFFF;
    color: #1F2937;
}

.chat-number-input input:focus {
    outline: none;
    border-color: #2563EB;
}

.chat-number-input span {
    font-size: 14px;
    color: #6B7280;
}

.chat-number-input button {
    padding: 10px 20px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-number-input button:hover {
    background: #1D4ED8;
}

/* 로딩 애니메이션 */
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 8px 4px;
    animation: typingFadeIn 0.3s ease-out;
}

@keyframes typingFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-typing span {
    width: 8px;
    height: 8px;
    background: #9CA3AF;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing span:nth-child(2) { animation-delay: -0.16s; }
.chat-typing span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes chatFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-3px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chatSlideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateX(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes chatSlideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateX(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes optionsFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 과정안 카드 (챗봇 내) */
.chat-proposal-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.chat-proposal-card {
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chat-proposal-card:nth-child(1) { animation-delay: 0.1s; }
.chat-proposal-card:nth-child(2) { animation-delay: 0.2s; }
.chat-proposal-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes cardFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-proposal-card:hover {
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.chat-proposal-card.selected {
    border-color: #2563EB;
    background: #EFF6FF;
}

.chat-proposal-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-proposal-badge.basic { background: #DBEAFE; color: #1D4ED8; }
.chat-proposal-badge.practical { background: #D1FAE5; color: #059669; }
.chat-proposal-badge.advanced { background: #FDE68A; color: #B45309; }

.chat-proposal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 4px;
    line-height: 1.4;
}

.chat-proposal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6B7280;
    align-items: center;
}

.chat-proposal-meta i {
    color: #2563EB;
    margin-right: 6px;
}

/* 차시 목록 토글 */
.chat-proposal-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #E5E7EB;
    font-size: 12px;
    color: #2563EB;
    cursor: pointer;
    transition: color 0.2s;
}

.chat-proposal-toggle:hover {
    color: #1D4ED8;
}

.chat-proposal-toggle i {
    transition: transform 0.3s;
    margin-right: 4px;
}

.chat-proposal-toggle.open i {
    transform: rotate(180deg);
}

/* 차시 목록 */
.chat-proposal-classes {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: #F9FAFB;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.chat-proposal-classes.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.chat-proposal-class-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #374151;
    border-bottom: 1px dashed #E5E7EB;
}

.chat-proposal-class-item:last-child {
    border-bottom: none;
}

.chat-proposal-class-num {
    min-width: 24px;
    height: 24px;
    background: #2563EB;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.chat-proposal-class-title {
    flex: 1;
    line-height: 1.4;
}

.chat-proposal-class-time {
    color: #6B7280;
    font-size: 11px;
    white-space: nowrap;
}

/* 결과 모달 */
.result-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.result-modal-overlay.active {
    display: flex;
}

.result-modal-content {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.result-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.result-modal-icon.success {
    background: #D1FAE5;
    color: #10B981;
}

.result-modal-icon.error {
    background: #FEE2E2;
    color: #EF4444;
}

.result-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
}

.result-modal-message {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.result-modal-info {
    background: #F3F4F6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.result-modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #E5E7EB;
}

.result-modal-info-row:last-child {
    border-bottom: none;
}

.result-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.result-modal-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.result-modal-btn.secondary {
    background: #F3F4F6;
    color: #374151;
}

.result-modal-btn.primary {
    background: #10B981;
    color: white;
}

.result-modal-btn:hover {
    transform: translateY(-1px);
}

/* 비로그인 박스 */
.chatbot-login-required {
    text-align: center;
    padding: 60px 40px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.chatbot-login-required i {
    font-size: 48px;
    color: #9CA3AF;
    margin-bottom: 20px;
}

.chatbot-login-required h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 12px;
}

.chatbot-login-required p {
    color: #6B7280;
    margin-bottom: 24px;
}

.chatbot-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.chatbot-login-btn:hover {
    background: #1D4ED8;
    color: white;
}

/* 반응형 */
@media (max-width: 768px) {
    .chatbot-container {
        height: calc(100vh - 200px);
        border-radius: 0;
    }

    .chat-msg-content {
        max-width: 85%;
    }

    .chat-options {
        flex-direction: column;
    }

    .chat-option-btn {
        width: 100%;
        justify-content: center;
    }
}
