/* TIL File Manager 패널 — 실제 플러그인 소스 이식본.
   원본: sfx-trim/TIL-File-Manager/client/css/style.css
   ★ 손으로 다시 쓰지 않는다. 원본이 바뀌면 스크래치패드 이식 스크립트로 다시 뽑는다.
   ★ 토큰 이름이 랜딩과 겹쳐(--bg/--text/--accent) .tfm-panel 스코프가 반드시 필요하다.
   ★ 인증 모달·토스트는 패널 화면에 없어 이식하지 않았다. */

.tfm-panel {
  --bg: #1e1e1e;
  --bg-elevated: #262626;
  --bg-card: #272727;
  --bg-card-hover: #323232;
  --bg-card-playing: #3a2f57;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9e9ea;
  --text-muted: #9a9a9d;
  --text-faint: #6c6c6f;
  --accent: #8b7cf6;
  --accent-strong: #a596ff;
  --accent-soft: rgba(139, 124, 246, 0.16);
  --favorite: #f5c542;
  --radius-thumb: 6px;
  --radius-card: 12px;
  --control-h: 28px;
}
.tfm-panel {
  box-sizing: border-box;
}
.tfm-panel {
  -webkit-font-smoothing: antialiased;
}
.tfm-panel {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, sans-serif;
  font-size: 12px;
  overflow: hidden;
}
.tfm-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.tfm-panel .tfm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tfm-panel .add-menu {
  position: relative;
  flex-shrink: 0;
}
.tfm-panel .btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: var(--control-h);
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition-property: background-color, border-color, transform;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}
.tfm-panel .btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}
.tfm-panel .btn-icon:active {
  transform: scale(0.96);
}
.tfm-panel .btn-add .chev {
  margin-left: 1px;
  opacity: 0.7;
}
.tfm-panel .favorites-filter-group {
  margin-left: auto;
}
.tfm-panel .lang-group {
  position: relative;
}
.tfm-panel .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--control-h);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}
.tfm-panel .checkbox-label:hover {
  color: var(--text);
}
.tfm-panel .checkbox-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.tfm-panel .checkbox-box {
  position: relative;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg);
  transition-property: background-color, border-color;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}
.tfm-panel .checkbox-label:hover .checkbox-box {
  border-color: var(--accent);
}
.tfm-panel .checkbox-input:focus-visible + .checkbox-box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tfm-panel .checkbox-input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}
.tfm-panel .checkbox-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #17131f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition-property: transform;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}
.tfm-panel .checkbox-input:checked + .checkbox-box::after {
  transform: rotate(45deg) scale(1);
}
.tfm-panel .lang-btn {
  font-variant-numeric: tabular-nums;
}
.tfm-panel #lang-current {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tfm-panel .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 150px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 4px;
  z-index: 20;
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top left;
  transition-property: opacity, transform;
  transition-duration: 130ms;
  transition-timing-function: ease-out;
}
.tfm-panel .dropdown-menu.hidden {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
}
.tfm-panel .lang-dropdown {
  right: 0;
  left: auto;
  transform-origin: top right;
  min-width: 130px;
}
.tfm-panel .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition-property: background-color;
  transition-duration: 100ms;
}
.tfm-panel .dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.tfm-panel .breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  scrollbar-width: none;
}
.tfm-panel .breadcrumb::-webkit-scrollbar {
  display: none;
}
.tfm-panel .crumb {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 4px;
  cursor: pointer;
  transition-property: color, background-color;
  transition-duration: 100ms;
  text-wrap: nowrap;
}
.tfm-panel .crumb:hover {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.05);
}
.tfm-panel .crumb.current {
  color: var(--text);
  cursor: default;
}
.tfm-panel .crumb.current:hover {
  background: none;
  color: var(--text);
}
.tfm-panel .crumb-sep {
  color: var(--text-faint);
  flex-shrink: 0;
}
.tfm-panel .tfm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 7px 10px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tfm-panel .tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.tfm-panel .tool-label {
  font-size: 11px;
}
.tfm-panel .select {
  height: var(--control-h);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
  cursor: pointer;
}
.tfm-panel .select:hover {
  border-color: var(--accent);
}
.tfm-panel .slider-group {
  min-width: 90px;
}
.tfm-panel .slider {
  -webkit-appearance: none;
  width: 84px;
  height: var(--control-h);
  background: transparent;
  cursor: pointer;
}
.tfm-panel .slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill, 50%), var(--border-strong) var(--fill, 50%), var(--border-strong) 100%);
}
.tfm-panel .slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition-property: transform;
  transition-duration: 100ms;
}
.tfm-panel .slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
}
.tfm-panel .btn-back {
  flex-shrink: 0;
}
.tfm-panel .search-group {
  position: relative;
  min-width: 110px;
}
.tfm-panel .search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-faint);
}
.tfm-panel .search-input {
  width: 100%;
  height: var(--control-h);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 24px 0 26px;
  font-size: 12px;
  font-family: inherit;
}
.tfm-panel .search-input:hover {
  border-color: var(--accent);
}
.tfm-panel .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.tfm-panel .search-input::placeholder {
  color: var(--text-faint);
}
.tfm-panel .search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  padding: 0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-faint);
  cursor: pointer;
  transition-property: background-color, color;
  transition-duration: 100ms;
}
.tfm-panel .search-clear svg {
  display: block;
}
.tfm-panel .search-clear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.tfm-panel .grid {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--icon-size, 120px), 1fr));
  gap: 12px;
  align-content: start;
}
.tfm-panel .item-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid transparent;
  cursor: default;
  position: relative;
  transition-property: background-color, border-color, transform;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}
