/* ai_search.css */
/* --- AI Search Assistant Box --- */
.ai-assistant-box {
    border: 1px solid var(--secondary); /* 초기 보더는 투명하게 */
    /* border-image: linear-gradient(to right, var(--primary), var(--secondary)) 1; */
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-shadow: var(--box-shadow-light);
    background-color: var(--wht);
    position: relative; /* 자식 요소 위치 기준 */
    overflow: hidden; /* 리플 효과를 위해 */
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 15px;
    color: var(--blk);
}

.ai-badge {
    background: var(--gradient-blue-green);
    color: var(--wht);
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.bold { font-weight: 700; }

.desc {
    color: var(--gray500);
    font-size: 14px;
}

.ai-ip-box {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 15px;
}

.ai-cloud {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.ai-input-box {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: var(--gray50);
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    border: 1px solid var(--gray100);
    position: relative; /* 알림 및 기타 요소 포지셔닝 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 135, 250, 0.2);
}

.ai-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--blk);
    outline: none;
    padding: 0;
}

.ai-input::placeholder {
    color: var(--gray300);
}


/* --- AI Search Button (Enhanced) --- */
.ai-search-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative; 
    overflow: hidden; 
    transition: box-shadow 0.3s ease, transform 0.3s ease, filter 0.3s ease;
    will-change: transform, box-shadow; /* GPU 가속 힌트 */
}

/* GSAP & Lottie 연동을 위한 호버/포커스 스타일 */
.ai-search-btn:hover,
.ai-search-btn:focus {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(25, 135, 250, 0.4); /* Glow 효과 */
    outline: none;
}

/* 로딩 중 스타일 */
.ai-search-btn.loading {
    pointer-events: none; /* 클릭 방지 */
    filter: saturate(0.5); /* 채도 감소로 비활성 느낌 */
    box-shadow: 0 0 20px rgba(25, 135, 250, 0.5); /* 로딩 중 Glow 효과 */
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 8px rgba(25, 135, 250, 0.3); }
    50% { box-shadow: 0 0 20px rgba(25, 135, 250, 0.6); }
    100% { box-shadow: 0 0 8px rgba(25, 135, 250, 0.3); }
}

/* 리플(Ripple) 효과를 위한 가상 요소 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple-effect 0.7s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* --- AI Tags Animation Styles (수정됨) --- */
.ai-tags {
    background: #e9f5ff;
    font-size: 14px;
    color: var(--primary);
    /* padding: 0 15px; */
    border-radius: var(--border-radius);
    text-align: left;
    flex-shrink: 0;
    
    /* [수정] 너비를 조정하고 테두리를 추가하여 디자인 개선 */
    width: 120px;
    white-space: nowrap;
    border: 1px solid #d4e9ff;

    /* 애니메이션을 위한 스타일 추가 */
    height:32px; /* 한 줄 높이 고정 */
    overflow: hidden; /* 넘치는 자식 요소 숨김 */
    position: relative;
}

.tag-wrapper {
    position: absolute;

    top: 0;
    left: 15px; /* padding-left와 동일하게 */
    right: 15px; /* padding-right와 동일하게 */
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: center; /* 한 줄씩 차지하도록 */
    height: 24px;
    margin: 2px;
}


/* --- AI Notification Styles --- */
.ai-notification {
    position: absolute;
    bottom: calc(100% + 5px); /* 입력창 바로 위에 표시 */
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--wht);
    box-shadow: var(--box-shadow-medium);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.ai-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -5px); /* 살짝 위로 이동 */
}

.ai-notification.warning {
    background-color: #ff9800; /* 주황색 경고 */
}
.ai-notification.error {
    background-color: #e53935; /* 붉은색 에러 */
}
.ai-notification.success {
    background-color: #43a047; /* 초록색 성공 */
}

/* --- Responsive Adjustments for AI Search & Modal --- */
@media (max-width: 1023px) {
    .ai-assistant-box { padding: 15px; }
    .ai-ip-box { flex-direction: column; align-items: stretch; gap: 10px; }
    .ai-cloud { display: none; } 
    .ai-input-box { width: 100%; padding: 10px 15px; }
    .ai-input { font-size: 14px; }
    .ai-search-btn { width: 35px; height: 35px; }
    .ai-tags { margin-top: 10px; width: 100%; text-align: center; }
    .tag-wrapper { left: 0; right: 0; text-align: center; } /* 모바일에서 태그 중앙 정렬 */
    .ai-header { flex-direction: column; align-items: flex-start; gap: 5px; }
    .ai-notification {
        width: 90%;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .ai-assistant-box { padding: 10px; }
    .ai-cloud { display: none; } /* 모바일에서는 구름 아이콘 숨김 */
    .ai-input-box { padding: 8px 12px; }
    .ai-input { font-size: 13px; }
    .ai-search-btn { width: 32px; height: 32px; }
    .ai-header { font-size: 13px; }
    .ai-badge { font-size: 11px; padding: 3px 8px; }
    .ai-tags { font-size: 11px; padding: 6px 10px; }
}

@media (max-width: 480px) {
    .ai-input { font-size: 12px; }
}

/* ── EZ AIR product polish: understood trip context ─────────────────────── */
.ai-intent-preview {
    display: none;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 12px;
    padding-left: 85px;
}

.ai-intent-preview.show {
    display: flex;
}

.ai-intent-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(25, 135, 250, 0.16);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(25, 135, 250, 0.07), rgba(16, 194, 160, 0.08));
    color: var(--gray700);
    font-size: 12px;
    line-height: 1;
}

.ai-intent-chip-label {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.ai-intent-chip strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--blk);
}

@media (max-width: 1023px) {
    .ai-intent-preview {
        padding-left: 0;
        margin-top: 8px;
    }
}

@media (max-width: 640px) {
    .ai-intent-preview {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .ai-intent-preview::-webkit-scrollbar { display: none; }
    .ai-intent-chip { flex: 0 0 auto; }
}
