/* Web Fonts */
@font-face {
  font-family: 'GyeonggiMillenniumTitle';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2410-3@1.0/Title_Light.woff') format('woff');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'GyeonggiMillenniumTitle';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2410-3@1.0/Title_Bold.woff') format('woff');
  font-weight: 700;
  font-display: swap;
}

:root {
  --widget-width: 360px;
  --widget-height: 280px;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Noto Sans KR', Arial, sans-serif;
  background: #0b0f14;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

#widget-container {
  position: relative;
  width: var(--widget-width);
  height: var(--widget-height);
  border-radius: 24px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.widget-header-left {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  padding: 2px 8px;
  border: 0px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  font-size: 14px;
  z-index: 2;
}

.affinity-display {
  letter-spacing: 0.08em;  /* 하트 사이 간격 조정 */
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
}

.affinity-display:empty {
  display: none; /* 비어있으면 숨김 */
}

/* 호감도 하트 애니메이션 */
.affinity-display span {
  display: inline-block;
  animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.widget-header-right {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 0px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  font-size: 14px;
  z-index: 2;
}

.weather-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.weather-icon svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.weather-temp {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.character-image {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.6)),
              url('https://blue-utils.me/img/common/memorial/illust-orig/mika/mika.webp') center/cover no-repeat;
  filter: saturate(1.05);
}

.dialogue-box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0px 18px 14px 18px;
  /* Soft fade from opaque at bottom to transparent upwards */
  background: linear-gradient(to top,
    rgba(8,12,16,0.8) 0%,
    rgba(8,12,16,0.6) 40%,
    rgba(8,12,16,0.0) 100%
  );
  min-height: 30%;
  z-index: 1;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.student-header {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin-top: 6px;
}

.student-name {
  font-family: 'GyeonggiMillenniumTitle', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.student-school {
  font-family: 'GyeonggiMillenniumTitle', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #7dc4e4;
  margin-top: 2px;
}

.dialogue-divider {
  height: 1px;
  background: rgba(255,255,255,0.3);
  margin: 5.5px 0 2px 0;
}

.dialogue-text {
  font-family: 'GyeonggiMillenniumTitle', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
  margin: 4px 0 0 0;
}

/* 호감도 부족 메시지 스타일 */
.dialogue-text.affinity-insufficient {
  text-align: center;
  color: #888;
  font-style: italic;
  opacity: 0.8;
}

/* Right-side control panel */
.control-panel {
  position: absolute;
  top: 56px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.btn-change-dialogue {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.102);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.btn-change-dialogue svg {
  display: block;
}

.btn-change-dialogue:hover {
  background: rgba(255,255,255,0.12);
}

/* Developer Control Panel & Debug Log Panel - Shared Styles */
.dev-control-panel,
.debug-log-panel {
  width: var(--widget-width);
  margin-top: 16px;
  background: #111;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-icon {
  color: #7dc4e4;
  flex-shrink: 0;
}

.panel-title span {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

.panel-controls {
  display: flex;
  gap: 6px;
}

.btn-panel-control,
.btn-panel-toggle {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}

.btn-panel-control:hover,
.btn-panel-toggle:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.btn-panel-control:active,
.btn-panel-toggle:active {
  transform: scale(0.95);
}

.icon-chevron {
  transition: transform 0.3s ease;
}

.icon-chevron.rotated {
  transform: rotate(-180deg);
}

.panel-body {
  padding: 18px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.panel-body.collapsed {
  max-height: 0 !important;
  padding: 0 18px;
  overflow: hidden;
}

/* Developer Control Panel Specific */
.control-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  max-width: 100%;
  box-sizing: border-box;
}

.control-group {
  flex: 1;
  min-width: 0;
}

.control-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #aaa;
  letter-spacing: 0.02em;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.control-select,
.control-input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', monospace;
  transition: all 0.15s;
  box-sizing: border-box;
}

.control-select {
  cursor: pointer;
}

.control-select:hover,
.control-input:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}

.control-select:focus,
.control-input:focus {
  outline: none;
  border-color: rgba(124, 196, 228, 0.5);
  background: rgba(255,255,255,0.08);
}

.control-select option {
  background: #1a1f2e;
  color: #fff;
}

.variable-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row .control-input {
  flex: 1;
}

.btn-test {
  width: 100%;
  padding: 12px 16px;
  background: rgba(124, 196, 228, 0.15);
  border: 1px solid rgba(124, 196, 228, 0.3);
  border-radius: 10px;
  color: #7dc4e4;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-bottom: 14px;
}

.btn-test:hover {
  background: rgba(124, 196, 228, 0.25);
  border-color: rgba(124, 196, 228, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 196, 228, 0.2);
}

.btn-test:active {
  transform: translateY(0);
}

.btn-test.btn-secondary {
  background: rgba(255, 105, 180, 0.15);
  border-color: rgba(255, 105, 180, 0.3);
  color: #ff69b4;
}

.btn-test.btn-secondary:hover {
  background: rgba(255, 105, 180, 0.25);
  border-color: rgba(255, 105, 180, 0.5);
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.2);
}

.panel-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 12px;
  color: #888;
}

.info-icon {
  color: #666;
  flex-shrink: 0;
}

.panel-info span {
  color: #aaa;
}

#trigger-count {
  font-weight: 600;
  color: #7dc4e4;
}

/* 호감도 테스트 섹션 */
.affinity-test-section {
  margin-top: 8px;
}

.section-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 20px 0 16px 0;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #ff69b4;
}

.section-label svg {
  color: #ff69b4;
}

.affinity-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding: 10px;
  background: rgba(255, 105, 180, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 105, 180, 0.15);
}

.affinity-info .info-text {
  font-size: 11px;
  color: #999;
  font-family: 'Consolas', 'Monaco', monospace;
  line-height: 1.6;
}

/* Debug Log Panel Specific */
.log-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 12px 16px;
}

.debug-log-content {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.6;
}

.log-entry {
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  border-left: 3px solid;
  background: rgba(255,255,255,0.02);
  word-wrap: break-word;
  transition: background 0.15s;
}

.log-entry:hover {
  background: rgba(255,255,255,0.04);
}

.log-entry.info {
  border-left-color: #7dc4e4;
  color: #b8dce8;
}

.log-entry.success {
  border-left-color: #4ade80;
  color: #a8e6c0;
}

.log-entry.warning {
  border-left-color: #fbbf24;
  color: #f5d999;
}

.log-entry.error {
  border-left-color: #f87171;
  color: #f5b5b5;
  background: rgba(248, 113, 113, 0.05);
}

.log-time {
  color: #555;
  margin-right: 8px;
  font-size: 10px;
  font-weight: 500;
}

.log-message {
  color: inherit;
}

/* 스크롤바 스타일 */
.log-body::-webkit-scrollbar {
  width: 6px;
}

.log-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.log-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

.log-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}