.tfm-panel .item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.tfm-panel .item-card.playing {
  background: var(--bg-card-playing);
  border-color: var(--accent);
}
.tfm-panel .item-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-thumb);
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}
.tfm-panel .item-card .thumb img, .tfm-panel .item-card .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}
.tfm-panel .item-card .thumb canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.tfm-panel .wave-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.14);
  border-right: 1px solid var(--accent-strong);
  pointer-events: none;
  transition-property: width;
  transition-duration: 60ms;
  transition-timing-function: linear;
}
.tfm-panel .item-card[draggable="true"] {
  cursor: grab;
}
.tfm-panel .item-card[data-type="folder"] {
  cursor: pointer;
}
.tfm-panel .item-card.dragging {
  opacity: 0.5;
}
.tfm-panel .item-card .thumb .type-icon {
  width: 36%;
  height: 36%;
  opacity: 0.55;
}
.tfm-panel .item-card .thumb .type-icon.folder-icon {
  width: 72%;
  height: 72%;
  opacity: 0.8;
}
.tfm-panel .item-count-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.tfm-panel .playing-badge {
  position: absolute;
  left: 32px;
  top: 5px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  opacity: 0;
  transition-property: opacity;
  transition-duration: 120ms;
}
.tfm-panel .item-card.playing .playing-badge {
  opacity: 1;
}
.tfm-panel .playing-badge span {
  width: 2.5px;
  background: var(--accent-strong);
  border-radius: 1px;
  animation: eq 0.9s ease-in-out infinite;
}
.tfm-panel .playing-badge span:nth-child(1) {
  height: 40%; animation-delay: 0ms;
}
.tfm-panel .playing-badge span:nth-child(2) {
  height: 90%; animation-delay: 150ms;
}
.tfm-panel .playing-badge span:nth-child(3) {
  height: 60%; animation-delay: 300ms;
}
.tfm-panel .card-actions {
  position: absolute;
  right: 5px;
  top: 5px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.tfm-panel .card-action-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition-property: opacity, transform, background-color, color;
  transition-duration: 130ms;
  transition-timing-function: ease-out;
}
.tfm-panel .item-card:hover .card-action-btn {
  opacity: 1;
  transform: translateY(0);
}
.tfm-panel .import-btn:hover {
  background: var(--accent);
}
.tfm-panel .card-action-btn:active {
  transform: scale(0.9);
}
.tfm-panel .fav-btn {
  position: absolute;
  left: 5px;
  top: 5px;
  z-index: 2;
}
.tfm-panel .fav-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  color: var(--favorite);
}
.tfm-panel .fav-btn.active {
  opacity: 1;
  transform: translateY(0);
  color: var(--favorite);
}
.tfm-panel .fav-btn.active svg {
  fill: currentColor;
}
.tfm-panel .item-name {
  font-size: 11.5px;
  color: var(--text);
  text-wrap: pretty;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
.tfm-panel .item-meta {
  font-size: 10px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.tfm-panel .empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-faint);
  text-align: center;
}
.tfm-panel .empty-state.hidden {
  display: none;
}
.tfm-panel .btn-primary {
  height: 30px;
  padding: 0 14px;
  background: var(--accent);
  color: #17131f;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition-property: background-color, transform;
  transition-duration: 120ms;
}
.tfm-panel .btn-primary:hover {
  background: var(--accent-strong);
}
.tfm-panel .btn-primary:active {
  transform: scale(0.96);
}
.tfm-panel .status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
  flex-shrink: 0;
}
.tfm-panel .status-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tfm-panel #item-count {
  font-variant-numeric: tabular-nums;
}
.tfm-panel .version-label {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.tfm-panel .version-label::before {
  content: "·";
  margin-right: 6px;
}
.tfm-panel .version-label:empty {
  display: none;
}
.tfm-panel .now-playing {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-strong);
  min-width: 0;
}
.tfm-panel .now-playing.hidden {
  display: none;
}
.tfm-panel #now-playing-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.tfm-panel .auth-subtitle {
  margin: 2px 0 16px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.tfm-panel .auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tfm-panel .auth-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}
