/* poe2-trial-desktop.css */
/* 데스크톱용 시멘틱 테이블 스타일 - 기존 디자인 유지 */

/* 기본 컨테이너 스타일 유지 */
.poe2-trial-plugin-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #e0e0e0; /* 기존 텍스트 색상 유지 */
}

/* 필터 및 검색 영역 스타일 (기존과 동일) */
.poe2-trial-filters {
  margin-bottom: 25px;
  padding: 15px;
  background-color: #2c2c2c;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 15px;
}

.poe2-trial-filters .poe2-trial-filter-title {
  margin-top: 0;
  color: #e0e0e0;
  width: 100%;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.poe2-trial-filters .poe2-trial-filter-group {
  display: flex;
  align-items: center;
  flex-grow: 1;
  min-width: 250px;
  gap: 10px;
}

.poe2-trial-search-input {
  flex-grow: 1;
  padding: 10px 12px;
  border: 1px solid #444;
  border-radius: 3px;
  background-color: #333;
  color: #e0e0e0 !important;
  font-size: 1em;
  outline: none;
  box-sizing: border-box;
  width: auto;
}

/* 입력 텍스트 색상 강제 적용 */
.poe2-trial-search-input,
.poe2-trial-search-input:focus,
.poe2-trial-search-input:active {
  color: #333 !important;
}

.poe2-trial-search-input:focus {
  border-color: #00bcd4;
}

.poe2-trial-search-input::placeholder {
  color: #888;
}

.poe2-trial-reset-button {
  padding: 8px 15px;
  background-color: #555;
  color: #eee;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.poe2-trial-reset-button:hover {
  background-color: #666;
}

/* 최근 검색어 영역 (기존과 동일) */
.poe2-trial-recent-searches-container {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #444;
  display: none; /* 기본 숨김, JS로 표시 */
  width: 100%;
}

.poe2-trial-recent-searches-label {
  color: #aaa;
  font-size: 13px;
  margin-right: 8px;
}

.poe2-trial-recent-searches-list {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.poe2-trial-recent-search-term {
  background-color: #555;
  color: #eee;
  border: none;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin: 2px;
}

.poe2-trial-recent-search-term:hover {
  background-color: #666;
}

/* 스크린 리더 전용 텍스트 */
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===========================================
   데스크톱 테이블 스타일 (시멘틱 table 기반)
   =========================================== */

.poe2-trial-desktop-view {
  display: block; /* 기본적으로 표시 */
}

.poe2-trial-desktop-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #2c2c2c; /* 기존 배경색 유지 */
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 테이블 헤더 스타일 */
.poe2-trial-desktop-table thead {
  background-color: #2c2c2c;
}

.poe2-trial-desktop-table thead tr {
  border-bottom: 2px solid #e1cd6e; /* 기존 헤더 하단 선 색상 유지 */
}

.poe2-trial-desktop-table th {
  padding: 10px 15px; /* 기존 패딩 유지 */
  font-weight: bold;
  color: #e0e0e0;
  text-align: left;
  vertical-align: middle;
  position: relative;
}

.poe2-trial-desktop-table th:first-child {
  border-top-left-radius: 4px;
}

.poe2-trial-desktop-table th:last-child {
  border-top-right-radius: 4px;
}

/* 정렬 가능한 헤더 스타일 (선택적) */
.poe2-trial-desktop-table th[data-sortable] {
  cursor: pointer;
  user-select: none;
}

.poe2-trial-desktop-table th[data-sortable]:hover {
  background-color: #3a3a3a;
}

.poe2-trial-desktop-table th.sorted-asc::after {
  content: " ↑";
  color: #e1cd6e;
}

.poe2-trial-desktop-table th.sorted-desc::after {
  content: " ↓";
  color: #e1cd6e;
}

/* 테이블 바디 스타일 */
.poe2-trial-desktop-table tbody tr {
  border-bottom: 1px solid #383838; /* 기존 구분선 색상 유지 */
  transition: background-color 0.2s ease-in-out;
}

.poe2-trial-desktop-table tbody tr:last-child {
  border-bottom: none;
}

.poe2-trial-desktop-table tbody tr:hover {
  background-color: #3a3a3a; /* 기존 호버 색상 유지 */
}

.poe2-trial-desktop-table tbody tr[aria-current="true"] {
  background-color: #3a3a3a;
}

.poe2-trial-desktop-table td {
  padding: 12px 15px; /* 기존 셀 패딩 유지 */
  vertical-align: middle;
  box-sizing: border-box;
}

/* 컬럼별 너비 및 스타일 (기존과 동일) */
.poe2-trial-header-recommendation,
.poe2-trial-cell-recommendation {
  width: 140px;
  text-align: center;
}

.poe2-trial-header-name,
.poe2-trial-cell-name {
  width: 200px;
  min-width: 150px;
}

.poe2-trial-header-note,
.poe2-trial-cell-note {
  width: 200px;
  min-width: 150px;
}

.poe2-trial-header-effect,
.poe2-trial-cell-effect {
  width: auto;
  min-width: 300px;
}

/* 별점 스타일 (기존과 동일) */
.poe2-trial-stars-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.poe2-trial-star {
  font-size: 1.2em;
  line-height: 1;
}

.poe2-trial-star.filled {
  color: #ffd700; /* 기존 별점 색상 유지 */
}

.poe2-trial-star.empty {
  color: #5f5f5f; /* 기존 빈 별 색상 유지 */
}

/* 선택지 이름 스타일 (기존과 동일) */
.poe2-trial-choice-name-text {
  font-weight: bold;
  color: #e1cd6e; /* 기존 선택지 이름 색상 유지 */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 노트 스타일 */
.poe2-trial-choice-note-text {
  color: #ccc;
  font-size: 0.9em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 효과 텍스트 스타일 (기존과 동일) */
.poe2-trial-choice-effect-text {
  font-size: 0.9em;
  color: #ccc;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.4;
}

/* 상태 메시지 스타일 (기존과 동일) */
.poe2-trial-loading,
.poe2-trial-error,
.poe2-trial-no-results-message {
  text-align: center;
  padding: 20px;
  color: #aaa;
  background-color: #2c2c2c;
  margin-top: 10px;
  border-radius: 4px;
}

.poe2-trial-error {
  color: #ff6b6b;
  background-color: #2c1f1f;
  border: 1px solid #ff6b6b;
}

.poe2-trial-no-results-cell {
  text-align: center;
  padding: 20px;
  color: #aaa;
}

/* 스켈레톤 UI 스타일 */
.poe2-trial-skeleton-row {
  background-color: #2c2c2c;
}

.poe2-trial-skeleton-cell {
  padding: 12px 15px;
}

.poe2-trial-skeleton-content {
  background-color: #444;
  border-radius: 4px;
  height: 16px;
  animation: poe2-skeleton-pulse 1.5s ease-in-out infinite alternate;
}

.poe2-trial-skeleton-stars {
  width: 100px;
  margin: 0 auto;
}

.poe2-trial-skeleton-name {
  width: 120px;
}

.poe2-trial-skeleton-note {
  width: 80px;
}

.poe2-trial-skeleton-effect {
  width: 200px;
}

@keyframes poe2-skeleton-pulse {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* ===========================================
   반응형 디자인 - 모바일에서 테이블 숨김
   =========================================== */

/* 모바일에서 데스크톱 뷰 숨김 */
@media (max-width: 768px) {
  .poe2-trial-desktop-view {
    display: none !important;
  }
}

/* 태블릿에서 컬럼 너비 조정 */
@media (max-width: 1024px) and (min-width: 769px) {
  .poe2-trial-header-note,
  .poe2-trial-cell-note {
    width: 150px;
    min-width: 120px;
  }

  .poe2-trial-header-effect,
  .poe2-trial-cell-effect {
    min-width: 250px;
  }

  .poe2-trial-choice-effect-text {
    font-size: 0.85em;
  }
}

/* 큰 화면에서 최대 너비 제한 (선택적) */
@media (min-width: 1400px) {
  .poe2-trial-desktop-table {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  .poe2-trial-desktop-table {
    border: 2px solid #fff;
  }

  .poe2-trial-desktop-table td,
  .poe2-trial-desktop-table th {
    border: 1px solid #fff;
  }

  .poe2-trial-star.filled {
    color: #ffff00;
  }

  .poe2-trial-choice-name-text {
    color: #ffff00;
  }
}

/* 다크모드 추가 지원 */
@media (prefers-color-scheme: dark) {
  .poe2-trial-desktop-table {
    background-color: #1a1a1a;
  }

  .poe2-trial-desktop-table tbody tr:hover {
    background-color: #2a2a2a;
  }
}

/* 인쇄 스타일 */
@media print {
  .poe2-trial-filters {
    display: none;
  }

  .poe2-trial-desktop-table {
    background: white !important;
    color: black !important;
    border: 1px solid black;
  }

  .poe2-trial-desktop-table th,
  .poe2-trial-desktop-table td {
    background: white !important;
    color: black !important;
    border: 1px solid black;
  }

  .poe2-trial-star.filled {
    color: black !important;
  }

  .poe2-trial-star.empty {
    color: #999 !important;
  }
}

/* 포커스 스타일 향상 */
.poe2-trial-desktop-table th:focus,
.poe2-trial-search-input:focus,
.poe2-trial-reset-button:focus,
.poe2-trial-recent-search-term:focus {
  outline: 2px solid #00bcd4;
  outline-offset: 2px;
}

/* 애니메이션 감소 설정 지원 */
@media (prefers-reduced-motion: reduce) {
  .poe2-trial-desktop-table tbody tr,
  .poe2-trial-reset-button,
  .poe2-trial-recent-search-term {
    transition: none;
  }

  .poe2-trial-skeleton-content {
    animation: none;
    opacity: 0.8;
  }
}
