/* ============================================
   KOPILOT AI Chatbot Styles
   Gemini-inspired Modern UI
   ============================================ */

/* Gemini 스타일 변수 */
:root {
    /* Gemini Brand Colors */
    --gemini-bg: #ffffff;
    --gemini-surface: #f0f4f9;
    --gemini-text-primary: #1f1f1f;
    --gemini-text-secondary: #444746;
    --gemini-accent-blue: #1b1f24;
    --gemini-gradient-start: #4285f4;
    --gemini-gradient-end: #d96570;

    /* 기존 변수 호환 */
    --chatbot-primary: #4285f4;
    --chatbot-primary-hover: #3367d6;
    --chatbot-secondary: #9b72cb;
    --chatbot-bg: #ffffff;
    --chatbot-bg-dark: #f0f4f9;
    --chatbot-border: #e0e0e0;
    --chatbot-text: #1f1f1f;
    --chatbot-text-muted: #444746;
    --chatbot-user-bg: #f0f4f9;
    --chatbot-bot-bg: transparent;
    --chatbot-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --chatbot-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   메인 페이지 챗봇 섹션
   ============================================ */
.chatbot-section {
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    padding: 20px 20px 40px 20px;
    margin-bottom: 0;
}

.chatbot-section .container {
    max-width: 900px;
}

.chatbot-box {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
}

/* ============================================
   채팅 메시지 영역 (플로팅 챗봇용 - #chatbotSection 외부)
   ============================================ */
.floating-chatbot-window .chatbot-messages {
    min-height: 80px;
    max-height: 480px;
    overflow-y: auto;
    padding: 20px 0;
    background: transparent;
    max-width: 800px;
    margin: 0 auto;
}

.floating-chatbot-window .chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.floating-chatbot-window .chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.floating-chatbot-window .chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}

.floating-chatbot-window .chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #b1b1b1;
}

/* ============================================
   메시지 스타일 (플로팅 챗봇용 - #chatbotSection 외부)
   ============================================ */
