@charset "utf-8";
/* =========================================
   방명록(CHAT) 전용 스타일
   ========================================= */
.center .g-maincon {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;

  /* 배경 이미지 한 장 */
  background-image: url("../img/mbg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}


/* 🌟 채팅창 넓이 제한 & 중앙 정렬 마법 */
.chat-wrap {
  width: 100%;
  margin: 0 auto;   /* 좌우 여백을 자동으로 나눠가져서 완벽한 중앙 정렬 */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 20px; text-align: center; font-size: 1.25rem; font-weight: 600;
}

#chat-display {
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 24px max(24px, calc((100% - 900px) / 2));

  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;

  scrollbar-gutter: stable;
}

.bot-bubble {
  background-color: #fff; 
  border: 1.5px solid #e3e3e3;
  font-size: 0.95rem;
  padding: 16px 24px;
  border-radius: 24px; border-bottom-left-radius: 4px; max-width: 80%;
  align-self: flex-start; line-height: 1.6;
}

.my-message-wrapper {
  align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end;
  max-width: 80%; animation: fadeIn 0.3s ease-out;
}

.message-bubble {
  background-color: #ffffff; padding: 16px 24px;
  border-radius: 24px; border-bottom-right-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6; box-shadow: 0 2px 4px rgba(0,0,0,0.05);

   /* 랜덤 색상이 적용될 테두리 */
  border: 1.5px solid #a0c16c;
  box-sizing: border-box;
}

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

/* 입력창 바깥 영역 */
#input-container {
  padding: 20px 24px;
  background: transparent;
  box-sizing: border-box;
}

/* 입력창 기본 구조 */
.input-wrapper {
  --radius: 32px;

  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 16px;
  box-sizing: border-box;

  background: #fff;
  border: 1.5px solid transparent;
  border-radius: var(--radius);

  /* 흰색 내부와 컬러 테두리 */
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(
      120deg,
      #a0c16c,
      #8ac9dd,
      #f6b455,
      #f79531,
      #f385a2,
      #cda0ca,
      #a0c16c
    ) border-box;

  background-size: 100% 100%, 300% 300%;
  animation: aurora-border 8s ease infinite;

  transition: box-shadow 0.4s ease;
}

/* 오로라처럼 컬러가 흐르는 테두리 */
@keyframes aurora-border {
  0% {
    background-position: 0% 50%, 0% 50%;
  }
  50% {
    background-position: 0% 50%, 100% 50%;
  }
  100% {
    background-position: 0% 50%, 0% 50%;
  }
}

/* 입력 중: 은은한 컬러 광채 */
.input-wrapper:focus-within {
  box-shadow:
    0 0 8px rgba(138, 201, 221, 0.18),
    0 0 20px rgba(205, 160, 202, 0.12);
}

/* 입력 텍스트 */
#text-input {
  flex-grow: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 8px;
  font-size: 0.95rem;
  outline: none;
  color: #333;
}

#text-input::placeholder {
  color: #999;
}

/* 전송 버튼 */
#submit-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;
  padding: 0;

  color: #8ac9dd;
  background: transparent;
  border: 1.5px solid #8ac9dd;
  border-radius: 50%;

  cursor: pointer;
  transition:
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease;
}

/* 버튼에 마우스를 올리면 포스터 컬러로 변화 */
#submit-btn:hover {
  color: #cda0ca;
  border-color: #cda0ca;
  box-shadow: 0 0 12px rgba(205, 160, 202, 0.25);
}

#submit-btn:active {
  transform: scale(0.94);
}

/* 모션 최소화 설정을 사용하는 방문자 배려 */
@media (prefers-reduced-motion: reduce) {
  .input-wrapper {
    animation: none;
  }

  #submit-btn,
  .input-wrapper {
    transition: none;
  }
}

/* 모바일 */
@media (max-width: 600px) {
  #input-container {
    padding: 16px;
  }

  .input-wrapper {
    padding: 6px 10px;
  }
}



.message-time {
  font-size: 0.7rem;        /* 아주 작은 글씨 */
  color: #999;              /* 연한 회색 */
  margin-top: 4px;          /* 말풍선과의 간격 */
  margin-right: 4px;        /* 우측 정렬 시 미세 여백 */
  align-self: flex-end;     /* 오른쪽 정렬 */
}
.center .footer-g {
  padding: 20px 0;
  text-align: center;
  font-size: 0.8rem;
  color: #333;
}
.center .footer-g u{
  text-decoration: underline;    
  text-decoration-style: dotted;  
  text-decoration-color: #333;    
  text-underline-offset: 4px;
}

/* =========================
   GUEST 모바일 반응형
========================= */

@media (max-width: 768px) {
  /* 방명록 메인 영역 */
  .center .g-maincon {
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    background-size: cover;
    background-position: center;
  }

  .chat-wrap {
    width: 100%;
    min-width: 0;
    min-height: 0;
  }

  /* 채팅 상단 */
  .chat-header {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 1rem;
  }

  /* 채팅 메시지 영역 */
  #chat-display {
    min-height: 0;
    padding: 20px 16px;
    gap: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  #chat-display::-webkit-scrollbar {
    display: none;
  }

  /* 안내 메시지 */
  .bot-bubble {
    max-width: 90%;
    box-sizing: border-box;
    padding: 13px 16px;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  /* 내가 작성한 메시지 */
  .my-message-wrapper {
    max-width: 90%;
    min-width: 0;
  }

  .message-bubble {
    max-width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .message-time {
    margin-top: 5px;
    font-size: 10px;
  }

  /* 메시지 입력창 */
  #input-container {
    flex-shrink: 0;
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
    background: rgba(250, 250, 250, 0.88);
  }

  .input-wrapper {
    width: 100%;
    max-width: none;
    gap: 6px;
    padding: 5px 8px 5px 12px;
    box-sizing: border-box;
  }

  #text-input {
    width: 0;
    min-width: 0;
    padding: 10px 2px;
    font-size: 14px;
  }

  #text-input::placeholder {
    font-size: 12px;
  }

  #submit-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
  }


  center .footer-g {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    color: #fff;
    background-color: #000;
}
}

/* 작은 휴대폰 */
@media (max-width: 380px) {
  #chat-display {
    padding: 16px 12px;
  }

  .bot-bubble,
  .message-bubble {
    padding: 11px 13px;
    font-size: 13px;
  }

  #input-container {
    padding: 10px;
  }

  #text-input::placeholder {
    font-size: 11px;
  }
  .center .footer-g {
    flex-shrink: 0;
    padding: 12px;
    font-size: 10px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    box-sizing: border-box;
  }
}