/* ========== Component 7: AI Chat with Gemini ========== */
.section-main07 {
  position: relative;
  z-index: 10;
  background: #fff;
  padding: 80px 20px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.section-main07 .main_re_container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  font-family: 'pretendard', sans-serif;
}

.section-main07 .main_re_container .sec-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-main07 .main_re_container .title-container {
  margin-bottom: 20px;
}

.section-main07 .main_re_container .title-container h2 {
  font-size: 36px;
  font-weight: 600;
  color: #222222;
  margin-bottom: 10px;
}

.section-main07 .main_re_container .title-container p {
  font-size: 20px;
  font-weight: 400;
  color: #555555;
  margin: 0;
}

/* AI 채팅 콘텐츠 래퍼 */
.ai-chat-content-wrapper {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* 왼쪽 액션 버튼 영역 */
.chat-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 40%;
  height: 600px;
  box-sizing: border-box;
}

.action-box {
  display: flex;
  flex-direction: column;
  padding: 40px 30px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  font-family: 'pretendard', sans-serif;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  flex: 1;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.action-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 16px;
  z-index: 0;
}

.action-box > * {
  position: relative;
  z-index: 1;
}

.action-box-1::before {
  background-image: url('../images/renewal/ai_bg01.png');
}

.action-box-2::before {
  background-image: url('../images/renewal/ai_bg02.png');
}

.action-box .box-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px 0;
  font-family: 'pretendard', sans-serif;
}

.action-box .box-text {
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  line-height: 1.8;
  margin: 0 0 8px 0;
}

.action-box .box-tagline {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  text-align: left;
  text-transform: uppercase;
  font-family: 'pretendard', sans-serif;
  margin-top: 20px;
  margin-bottom: 0;
}

/* 채팅창 컨테이너 */
.chat-container {
  flex: 1;
  width: 60%;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  box-sizing: border-box;
}

.chat-container.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

/* 채팅 헤더 */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #ffaa00;
  color: #fff;
  border-radius: 20px 20px 0 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-avatar svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.chat-title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.chat-title p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: none; /* 채팅창을 항상 열어두므로 닫기 버튼 숨김 */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.chat-close-btn svg {
  width: 20px;
  height: 20px;
}

