/* ================================
   필터 스타일
   필터 체크박스, 피드 필터, 팀 정렬 등 공통 필터
================================ */

.exp-bar-container {
  margin-top: 8px;
  width: 100%;
}

.exp-bar {
  position: relative;
  height: 12px;
  background: linear-gradient(to bottom, #1a1a2e, #16213e);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #3a3a5e;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.exp-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to bottom, #4ade80, #22c55e);
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.exp-bar-preview {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(to bottom, #86efac, #4ade80);
  border-radius: 5px;
  opacity: 0.6;
  transition: left 0.3s ease, width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(134, 239, 172, 0.7);
  animation: expPreviewPulse 1s infinite ease-in-out;
}

@keyframes expPreviewPulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

.exp-bar-text {
  margin-top: 4px;
  font-size: 11px;
  color: #666;
  text-align: center;
  font-weight: 500;
}

#pokemon-detail-modal .exp-bar-text {
  color: #495057 !important;
}

.feed-exp-bar {
  margin-top: 8px;
  padding: 0 10px;
}

.feed-exp-bar .exp-bar {
  height: 14px;
}

.feed-exp-bar .exp-bar-text {
  font-size: 12px;
}

.exp-bar-container.level-up-preview .exp-bar {
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.exp-bar-container.level-up-preview .exp-bar-text {
  color: #f59e0b;
  font-weight: 700;
}

.feed-filters-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.03);
  padding: 8px;
  border-radius: 10px;
}

.feed-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.feed-search-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-family: inherit;
}

.feed-sort-select {
  padding: 8px;
  border-radius: 8px;
  background: var(--pokemon-blue);
  color: white;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

#feed-select-all-btn {
  white-space: nowrap;
  background: #6c757d !important;
  color: #ffffff !important;
  border: 1px solid #5a6268 !important;
}

#feed-select-all-btn:hover {
  background: #5a6268 !important;
  border-color: #495057 !important;
  color: #ffffff !important;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-checkbox-group {
  display: flex;
  gap: 5px;
  align-items: center;
}

#feed-rarity-filters {
  flex-wrap: wrap;
  max-width: 100%;
  width: 100%;
}

#feed-rarity-filters .filter-checkbox-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  height: auto;
}

#feed-rarity-filters .filter-checkbox-label[data-filter="common"],
#feed-rarity-filters .filter-checkbox-label[data-filter="uncommon"],
#feed-rarity-filters .filter-checkbox-label[data-filter="rare"] {
  order: 1;
  flex: 1 1 calc(33.333% - 3.4px);
  min-width: calc(33.333% - 3.4px);
}

#feed-rarity-filters .filter-checkbox-label[data-filter="mythical"],
#feed-rarity-filters .filter-checkbox-label[data-filter="epic"],
#feed-rarity-filters .filter-checkbox-label[data-filter="legendary"] {
  order: 2;
  flex: 1 1 calc(33.333% - 3.4px);
  min-width: calc(33.333% - 3.4px);
}

#feed-rarity-filters .filter-checkbox-label .filter-checkbox {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

#feed-rarity-filters .filter-checkbox-label .filter-checkbox:checked::after {
  font-size: 14px !important;
}

#feed-rarity-filters .filter-checkbox-label .filter-checkbox-text {
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1;
}

#feed-grade-filters {
  flex-wrap: nowrap;
  width: 100%;
}

#feed-grade-filters .filter-checkbox-label {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 12px;
  font-size: 13px;
  justify-content: center;
}

#feed-grade-filters .filter-checkbox {
  width: 18px;
  height: 18px;
}

.filter-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: 2px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: #2d3436;
  position: relative;
  overflow: hidden;
}

.filter-checkbox-label::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.filter-checkbox-label:hover::before {
  left: 100%;
}