.tfm-panel .auth-label:first-child {
  margin-top: 0;
}
.tfm-panel .auth-input {
  height: var(--control-h);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-family: inherit;
  width: 100%;
}
.tfm-panel .auth-input:hover {
  border-color: var(--accent);
}
.tfm-panel .auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.tfm-panel .auth-submit {
  width: 100%;
  height: 32px;
  margin-top: 10px;
}
.tfm-panel .btn-secondary {
  height: var(--control-h);
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition-property: background-color, border-color;
  transition-duration: 120ms;
}
.tfm-panel .btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}
.tfm-panel .btn-secondary:active {
  transform: scale(0.97);
}
.tfm-panel .auth-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px;
}
.tfm-panel .auth-link:hover {
  color: var(--accent-strong);
}
.tfm-panel .auth-link-sep {
  color: var(--text-faint);
}
.tfm-panel .auth-google-btn {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition-property: transform;
  transition-duration: 120ms;
}
.tfm-panel .auth-google-btn:active {
  transform: scale(0.97);
}
.tfm-panel .hidden {
  display: none !important;
}
.tfm-panel ::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
.tfm-panel ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
}
.tfm-panel ::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes eq {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}


/* ── 랜딩에 얹기 위한 최소 보정 (원본 값은 건드리지 않는다) ── */
.tfm-panel {
  display: flex;
  flex-direction: column;
  height: auto;
  border-radius: var(--win-radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: var(--win-shadow);
}
/* 원본은 CEP 패널이라 세로가 화면 전체(100vh)다. 랜딩에서는 창 안에 들어가야 하므로
   그리드 높이만 잡아 준다 — 잘린 카드가 아래로 이어지는 인상이 오히려 실제 패널에 가깝다. */
.tfm-panel .grid {
  height: auto;
  min-height: 0;
  max-height: 232px;
  overflow: hidden;
  align-content: start;
}
.tfm-panel .item-card { cursor: pointer; }
.tfm-panel .wave-canvas { width: 100%; height: 100%; display: block; }