/* 메시지 영역 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot-message {
  justify-content: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  background: #ffaa00;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.message-avatar svg {
  width: 20px;
  height: 20px;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bot-message .message-content {
  background: #fff;
  border: 1px solid #e9ecef;
}

.user-message .message-content {
  background: #ffaa00;
  color: #fff;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.user-message .message-content p {
  color: #fff;
}

.message-content ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  color: #555;
}

.message-content li {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.5;
}

/* 입력 영역 */
.chat-input-container {
  padding: 20px 24px;
  background: #fff;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 20px 20px;
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  font-size: 14px;
  font-family: 'pretendard', sans-serif;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input:focus {
  border-color: #ffaa00;
  box-shadow: 0 0 0 3px rgba(255, 170, 0, 0.1);
}

.chat-input:disabled {
  background: #f8f9fa;
  cursor: not-allowed;
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  background: #ffaa00;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 170, 0, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
}

/* 로딩 상태 */
.chat-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 12px;
  font-size: 13px;
  color: #666;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: #ffaa00;
  border-radius: 50%;
  animation: loadingDot 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loadingDot {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 반응형 */
@media (max-width: 1400px) {
  .section-main07 {
    padding: 60px 20px;
  }

  .ai-chat-content-wrapper {
    gap: 18px;
  }

  .chat-action-buttons {
    width: 38%;
  }

  .chat-container {
    width: 62%;
    max-width: 100%;
  }
}

@media (max-width: 1024px) {
  .section-main07 {
    padding: 50px 15px;
  }

  .section-main07 .main_re_container .title-container {
    margin-bottom: 30px;
  }

  .section-main07 .main_re_container .title-container h2 {
    font-size: 32px;
  }

  .section-main07 .main_re_container .title-container p {
    font-size: 18px;
  }

  .ai-chat-content-wrapper {
    flex-direction: column;
    gap: 20px;
  }

  .chat-action-buttons {
    flex-direction: column;
    width: 100%;
    height: auto;
    gap: 12px;
  }

  .action-box {
    flex: none;
    width: 100%;
    min-height: 200px;
    padding: 35px 25px;
  }

  .action-box .box-title {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .action-box .box-text {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
  }

  .action-box .box-tagline {
    font-size: 22px;
    margin-top: 16px;
  }

  .chat-container {
    width: 100%;
    height: 500px;
  }

  .chat-header {
    padding: 16px 20px;
  }

  .chat-title h3 {
    font-size: 18px;
  }

  .chat-title p {
    font-size: 13px;
  }

  .chat-messages {
    padding: 18px;
  }

  .message-content {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
  }

  .chat-input-container {
    padding: 16px 20px;
  }

  .chat-input {
    padding: 12px 16px;
    font-size: 14px;
  }

  .chat-send-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 768px) {
  .section-main07 {
    padding: 40px 15px;
  }

  .section-main07 .main_re_container .title-container {
    margin-bottom: 30px;
  }

  .section-main07 .main_re_container .title-container h2 {
    font-size: 28px;
  }

  .section-main07 .main_re_container .title-container p {
    font-size: 16px;
  }

  .ai-chat-content-wrapper {
    flex-direction: column;
    gap: 20px;
  }

  .chat-action-buttons {
    flex-direction: column;
    width: 100%;
    height: auto;
    gap: 12px;
  }

  .action-box {
    flex: none;
    width: 100%;
    min-height: 200px;
    padding: 30px 20px;
  }

  .action-box .box-title {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .action-box .box-text {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
  }

  .action-box .box-tagline {
    font-size: 18px;
    margin-top: 16px;
  }

  .chat-container {
    width: 100%;
    height: 500px;
  }

  .chat-header {
    padding: 16px 20px;
  }

  .chat-title h3 {
    font-size: 16px;
  }

  .chat-title p {
    font-size: 12px;
  }

  .chat-messages {
    padding: 16px;
  }

  .message-content {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
  }

  .chat-input-container {
    padding: 16px 20px;
  }

  .chat-input {
    padding: 12px 16px;
    font-size: 14px;
  }

  .chat-send-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .section-main07 {
    padding: 30px 10px;
  }

  .section-main07 .main_re_container .title-container {
    margin-bottom: 20px;
  }

  .section-main07 .main_re_container .title-container h2 {
    font-size: 24px;
  }

  .section-main07 .main_re_container .title-container p {
    font-size: 14px;
  }

  .ai-chat-content-wrapper {
    gap: 15px;
  }

  .chat-action-buttons {
    gap: 10px;
    height: auto;
  }

  .action-box {
    padding: 24px 16px;
    min-height: 180px;
  }

  .action-box .box-title {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .action-box .box-text {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 6px;
  }

  .action-box .box-tagline {
    font-size: 16px;
    letter-spacing: 0.5px;
    margin-top: 12px;
  }

  .chat-container {
    height: 450px;
    border-radius: 15px;
  }

  .chat-header {
    border-radius: 15px 15px 0 0;
    padding: 12px 16px;
  }

  .chat-avatar {
    width: 36px;
    height: 36px;
  }

  .chat-avatar svg {
    width: 20px;
    height: 20px;
  }

  .chat-title h3 {
    font-size: 16px;
  }

  .chat-title p {
    font-size: 11px;
  }

  .chat-messages {
    padding: 12px;
  }

  .message {
    margin-bottom: 12px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
  }

  .message-avatar svg {
    width: 18px;
    height: 18px;
  }

  .message-content {
    max-width: 90%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
  }

  .chat-input-container {
    padding: 12px 16px;
  }

  .chat-input {
    padding: 10px 14px;
    font-size: 13px;
  }

  .chat-send-btn {
    width: 40px;
    height: 40px;
  }

  .chat-send-btn svg {
    width: 18px;
    height: 18px;
  }

  .chat-loading {
    padding: 8px 0;
    font-size: 12px;
  }

  .loading-dots {
    width: 32px;
    height: 8px;
  }

  .loading-dots span {
    width: 6px;
    height: 6px;
  }
}