.floating-chatbot-window .chat-message {
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    animation: fadeIn 0.3s ease;
    padding: 0 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-chatbot-window .chat-message.user {
    flex-direction: row-reverse;
}

/* 아바타 (플로팅 챗봇용) */
.floating-chatbot-window .message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.floating-chatbot-window .message-avatar.bot {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    font-weight: 600;
}

.floating-chatbot-window .message-avatar.user {
    background: #e8e8e8;
    color: #666;
}

/* 메시지 내용 (플로팅 챗봇용) */
.floating-chatbot-window .message-content {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.65;
    word-wrap: break-word;
    font-size: 15px;
}

.floating-chatbot-window .chat-message.bot .message-content {
    background: var(--chatbot-bot-bg);
    color: var(--chatbot-text);
    border-radius: 4px 16px 16px 16px;
}

.floating-chatbot-window .chat-message.user .message-content {
    background: var(--chatbot-user-bg);
    color: white;
    border-radius: 16px 4px 16px 16px;
}

/* ============================================
   웰컴 화면 (ChatGPT/Genspark 스타일)
   ============================================ */
.chatbot-welcome {
    text-align: center;
    padding: 30px 20px 40px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.chatbot-welcome h3 {
    color: var(--chatbot-text);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.chatbot-welcome p {
    color: var(--chatbot-text-muted);
    font-size: 17px;
    margin-bottom: 36px;
    font-weight: 400;
    line-height: 1.5;
}

/* 제안 버튼 그리드 (Genspark 스타일) */
.welcome-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.suggestion-btn {
    background: white;
    border: 1px solid var(--chatbot-border);
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 14px;
    color: var(--chatbot-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--chatbot-shadow);
}

.suggestion-btn:hover {
    border-color: var(--chatbot-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.suggestion-btn::before {
    content: '';
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   입력 영역 (Claude/ChatGPT 스타일)
   ============================================ */
.chatbot-input-area {
    padding: 20px 0;
    background: transparent;
    max-width: 800px;
    margin: 0 auto;
}

.chatbot-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--chatbot-border);
    border-radius: 24px;
    padding: 8px 8px 8px 24px;
    transition: all 0.2s ease;
    box-shadow: var(--chatbot-shadow);
}

.chatbot-input-wrapper:focus-within {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12), var(--chatbot-shadow);
}

.chatbot-input-wrapper input {
    flex: 1;
    padding: 12px 0;
    border: none;
    font-size: 15px;
    background: transparent;
    color: var(--chatbot-text);
}

.chatbot-input-wrapper input::placeholder {
    color: #999;
}

.chatbot-input-wrapper input:focus {
    outline: none;
}

.chatbot-send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn i {
    font-size: 14px;
}

/* ============================================
   로딩 인디케이터
   ============================================ */
.chat-loading {
    display: flex;
    gap: 6px;
    padding: 16px 18px;
    background: var(--chatbot-bot-bg);
    border-radius: 4px 16px 16px 16px;
    width: fit-content;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    animation: loadingPulse 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loadingPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   출처 표시
   ============================================ */
.message-sources {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.message-sources-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--chatbot-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    text-decoration: none;
    color: var(--chatbot-text);
    transition: all 0.2s;
}

.source-item:hover {
    border-color: var(--chatbot-primary);
    background: rgba(102, 126, 234, 0.04);
    transform: translateX(4px);
}

.source-icon {
    color: var(--chatbot-primary);
    font-size: 14px;
}

.source-visa-badge {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   FAQ 답변 스타일
   ============================================ */
.message-content.faq-answer {
    background: linear-gradient(135deg, #fafbff 0%, #f7f7f8 100%);
    border: 1px solid #e8ebf4;
    max-width: 85% !important;
    overflow: visible;
    border-radius: 4px 16px 16px 16px;
}

.message-content.faq-answer strong {
    color: var(--chatbot-primary);
    display: block;
    margin-bottom: 8px;
    margin-top: 16px;
    font-size: 1em;
    font-weight: 600;
}

.message-content.faq-answer strong:first-child {
    margin-top: 0;
}

.faq-link {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e8ebf4;
}

.faq-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--chatbot-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.faq-link a:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(4px);
}

.faq-link a i {
    font-size: 12px;
}

/* ============================================
   에러 메시지
   ============================================ */
.chat-error {
    background: #fef3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 14px 18px;
    border-radius: 12px;
    margin: 12px 0;
    font-size: 14px;
}

/* ============================================
   신뢰도 표시
   ============================================ */
.message-confidence {
    margin-top: 12px;
    font-size: 12px;
    color: var(--chatbot-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-bar {
    width: 80px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    transition: width 0.3s;
}

/* ============================================
   사용량 제한 메시지
   ============================================ */
.chat-usage-limit {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    color: white;
    animation: fadeIn 0.3s ease;
}

.usage-limit-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.usage-limit-icon i {
    font-size: 20px;
}

.usage-limit-content {
    flex: 1;
}

.usage-limit-content p {
    margin: 0 0 14px 0;
    font-size: 15px;
    line-height: 1.5;
}

.usage-limit-btn {
    background: white;
    color: var(--chatbot-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.usage-limit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   셋업 안내 메시지
   ============================================ */
.chatbot-setup-notice {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

.setup-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.setup-content {
    flex: 1;
}

.setup-content strong {
    display: block;
    font-size: 15px;
    color: #d97706;
    margin-bottom: 8px;
}

.setup-content p {
    font-size: 14px;
    color: var(--chatbot-text-muted);
    margin: 0;
    line-height: 1.6;
}

.setup-content code {
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
}

.setup-help {
    text-align: center;
    color: var(--chatbot-text-muted);
    font-size: 14px;
    margin-top: 16px;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 10px;
}

/* ============================================
   플로팅 챗봇 (다른 페이지용) - 비활성화
   ============================================ */
.floating-chatbot-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.35);
    transition: all 0.2s;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chatbot-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 32px rgba(102, 126, 234, 0.45);
}

.floating-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    max-height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--chatbot-shadow-lg);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-chatbot-window.active {
    display: flex;
}

.floating-chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floating-chatbot-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.floating-chatbot-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chatbot-close:hover {
    background: rgba(255,255,255,0.3);
}

.floating-chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chatbot-bg-dark);
    max-height: 400px;
}

.floating-chatbot-body .chatbot-welcome {
    padding: 10px 0;
}

.floating-chatbot-body .chatbot-welcome h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.floating-chatbot-body .chatbot-welcome p {
    font-size: 14px;
    margin-bottom: 16px;
}

.floating-chatbot-body .welcome-suggestions {
    grid-template-columns: 1fr;
    gap: 8px;
}

.floating-chatbot-body .suggestion-btn {
    padding: 12px 16px;
    font-size: 13px;
}

.floating-chatbot-body .message-content {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
}

.floating-chatbot-body .message-content.faq-answer {
    max-width: 95% !important;
    font-size: 13px;
}

.floating-chatbot-input {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.floating-chatbot-input .chatbot-input-wrapper {
    padding: 6px 6px 6px 16px;
}

.floating-chatbot-input .chatbot-input-wrapper input {
    padding: 10px 0;
    font-size: 14px;
}

.floating-chatbot-input .chatbot-send-btn {
    padding: 10px 18px;
    font-size: 13px;
    border-radius: 14px;
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
    .chatbot-section {
        padding: 15px 15px 30px 15px;
    }

    .chatbot-welcome {
        padding: 20px 15px 30px 15px;
    }

    .chatbot-welcome h3 {
        font-size: 26px;
    }

    .chatbot-welcome p {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .welcome-suggestions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .suggestion-btn {
        padding: 14px 16px;
        font-size: 14px;
    }

    .chatbot-messages {
        padding: 15px 0;
    }

    .chat-message {
        padding: 0 10px;
        gap: 12px;
    }

    .message-content {
        max-width: 82%;
        padding: 12px 16px;
        font-size: 14px;
    }

    .chatbot-input-area {
        padding: 16px 10px;
    }

    .chatbot-input-wrapper {
        padding: 6px 6px 6px 18px;
        border-radius: 20px;
    }

    .chatbot-input-wrapper input {
        padding: 10px 0;
        font-size: 14px;
    }

    .chatbot-send-btn {
        padding: 10px 18px;
        font-size: 13px;
        border-radius: 14px;
    }

    .chatbot-send-btn span {
        display: none;
    }

    .chatbot-send-btn i {
        margin: 0;
    }

    /* 플로팅 챗봇 모바일 */
    .floating-chatbot-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 85px;
        max-height: 500px;
    }

    .floating-chatbot-btn {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .chatbot-welcome h3 {
        font-size: 22px;
    }

    .chatbot-welcome p {
        font-size: 14px;
    }

    .message-content {
        max-width: 88%;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ============================================
   ChatGPT 스타일 메인 섹션
   ============================================ */
.chatgpt-main-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    padding-top: calc(72px + 40px);
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.chatgpt-main-section .container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 타이틀 */
.chatgpt-hero {
    text-align: center;
    margin-bottom: 28px;
}

.chatgpt-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.3px;
}

/* 입력창 컨테이너 */
.chatgpt-input-container {
    width: 100%;
    margin-bottom: 32px;
}

.chatgpt-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 28px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.chatgpt-input-wrapper:focus-within {
    border-color: var(--chatbot-primary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.chatgpt-input-wrapper input {
    flex: 1;
    padding: 14px 0;
    border: none;
    font-size: 16px;
    background: transparent;
    color: #1a1a1a;
}

.chatgpt-input-wrapper input::placeholder {
    color: #9ca3af;
}

.chatgpt-input-wrapper input:focus {
    outline: none;
}

.chatgpt-send-btn {
    width: 44px;
    height: 44px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatgpt-send-btn:hover {
    background: #333;
    transform: scale(1.05);
}

.chatgpt-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* 예시 질문 버튼 */
.chatgpt-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    margin-bottom: 36px;
}

.chatgpt-suggestion-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.5;
}

.chatgpt-suggestion-btn:hover {
    border-color: var(--chatbot-primary);
    background: rgba(102, 126, 234, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 목적 버튼 */
.chatgpt-purpose-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.chatgpt-purpose-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
}

.chatgpt-purpose-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.chatgpt-purpose-btn i {
    font-size: 16px;
}

/* 반응형 - ChatGPT 스타일 */
@media (max-width: 768px) {
    .chatgpt-main-section {
        min-height: calc(100vh - 60px);
        padding: 30px 16px 50px;
    }

    .chatgpt-title {
        font-size: 28px;
    }

    .chatgpt-input-wrapper {
        padding: 6px 6px 6px 18px;
    }

    .chatgpt-input-wrapper input {
        padding: 12px 0;
        font-size: 15px;
    }

    .chatgpt-send-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .chatgpt-suggestions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chatgpt-suggestion-btn {
        padding: 14px 16px;
        font-size: 13px;
    }

    .chatgpt-purpose-buttons {
        flex-direction: column;
        width: 100%;
    }

    .chatgpt-purpose-btn {
        justify-content: center;
        padding: 14px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .chatgpt-title {
        font-size: 24px;
    }

    .chatgpt-hero {
        margin-bottom: 30px;
    }
}

/* ============================================
   히어로 섹션 (원래 스타일)
   ============================================ */
.chatgpt-main-section .hero-content {
    text-align: center;
    margin-bottom: 32px;
}

.chatgpt-main-section .hero-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 16px 0;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.chatgpt-main-section .hero-title span {
    display: block;
}

.chatgpt-main-section .hero-title .gradient-text {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chatgpt-main-section .hero-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
    max-width: 550px;
    margin: 0 auto;
}

.chatgpt-main-section .hero-subtitle span {
    display: block;
}

/* ============================================
   목적 카드 스타일 (가로 3열 배치)
   ============================================ */
.chatgpt-purpose-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 900px;
}

.chatgpt-purpose-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chatgpt-purpose-card:hover {
    border-color: var(--chatbot-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.12);
}

.purpose-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.purpose-card-icon i {
    font-size: 20px;
    color: white;
}

.purpose-card-content {
    flex: 1;
}

.purpose-card-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.purpose-card-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* ============================================
   채팅 섹션 - 전체 화면 (Gemini 스타일)
   깔끔한 Flexbox 구조로 재작성
   ============================================ */

/* 채팅 모드일 때 body 스크롤 숨김 */
body.chat-mode {
    overflow: hidden;
    /* 스크롤바 사라질 때 레이아웃 이동 방지 */
    padding-right: 0 !important;
    margin-right: 0 !important;
}

/* 스크롤바 공간을 항상 확보하여 레이아웃 이동 방지 */
html {
    overflow-y: scroll;
}

/* ===== 화면 전환 애니메이션 ===== */
.chatgpt-main-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatgpt-main-section.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.chatgpt-main-section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 채팅 섹션 메인 컨테이너 ===== */
#chatbotSection.chatbot-section {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    bottom: 0;
    background-color: var(--gemini-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    isolation: isolate;
    font-family: 'Google Sans', 'Noto Sans KR', -apple-system, sans-serif;
}

#chatbotSection.chatbot-section.visible {
    opacity: 1;
    transform: translateY(0);
}

#chatbotSection.chatbot-section.fade-out {
    opacity: 0;
    transform: translateY(20px);
}

/* ===== 메시지 컨테이너 (스크롤 영역) - Gemini 스타일 ===== */
#chatbotSection .chatbot-messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--gemini-bg);
    padding-bottom: 20px;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}

/* 스크롤바 스타일 */
#chatbotSection .chatbot-messages-container::-webkit-scrollbar {
    width: 8px;
}

#chatbotSection .chatbot-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

#chatbotSection .chatbot-messages-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

#chatbotSection .chatbot-messages-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===== 채팅 메시지 목록 ===== */
#chatbotSection .chatbot-messages {
    width: 100%;
    padding: 24px 0 100px 0;
    margin: 0;
    background: transparent;
}

/* ===== 개별 메시지 - Gemini 스타일 ===== */
#chatbotSection .chat-message {
    display: block;
    width: 100%;
    padding: 24px 0;
    margin-bottom: 0;
    min-height: min-content;
    animation: geminiMessageFadeIn 0.3s ease forwards;
}

@keyframes geminiMessageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chatbotSection .chat-message.bot {
    background: transparent;
}

#chatbotSection .chat-message.user {
    background: transparent;
}

/* ===== 메시지 내부 레이아웃 - Gemini 스타일 ===== */
#chatbotSection .chat-message-inner {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    box-sizing: border-box;
}

/* 유저 메시지는 우측 정렬 */
#chatbotSection .chat-message.user .chat-message-inner {
    justify-content: flex-end;
}

/* ===== 아바타 - Gemini Sparkle 스타일 ===== */
#chatbotSection .message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: #e5e7eb;
}

