/* ==================== 기본 설정 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 컬러 */
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary: #ff8c42;
    --gradient: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    
    --success: #ff6b35;
    --warning: #ff8c42;
    --error: #ef4444;
    
    /* 간격 */
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    
    /* 그림자 */
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(16, 185, 129, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hidden {
    display: none !important;
}

/* ==================== 챗봇 아이콘 ==================== */
.chatbot-icon {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transition: all 0.3s ease;
}

.chatbot-icon:hover {
    transform: scale(1.1);
}

.chatbot-icon i {
    z-index: 2;
}

/* 펄스 애니메이션 */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ==================== 챗봇 윈도우 ==================== */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 650px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    animation: slideUp 0.3s ease-out;
}

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

/* ==================== 헤더 ==================== */
.chatbot-header {
    background: var(--gradient);
    color: white;
    padding: var(--space-4);
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.bot-avatar-small {
    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;
}

.header-info h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.status-online {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

.status-online i {
    font-size: 8px;
    color: #fbbf24;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* 언어 선택 버튼 */
.language-selector {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 20px;
}

.lang-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ==================== 검색 영역 ==================== */
.search-container {
    padding: var(--space-4);
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 20px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ==================== FAQ 리스트 ==================== */
.faq-list-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    background: var(--gray-50);
}

.faq-list-container::-webkit-scrollbar {
    width: 6px;
}

.faq-list-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: var(--space-3);
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.faq-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.faq-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.5;
}

.faq-arrow {
    flex-shrink: 0;
    color: var(--gray-400);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.faq-item:hover .faq-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* ==================== FAQ 상세 ==================== */
.faq-detail-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    background: var(--gray-50);
}

.faq-detail-container::-webkit-scrollbar {
    width: 6px;
}

.faq-detail-container::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.back-button {
    background: white;
    border: none;
    color: var(--primary);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: var(--space-4);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.back-button:hover {
    background: var(--gray-100);
    transform: translateX(-4px);
}

.faq-detail-header {
    background: white;
    padding: var(--space-6);
    border-radius: 16px;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.faq-detail-number {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.faq-detail-question {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.5;
}

.faq-detail-answer {
    background: white;
    padding: var(--space-6);
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-600);
    box-shadow: var(--shadow-sm);
}

/* ==================== 모바일 반응형 ==================== */
@media (max-width: 640px) {
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .chatbot-icon {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }

    .chatbot-header {
        border-radius: 0;
    }

    .language-selector {
        display: none; /* 모바일에서는 언어 선택 숨김 */
    }
}

/* ==================== 유틸리티 ==================== */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mt-4 {
    margin-top: var(--space-4);
}
