@font-face {
  font-family: 'GmarketSansMedium';
  src: url('https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/GmarketSansTTFMedium.ttf?v=1743418188655') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* 기본 스타일 (body에는 GmarketSansMedium 폰트를 사용) */
body {
  font-family: 'GmarketSansMedium', Arial, sans-serif;
  background-color: #f8f9fa;
  color: #000;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px;
  position: relative;
}
body.dark-mode {
  background-color: #181818;
  color: #e0e0e0;
}

/* 상단 우측 버튼 */
#top-right-buttons {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}
#top-right-buttons button {
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background-color: #f39c12;
  color: #fff;
  font-size: 14px;
}
body.dark-mode #top-right-buttons button {
  background-color: #2b2b2b;
}

/* 중앙 컨테이너 */
.center-container {
  width: 80%;
  max-width: 800px;
  margin: auto;
  text-align: center;
  padding: 20px;
  min-height: 300px;
}

/* 입력 섹션 및 안내 */
.input-section,
.announcement,
.info-message {
  margin: 20px 0;
}
.input-wrapper {
  position: relative;
}
/* 키워드 입력 칸 */
#question-input {
  width: 80%;
  min-height: 60px;
  padding: 20px;
  font-size: 24px;
  border-radius: 25px;
  border: 1px solid #ccc;
  outline: none;
  box-sizing: border-box;
}
#clear-button {
  padding: 10px;
  background-color: #f44336;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 10px;
  font-size: 16px;
}
#clear-button:hover {
  background-color: #d32f2f;
}
body.dark-mode #clear-button {
  background-color: #333;
}
.info-message,
.announcement {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 5px;
}
body.dark-mode .info-message,
body.dark-mode .announcement {
  background-color: #2c2c2c;
  border-color: #444;
  color: #e0e0e0;
}

/* 정답 복사 알림 */
.copy-result-message {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  text-align: center;
  font-weight: bold;
  color: #d8000c;
  background-color: #ffbaba;
  padding: 5px 0;
  border-radius: 5px;
  display: none;
}

/* 검색 결과 */
#question-container {
  width: 100%;
  text-align: left;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 10px;
}
body.dark-mode #question-container {
  background-color: #2c2c2c;
}
.result-item {
  padding: 10px;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.2s;
}
.result-item:hover {
  background-color: #f0f0f0;
}
.result-item p {
  font-size: 19px;
  margin: 5px 0;
  font-weight: normal;
  color: inherit;
}
.highlight {
  background-color: #a8e6cf;
  font-weight: bold;
}
body.dark-mode .highlight {
  background-color: #2d9cdb;
}
#question-container, #question-container * {
  font-family: initial;
}
.answer-highlight {
  font-weight: bold;
  color: red;
  transition: all 0.3s ease;
}
.answer-highlight:hover {
  color: darkred;
  background-color: #ffe6e6;
  border-radius: 5px;
  padding: 2px 4px;
}
.result-count {
  color: red;
  font-weight: bold;
  margin-top: 20px;
}

/* By. 사과 스타일 */
.by-사과,
.by-사과-main {
  color: #D8BFD8;
  font-weight: normal;
  text-align: right;
}

/* 경험치바 */
.exp-bar-container {
  margin-top: 10px;
}
.exp-bar {
  width: 100%;
  background-color: #ddd;
  border-radius: 5px;
  overflow: hidden;
  height: 20px;
  margin-bottom: 5px;
  position: relative;
}
.exp-bar-fill {
  height: 100%;
  background-color: #4caf50;
  text-align: center;
  line-height: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

/* 예상 시간 영역 */
#expected-time {
  margin-top: 10px;
  font-weight: bold;
}

/* 작은 입력창 */
.small-input {
  width: 50px;
}