#chatbotSection .message-avatar.bot {
    background: linear-gradient(135deg, var(--gemini-gradient-start), #9b72cb, var(--gemini-gradient-end));
    color: white;
}

#chatbotSection .message-avatar.user {
    display: none; /* Gemini 스타일: 유저 아바타 숨김 */
}

/* ===== 메시지 콘텐츠 - Gemini 스타일 가독성 ===== */
#chatbotSection .chat-message .message-content {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal; /* pre-wrap 제거 - HTML 태그가 줄바꿈 처리 */
}

/* Gemini 스타일: 유저 메시지는 알약 모양 말풍선 */
#chatbotSection .chat-message.user .message-content {
    background-color: var(--gemini-surface);
    color: var(--gemini-text-primary);
    padding: 12px 24px;
    border-radius: 24px 24px 4px 24px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 70%;
    flex: none;
    font-weight: 400;
}

/* ===== 텍스트 타이포그래피 ===== */
#chatbotSection .chat-message .message-content p {
    margin: 0 0 8px 0;
    padding: 0;
}

#chatbotSection .chat-message .message-content p:last-child {
    margin-bottom: 0;
}

#chatbotSection .chat-message.bot .message-content strong {
    font-weight: 600;
    color: #1f2937;
}

/* ===== 리스트 스타일 ===== */
#chatbotSection .chat-message.bot .message-content ul,
#chatbotSection .chat-message.bot .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