.filter-checkbox-label:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.filter-checkbox:checked {
  background: linear-gradient(135deg, var(--pokemon-blue), #4a90e2);
  border-color: var(--pokemon-blue);
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.filter-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

.filter-checkbox:indeterminate {
  background: linear-gradient(135deg, #9e9e9e, #757575);
  border-color: #9e9e9e;
}

.filter-checkbox:indeterminate::after {
  content: '−';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
}

.filter-checkbox-text {
  pointer-events: none;
  white-space: nowrap;
  color: #2d3436;
  font-weight: 600;
}

.filter-checkbox-label[data-filter="common"]:has(.filter-checkbox:checked) {
  background: rgba(158, 158, 158, 0.2);
  border-color: rgba(158, 158, 158, 0.6);
}

.filter-checkbox-label[data-filter="common"]:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label[data-filter="uncommon"]:has(.filter-checkbox:checked) {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.6);
}

.filter-checkbox-label[data-filter="uncommon"]:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label[data-filter="rare"]:has(.filter-checkbox:checked) {
  background: rgba(33, 150, 243, 0.2);
  border-color: rgba(33, 150, 243, 0.6);
}

.filter-checkbox-label[data-filter="rare"]:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label[data-filter="epic"]:has(.filter-checkbox:checked) {
  background: rgba(156, 39, 176, 0.2);
  border-color: rgba(156, 39, 176, 0.6);
}

.filter-checkbox-label[data-filter="epic"]:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label[data-filter="legendary"]:has(.filter-checkbox:checked) {
  background: rgba(255, 152, 0, 0.2);
  border-color: rgba(255, 152, 0, 0.6);
}

.filter-checkbox-label[data-filter="legendary"]:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label[data-filter="mythical"]:has(.filter-checkbox:checked) {
  background: rgba(233, 30, 99, 0.2);
  border-color: rgba(233, 30, 99, 0.6);
}

.filter-checkbox-label[data-filter="mythical"]:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label.grade-C:has(.filter-checkbox:checked) {
  background: rgba(76, 175, 80, 0.25);
  border-color: rgba(76, 175, 80, 0.7);
}

.filter-checkbox-label.grade-C:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label.grade-B:has(.filter-checkbox:checked) {
  background: rgba(33, 150, 243, 0.25);
  border-color: rgba(33, 150, 243, 0.7);
}

.filter-checkbox-label.grade-B:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label.grade-A:has(.filter-checkbox:checked) {
  background: rgba(156, 39, 176, 0.25);
  border-color: rgba(156, 39, 176, 0.7);
}

.filter-checkbox-label.grade-A:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-checkbox-label.grade-S:has(.filter-checkbox:checked) {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.25), rgba(255, 152, 0, 0.25));
  border-color: rgba(255, 152, 0, 0.8);
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.3);
}

.filter-checkbox-label.grade-S:has(.filter-checkbox:checked) .filter-checkbox-text {
  color: #2d3436;
  font-weight: 700;
}

.filter-row > .filter-checkbox-label:first-of-type,
.filter-row > .filter-checkbox-label[id*="select-all"] {
  font-weight: 700;
  margin-right: 4px;
}

.team-pokemon-list-container .search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
}

.team-pokemon-list-container .search-filter {
  flex: 1;
  margin-bottom: 0;
}

.team-sort-select {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.team-sort-select option {
  background: var(--pokemon-blue);
}

/* 미디어 쿼리 */
@media (max-width: 768px) {
  .feed-filters-container {
    padding: 8px;
    gap: 6px;
  }

  #feed-rarity-filters {
    flex-wrap: wrap;
    gap: 4px;
  }

  #feed-rarity-filters .filter-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .feed-search-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .feed-search-row input {
    width: 100%;
    flex: 1 1 100%;
    order: 1;
  }

  .feed-sort-select {
    flex: 1;
    order: 2;
    min-width: 0;
  }

  #feed-select-all-btn {
    flex: 1;
    order: 3;
    padding: 8px 12px;
    font-size: 12px;
  }

  .filter-row {
    padding: 6px;
    gap: 6px;
  }

  .filter-checkbox-group {
    gap: 4px;
    flex-wrap: wrap;
  }

  .filter-checkbox-label {
    padding: 5px 8px;
    font-size: 12px;
    gap: 5px;
  }

  .filter-checkbox {
    width: 16px;
    height: 16px;
  }

  .select-all-checkbox {
    width: 18px;
    height: 18px;
  }
}