/* 계산 버튼들 */
button#calculate-btn,
button#reset-exp-btn,
button#cybermoney-btn,
button#reset-cyber-btn,
button#level-calc-btn,
button#level-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  min-width: 80px;
  padding: 0 16px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 5px;
  box-sizing: border-box;
}
button#calculate-btn,
button#cybermoney-btn,
button#level-calc-btn {
  background-color: #ff9999;
  color: #fff;
}
button#calculate-btn:hover,
button#cybermoney-btn:hover,
button#level-calc-btn:hover {
  background-color: #ff6666;
}
button#reset-exp-btn,
button#reset-cyber-btn,
button#level-reset-btn {
  background-color: #888;
  color: #fff;
}
button#reset-exp-btn:hover,
button#reset-cyber-btn:hover,
button#level-reset-btn:hover {
  background-color: #666;
}

/* 하단 재생바 */
.bottom-player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 50px;
  background-color: #f8f9fa;
  color: #000;
  box-shadow: none;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.3s ease;
}
body.dark-mode .bottom-player {
  background-color: #181818;
  color: #e0e0e0;
}

/* collapsed 상태(접힘) */
.bottom-player.collapsed {
  height: 50px;
  overflow: hidden;
}
.bottom-player.collapsed .progress-container {
  display: none;
}

/* 음악 컨트롤 (펼친 상태) */
.player-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 0 20px;
  flex: 1;
}
.bottom-player.collapsed .player-main > :not(.extra-controls) {
  display: none !important;
}
.bottom-player.collapsed .player-main .extra-controls > :not(#musicbar-toggle-btn) {
  display: none !important;
}
.bottom-player.collapsed #musicbar-toggle-btn img {
  transform: rotate(180deg);
}

/* 하단 재생바 내부 요소 (progress container 등) */
.progress-container {
  width: 100%;
  height: 8px;
  background-color: #ddd;
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}
.progress-container input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: #ddd;
  border-radius: 1.5px;
  outline: none;
  margin: 0;
  padding: 0;
}
.progress-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #ff0000;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  border: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.progress-container input[type="range"]::-webkit-slider-thumb:hover {
  background: #cc0000;
  transform: scale(1.1);
}
.progress-container input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #ff0000;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.progress-container input[type="range"]::-moz-range-thumb:hover {
  background: #cc0000;
  transform: scale(1.1);
}
.progress-tooltip {
  position: absolute;
  background-color: rgba(0,0,0,0.7);
  color: #fff;
  padding: 2px 4px;
  font-size: 12px;
  border-radius: 3px;
  pointer-events: none;
  display: none;
}

/* 음악바 아이템들 */
.player-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.duration-info {
  font-size: 14px;
}
.volume-controls input {
  width: 80px;
}

/* 재생목록 모달 */
.playlist-modal {
  position: fixed;
  bottom: 64px;
  right: 20px;
  width: 300px;
  max-height: 400px;
  background-color: #f8f9fa;
  color: #000;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  overflow-y: auto;
  display: none;
  z-index: 2100;
}
body.dark-mode .playlist-modal {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border-color: #444;
}
.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}
body.dark-mode .playlist-header {
  border-color: #444;
}
#playlist-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: inherit;
}
#music-list {
  list-style: none;
  margin: 0;
  padding: 10px;
}
#music-list li {
  padding: 5px 0;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}
body.dark-mode #music-list li {
  border-color: #444;
}
#music-list li:hover {
  background-color: #eee;
}
body.dark-mode #music-list li:hover {
  background-color: #444;
}

/* Settings 모달 - 계산기를 크게 보이도록 */
.settings-modal {
  position: fixed;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  overflow-y: auto;
  background-color: #f8f9fa;
  color: #000;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 2100;
  display: none;
}
body.dark-mode .settings-modal {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border-color: #444;
}
.settings-modal .playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}
body.dark-mode .settings-modal .playlist-header {
  border-color: #444;
}

/* --- 계산기 레이아웃 통일 --- */

/* 공통 컨테이너: 세 계산기를 한 줄에 균등하게 배치 */
.calculator-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: center;
}