#chatbotSection .chat-message.bot .message-content ul {
    list-style-type: disc;
}

#chatbotSection .chat-message.bot .message-content ol {
    list-style-type: decimal;
}

#chatbotSection .chat-message.bot .message-content li {
    margin-bottom: 4px;
    line-height: 1.5;
    padding-left: 4px;
}

#chatbotSection .chat-message.bot .message-content li:last-child {
    margin-bottom: 0;
}

#chatbotSection .chat-message.bot .message-content li ul,
#chatbotSection .chat-message.bot .message-content li ol {
    margin-top: 6px;
    margin-bottom: 0;
}

/* ===== 헤딩 스타일 ===== */
#chatbotSection .chat-message.bot .message-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 16px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

#chatbotSection .chat-message.bot .message-content h3:first-child {
    margin-top: 0;
}

#chatbotSection .chat-message.bot .message-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 10px 0 4px 0;
}

#chatbotSection .chat-message.bot .message-content h4:first-child {
    margin-top: 0;
}

/* 이모지 렌더링 개선 */
#chatbotSection .chat-message.bot .message-content {
    font-family: 'Google Sans', 'Noto Sans KR', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', -apple-system, sans-serif;
}

/* 이모지 + 제목 섹션 스타일 (🚀 **창업 관련 비자**) */
#chatbotSection .chat-message.bot .message-content .section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 400;
    color: #1f2937;
    margin: 12px 0 4px 0;
    padding: 0;
}

