/* 감드컵 드래프트 전용 스타일 */

/* 기본 스타일 (메인페이지 스타일과 동일) */
html, body {
  font-family: 'Noto Sans KR', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color, #f5eedd);
  color: var(--text-color, #333);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* 헤더 및 로고 */
.header-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-color);
}
.draft-header {
  display: table-row;
}

.header-cell {
  display: table-cell;
  text-align: center;
  padding: 15px;
  font-weight: 700;
  font-size: var(--font-size-large);
  color: var(--gamscup-primary);
  background-color: rgba(26, 92, 66, 0.05);
  border-radius: 8px;
  vertical-align: middle;
}

/* 드래프트 소개 영역 */
.draft-intro {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.draft-intro i {
  font-size: 36px;
  color: var(--primary-color);
  background-color: rgba(26, 92, 66, 0.1);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-text h2 {
  margin: 0 0 8px 0;
  color: var(--primary-color);
}

.intro-text p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

/* 드래프트 컨테이너 */
.draft-container {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

/* 드래프트 그리드 */
.draft-grid {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
}

.draft-row {
  display: table-row;
}

.draft-cell {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  position: relative;
  min-width: 80px;
  height: 100px;
  transition: all 0.2s;
}

.coach-cell {
  width: 100px;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: default;
}

.coach-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 5px;
  border: 3px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.coach-name {
  font-size: 14px;
}

.player-cell {
  background-color: #f5f5f5;
  border: 2px solid transparent;
}

.player-cell:hover {
  background-color: #e8e8e8;
}

.player-cell.selected {
  border-color: #333;
  box-shadow: 0 0 0 2px #333;
}

.player-cell.filled {
  background-color: white;
  border: 2px solid #ddd;
}

.player-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-bottom: 5px;
  object-fit: cover;
}

.player-name {
  font-size: 12px;
  font-weight: 500;
}

.player-position {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
  display: inline-block;
  margin-top: 3px;
}

/* 포지션 색상 */
.position-ST, .position-WF {
  background-color: #d32f2f;
}

.position-CM, .position-CDM {
  background-color: #388e3c;
}

.position-FB, .position-CB {
  background-color: #1976d2;
}

.position-GK {
  background-color: #ff8f00;
}

.position-ALL {
  background-color: #757575;
}

/* 플로팅 선수 목록 패널 */
.players-floating-panel {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 1000;
}

.toggle-players-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toggle-players-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* 전체 화면 모달 스타일 */
.players-panel-content {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 1200px;
  height: 80vh;
  background-color: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
}

.players-panel-content.active {
  display: flex;
}

/* 배경 오버레이 */
.players-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}

.players-overlay.active {
  display: block;
}

.players-panel-header {
  padding: 20px;
  background-color: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.players-panel-header h3 {
  margin: 0;
  font-size: 24px;
  color: var(--primary-color);
}

.close-panel-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 28px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.close-panel-btn:hover {
  color: #333;
}

.players-search {
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.players-search input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

/* 필터 탭 컨테이너 */
.filter-tabs-container {
  padding: 15px 20px;
  background-color: #f8f8f8;
  border-bottom: 1px solid #eee;
}

/* 필터 한 줄로 배치 */
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 포지션 탭 */
.position-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 성별 탭 */
.gender-tabs {
  display: flex;
  gap: 10px;
  margin-left: 10px;
}

.position-tab, .gender-tab {
  padding: 10px 20px;
  border: none;
  background-color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #555;
  transition: all 0.2s;
  border: 1px solid #ddd;
}

.position-tab:hover, .gender-tab:hover {
  background-color: #f0f0f0;
}

.position-tab.active, .gender-tab.active {
  background-color: var(--primary-color, #0f3327);
  color: white;
  border-color: var(--primary-color, #0f3327);
}

.gender-tab[data-gender="남"] {
  background-color: #2196F3;
  color: white;
  border-color: #2196F3;
}

.gender-tab[data-gender="남"].active {
  background-color: #0d47a1;
  border-color: #0d47a1;
}

.gender-tab[data-gender="여"] {
  background-color: #F06292;
  color: white;
  border-color: #F06292;
}

.gender-tab[data-gender="여"].active {
  background-color: #c2185b;
  border-color: #c2185b;
}

/* 남/여 구분 태그 */
.gender-tag {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  border-radius: 50%;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
  margin-left: 6px;
  margin-bottom: 4px;
}

.gender-tag.male {
  background-color: #2196F3;
}

.gender-tag.female {
  background-color: #F06292;
}

.players-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  background-color: #fafafa;
}

.player-list-item {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.player-list-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.player-list-item.selected {
  opacity: 0.5;
  pointer-events: none;
  background-color: #f5f5f5;
}

.player-list-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 12px;
  object-fit: cover;
  border: 2px solid #eee;
}

.player-list-name-container {
  width: 100%;
  position: relative;
  padding: 0 5px;
  margin-bottom: 8px;
}

.player-list-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  width: calc(100% - 30px); /* 성별 태그 공간 확보 */
  display: inline-block;
  text-align: center;
}

.player-list-position {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 12px;
  color: white;
  display: inline-block;
  margin-bottom: 8px;
}

/* 서브포지션 컨테이너 */
.subposition-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
  max-width: 100%;
}

.player-list-subposition {
  font-size: 11px;
  color: #444;
  background-color: #e0e0e0;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

/* 반응형 그리드 */
@media (max-width: 1200px) {
  .players-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .players-panel-content {
    width: 95%;
    height: 90vh;
  }
  
  .players-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .gender-tabs {
    margin-left: 0;
  }
}

/* 로딩 표시 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #666;
}

.loading i {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--secondary-color);
}

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

.players-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.players-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.players-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}