/* 개별 계산기: 동일한 비율로 배분 */
.calculator {
  flex: 1 1 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
  min-width: 300px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  background-color: #fff;
}
body.dark-mode .calculator {
  background-color: #444;
  border-color: #666;
}
.calculator h3 {
  text-align: center;
  margin-top: 0;
}
.calc-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
/* 레이블 폰트 크기와 최소 폭을 조정하여 한 줄에 나오도록 함 */
.calc-row label {
  min-width: 90px;
  text-align: right;
  margin-right: 10px;
  font-size: 14px;
}
.calc-row input,
.calc-row select {
  flex: 1;
  padding: 6px;
  font-size: 14px;
}

/* 미디어 쿼리: 화면 폭에 따라 계산기 배치 변경 */
@media (max-width: 900px) {
  .calculator {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}
@media (max-width: 600px) {
  .calculator {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* --- 인터랙티브 아이콘 (노란색 채움 효과) --- */
/* 아이콘 버튼: 부모는 transform 전환만 적용 */
.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  transition: transform 0.3s ease;
}
.icon-button:hover,
.icon-button:focus {
  transform: scale(1.1);
}
/* .icon 요소에 transition 적용하고, hover 시 내부에 노란색 채움 */
.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: background-color 0.3s ease;
}
.icon-button:hover .icon {
  background-color: #ffcc00;
}
/* SVG와 이미지 아이콘에도 부드러운 전환 효과 적용 */
.icon-button:hover svg,
.icon-button:hover img {
  transform: scale(1.1);
  filter: brightness(1.2);
}
.icon-button:hover svg {
  stroke: #ffcc00;
}
/* SVG 아이콘 mask 방식 */
.icon.previous-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/previous.svg?v=1743804091478");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/previous.svg?v=1743804091478");
}
.icon.play-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/play.svg?v=1743804067105");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/play.svg?v=1743804067105");
}
.icon.pause-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/pause.svg?v=1743804095888");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/pause.svg?v=1743804095888");
}
.icon.next-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/next.svg?v=1743804085824");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/next.svg?v=1743804085824");
}
.icon.volume-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/volume.svg?v=1743804670040");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/volume.svg?v=1743804670040");
}
.icon.mute-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/mute.svg?v=1743804668192");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/mute.svg?v=1743804668192");
}
.icon.playlist-icon {
  -webkit-mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/playlist.svg?v=1743805307213");
  mask-image: url("https://cdn.glitch.global/883dd789-ece9-4815-b254-954ce92b1d2f/playlist.svg?v=1743805307213");
}

/* 다크모드에서 아이콘 색상 */
body.dark-mode .icon-button {
  color: #e0e0e0;
}
/* 챗봇 모달 팝업 */
.chatbot-modal {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 300px;
  max-height: 400px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 2200;
  display: flex;
  flex-direction: column;
}
body.dark-mode .chatbot-modal {
  background-color: #333;
  color: #e0e0e0;
  border-color: #555;
}

/* 챗봇 헤더 */
.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #0084ff;
  color: #fff;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.chatbot-close-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

/* 챗봇 메시지 영역 */
.chatbot-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background-color: #f1f1f1;
}
body.dark-mode .chatbot-messages {
  background-color: #444;
}

/* 개별 메시지 스타일 */
.chatbot-message {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  max-width: 90%;
  word-break: break-word;
}
.chatbot-message-user {
  background-color: #0084ff;
  color: #fff;
  align-self: flex-end;
}
.chatbot-message-bot {
  background-color: #eee;
  color: #000;
  align-self: flex-start;
}
body.dark-mode .chatbot-message-bot {
  background-color: #666;
  color: #fff;
}

/* 챗봇 입력 영역 */
.chatbot-input-area {
  display: flex;
  border-top: 1px solid #ddd;
}
.chatbot-input-area input {
  flex: 1;
  border: none;
  padding: 8px;
  font-size: 14px;
  outline: none;
}
.chatbot-input-area button {
  border: none;
  background-color: #0084ff;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
}
.chatbot-input-area button:hover {
  background-color: #006bb3;
}

/* 챗봇 아이콘은 extra-controls 영역에 포함되었으므로 별도의 fixed 스타일은 제거 */