#chatbotSection .chat-message.bot .message-content .section-title:first-child {
    margin-top: 0;
}

#chatbotSection .chat-message.bot .message-content .section-title strong {
    font-weight: 600;
}

/* 이모지 + 제목: 내용 인라인 스타일 (⏰ **처리 기간**: 약 2~4주) */
#chatbotSection .chat-message.bot .message-content .info-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #1f2937;
    margin: 8px 0;
    padding: 0;
}

#chatbotSection .chat-message.bot .message-content .info-line strong {
    font-weight: 600;
}

/* ===== 코드 스타일 ===== */
#chatbotSection .chat-message.bot .message-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: #e11d48;
}

/* ===== 링크 스타일 ===== */
#chatbotSection .chat-message.bot .message-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

#chatbotSection .chat-message.bot .message-content a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ===== 인용구 스타일 ===== */
#chatbotSection .chat-message.bot .message-content blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 4px solid #4285f4;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-style: italic;
}

/* ===== 구분선 ===== */
#chatbotSection .chat-message.bot .message-content hr {
    border: none;
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

/* ===== 타이핑 효과 ===== */
.typing-content {
    min-height: 1.5em;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    display: block;
}

/* 타이핑 중 블록 요소들이 제대로 표시되도록 */
.typing-content > * {
    display: block;
    margin-bottom: 8px;
}

.typing-content > p {
    margin: 0 0 8px 0;
}

.typing-content > p.section-title {
    font-size: 14px;
    margin: 12px 0 4px 0;
}

.typing-content > p.info-line {
    font-size: 14px;
    margin: 8px 0;
}

.typing-content > ul,
.typing-content > ol {
    margin: 8px 0;
    padding-left: 20px;
}

.typing-content > ul {
    list-style-type: disc;
}

.typing-content > ol {
    list-style-type: decimal;
}

.typing-content li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.typing-content > h3,
.typing-content > h4 {
    margin: 12px 0 6px 0;
}

.typing-content > br {
    display: block;
    content: "";
    margin-top: 8px;
}

/* ===== 출처 표시 애니메이션 ===== */
.sources-container {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sources-container.fade-in-sources {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Gemini 스타일 Shimmer 로딩 애니메이션 ===== */
.gemini-shimmer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.shimmer-line {
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f4f9 25%, #e1e5ea 50%, #f0f4f9 75%);
    background-size: 200% 100%;
    animation: shimmerAnimation 1.5s infinite;
}

@keyframes shimmerAnimation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 타이핑 활성화 상태 (커서 깜빡임) */
.typing-active::after {
    content: '|';
    animation: cursorBlink 0.7s infinite;
    color: var(--gemini-text-secondary);
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== 하단 입력창 - Gemini 스타일 (플로팅 알약) ===== */
#chatbotSection .chatbot-input-fixed {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    background: var(--gemini-bg);
    border-top: none;
    padding: 20px;
    box-sizing: border-box;
}

#chatbotSection .chatbot-input-fixed .container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

#chatbotSection .chatbot-input-fixed .chatbot-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--gemini-surface);
    border: 1px solid transparent;
    border-radius: 36px;
    padding: 10px 10px 10px 24px;
    transition: all 0.3s ease;
    box-shadow: none;
}

#chatbotSection .chatbot-input-fixed .chatbot-input-wrapper:focus-within {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#chatbotSection .chatbot-input-fixed .chatbot-input-wrapper input {
    flex: 1;
    padding: 8px 0;
    border: none;
    font-size: 16px;
    background: transparent;
    color: var(--gemini-text-primary);
}

#chatbotSection .chatbot-input-fixed .chatbot-input-wrapper input::placeholder {
    color: #8e918f;
}

#chatbotSection .chatbot-input-fixed .chatbot-input-wrapper input:focus {
    outline: none;
}

#chatbotSection .chatbot-input-fixed .chatbot-send-btn {
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#chatbotSection .chatbot-input-fixed .chatbot-send-btn:hover {
    background: #333;
    transform: scale(1.05);
}

#chatbotSection .chatbot-input-fixed .chatbot-send-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* ===== FAQ 답변 스타일 ===== */
#chatbotSection .message-content.faq-answer {
    background: transparent;
    border: none;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 768px) {
    .chatgpt-main-section {
        padding: 30px 16px 50px;
        padding-top: calc(72px + 30px);
    }

    .chatgpt-main-section .hero-title {
        font-size: 28px;
    }

    .chatgpt-main-section .hero-subtitle {
        font-size: 14px;
    }

    .chatgpt-title {
        font-size: 24px;
    }

    .chatgpt-purpose-cards {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .chatgpt-purpose-card {
        flex-direction: row;
        text-align: left;
        padding: 16px 20px;
    }

    .purpose-card-icon {
        width: 44px;
        height: 44px;
    }

    .purpose-card-icon i {
        font-size: 18px;
    }

    .purpose-card-content h3 {
        font-size: 14px;
    }

    /* 채팅 섹션 */
    #chatbotSection .chat-message {
        padding: 20px 0;
    }

    #chatbotSection .chat-message-inner {
        padding: 0 16px;
        gap: 12px;
    }

    #chatbotSection .chatbot-messages {
        padding: 20px 0 80px 0;
    }

    #chatbotSection .message-avatar {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 12px;
    }

    #chatbotSection .chatbot-input-fixed {
        padding: 16px;
    }

    #chatbotSection .chatbot-input-fixed .chatbot-input-wrapper {
        padding: 4px 4px 4px 16px;
        border-radius: 20px;
    }

    #chatbotSection .chatbot-input-fixed .chatbot-send-btn {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .chatgpt-main-section {
        padding: 20px 16px 40px;
        padding-top: calc(72px + 20px);
    }

    .chatgpt-main-section .hero-content {
        margin-bottom: 24px;
    }

    .chatgpt-main-section .hero-title {
        font-size: 24px;
    }

    .chatgpt-main-section .hero-subtitle {
        font-size: 13px;
    }

    .chatgpt-title {
        font-size: 20px;
    }

    .chatgpt-hero {
        margin-bottom: 20px;
    }

    .purpose-card-content h3 {
        font-size: 13px;
    }

    .purpose-card-content p {
        font-size: 11px;
    }

    /* 채팅 섹션 */
    #chatbotSection .chat-message {
        padding: 16px 0;
    }

    #chatbotSection .chat-message-inner {
        padding: 0 12px;
        gap: 10px;
    }

    #chatbotSection .chat-message .message-content {
        font-size: 14px;
        line-height: 1.5;
    }

    #chatbotSection .message-avatar {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 11px;
    }

    #chatbotSection .chatbot-input-fixed {
        padding: 12px;
    }

    #chatbotSection .chatbot-input-fixed .chatbot-input-wrapper input {
        font-size: 15px;
        padding: 10px 8px;
    }
}
