.actor-directory {
  --gap: 20px;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --shadow-hover: 0 12px 40px rgba(0,0,0,.15);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: #1a1a1a;
}

/* ==================== 필터 바 ==================== */
.actor-directory__filters {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  border: 1px solid rgba(255,255,255,0.8);
}

.filters-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filters-right {
  display: flex;
  align-items: flex-start;
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.filter-group label {
  font-weight: 600;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
  min-width: 70px;
}

.name-search input[type="text"],
.actor-tag-input-wrap input[type="text"] {
  padding: 11px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  width: 200px;
  height: 44px;
  color: #1e293b;
  background: #fff;
  vertical-align: middle;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.gender-select {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  width: 200px;
  height: 44px;
  color: #1e293b;
  vertical-align: middle;
  background: #fff;
  font-size: 12px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  cursor: pointer;
}

.birth-year-input,
.height-weight-input {
  padding: 11px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  height: 44px;
  width: 200px;
  color: #1e293b;
  background: #fff;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.name-search input[type="text"]:focus,
.actor-tag-input-wrap input[type="text"]:focus,
.height-weight-input:focus,
.birth-year-input:focus,
.gender-select:focus {
  outline: none;
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}


#actor-reset-btn.ghost {
  padding: 11px 24px;
  border: 2px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  color: #64748b;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

#actor-reset-btn.ghost:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* 태그 칩들 */
.actor-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 20px;
}

.actor-filter-tags .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-accent);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
  transition: var(--transition);
  animation: slideIn 0.3s ease-out;
}

.actor-filter-tags .tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

.actor-filter-tags .tag .remove-tag {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.2s ease;
  opacity: 0.85;
  cursor: pointer;
}

.actor-filter-tags .tag .remove-tag:hover {
  opacity: 1;
  transform: scale(1.2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 초성 검색 바 */
.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alpha-bar .alpha-btn {
  padding: 8px 14px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #1e293b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  min-width: 38px;
  text-align: center;
}

.alpha-bar .alpha-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  background: #334155;
  border-color: #94a3b8;
}

.alpha-bar .alpha-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

/* ==================== 카드 그리드 ==================== */
.actor-directory__grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 8px;
}

.actor-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border: 2px solid #f1f5f9;
}

.actor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.actor-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: #667eea;
}

.actor-card:hover::before {
  opacity: 1;
}

.actor-card__thumb {
  padding-top: 130%;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  background-color: #f3f4f6;
}

.actor-card__thumb::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.08) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.actor-card:hover .actor-card__thumb::after {
  opacity: 1;
}

.actor-card__meta {
  padding: 18px;
  color: #1a1a1a;
  position: relative;
  z-index: 2;
  background: #fff;
}

/* 1행: 이름 + 생년월일/나이 */
.actor-card__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.actor-card__name {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  color: #111827;
}

.actor-card__dob-age {
  flex: 0 0 auto;
  text-align: right;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  white-space: nowrap;
  font-weight: 500;
}

.actor-card__dob-age .divider {
  margin: 0 4px;
  color: #cbd5e1;
}

/* 2행: 키/몸무게 */
.actor-card__stats {
  margin-top: 10px;
  text-align: left;
  font-size: 14px;
  color: #475569;
  min-height: 40px;
  font-weight: 500;
}

.actor-card__stats .sep {
  margin: 0 10px;
  color: #cbd5e1;
}

/* 3행: 분류 태그들 (최대 2줄) */
.actor-card__tags {
  margin-top: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 64px;
  line-height: 1.5;
}

.actor-card__tags .tag {
  background: var(--gradient-secondary);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  margin: 3px 6px 3px 0;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(240, 147, 251, 0.3);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.actor-card__tags .tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.actor-card:hover .actor-card__tags .tag::before {
  left: 100%;
}

.actor-card:hover .actor-card__tags .tag {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 14px rgba(240, 147, 251, 0.45);
}

/* ==================== 모달 ==================== */
.actor-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  backdrop-filter: blur(10px);
  animation: modalFadeIn 0.3s ease-out;
}

.actor-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.actor-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  animation: overlayFadeIn 0.3s ease-out;
}

.actor-modal__content {
  position: relative;
  width: 60vw;
  height: 80vh;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  color: #111;
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.3);
}

.actor-modal__close {
  position: absolute;
  right: 20px;
  top: 20px;
  background: rgba(255,255,255,0.95);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  line-height: 1;
}

.actor-modal__close:hover {
  background: #fff;
  color: #ef4444;
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.actor-modal__inner {
  padding: 0;
  overflow: auto;
  width: 100%;
  height: 100%;
}

/* 상세 2열 레이아웃 */
.actor-detail {
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
}

.actor-detail__left {
  overflow: hidden;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.actor-detail__left .actor-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.actor-detail__left .actor-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.actor-detail__left .actor-slide.active {
  opacity: 1;
}

.actor-detail__left .actor-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.actor-detail__left .actor-slide:hover img {
  transform: scale(1.05);
}

.actor-detail__nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.3s ease;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.actor-detail__nav-btn:hover {
  background: rgba(0,0,0,0.75);
  transform: translateY(-50%) scale(1.1);
}

.actor-detail__nav-btn.prev {
  left: 16px;
}

.actor-detail__nav-btn.next {
  right: 16px;
}

.actor-detail__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  display: flex;
  gap: 8px;
  justify-content: center;
  z-index: 5;
}

.actor-detail__dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.actor-detail__dots button:hover {
  background: rgba(255,255,255,0.8);
  transform: scale(1.2);
}

.actor-detail__dots button.active {
  background: #667eea;
  width: 28px;
  border-radius: 5px;
}

.actor-detail__right {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.actor-detail__name {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.actor-detail__meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #64748b;
  margin-bottom: 20px;
  font-size: 15px;
}

.actor-detail__meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: var(--transition);
}

.actor-detail__meta-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.actor-detail__meta-item .label {
  color: #94a3b8;
  font-size: 13px;
}

.actor-detail__meta-item .value {
  color: #1e293b;
  font-weight: 700;
}

.actor-detail__tags {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actor-detail__tags .tag {
  background: var(--gradient-secondary);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
  transition: var(--transition);
}

.actor-detail__tags .tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(240, 147, 251, 0.45);
}

.actor-detail__section {
  margin: 20px 0;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.actor-detail__section h4 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.actor-detail__section h4::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.actor-detail__section p {
  margin: 0;
  line-height: 1.8;
  color: #475569;
  white-space: pre-wrap;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================== 반응형 ==================== */
@media (max-width: 1200px) {
  .actor-modal__content {
    width: 75vw;
    height: 85vh;
  }
}

@media (max-width: 900px) {
  .actor-detail {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .actor-detail__left {
    height: 350px;
  }
  .actor-modal__content {
    width: 85vw;
    height: 90vh;
  }
  .actor-detail__name {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .actor-directory__filters {
    padding: 18px;
    gap: 14px;
    flex-direction: column;
  }
  .filters-left,
  .filters-right {
    width: 100%;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group label {
    min-width: unset;
  }
  .name-search input[type="text"],
  .actor-tag-input-wrap input[type="text"],
  .gender-select,
  .birth-year-input,
  .height-weight-input {
    width: 100%;
  }
  .alpha-bar {
    gap: 5px;
  }
  .alpha-bar .alpha-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .actor-directory__grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 4px;
  }
  .actor-card__dob-age {
    font-size: 11px;
  }
  .actor-card__name {
    font-size: 16px;
  }
  .actor-modal__content {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    border-radius: 20px;
  }
  .actor-detail__left {
    height: 280px;
  }
  .actor-detail__right {
    padding: 24px;
  }
  .actor-detail__name {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .actor-directory__grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
  .actor-card__meta {
    padding: 14px;
  }
  .actor-detail__name {
    font-size: 22px;
  }
  .actor-detail__meta-inline {
    flex-direction: column;
    gap: 8px;
  }
  .actor-detail__meta-item {
    padding: 8px 14px;
    font-size: 14px;
  }
}

/* ==================== 페이지네이션 ==================== */
.actor-pagination {
  margin-top: 40px;
  margin-bottom: 40px;
}

.pagination-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination-info {
  margin-right: 16px;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  border-color: #667eea;
  color: #667eea;
  background: #f1f5f9;
}

.page-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.page-btn.active:hover {
  background: var(--gradient-primary);
  color: #fff;
}

.page-ellipsis {
  color: #94a3b8;
  padding: 0 4px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .pagination-wrap {
    gap: 6px;
  }

  .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
    margin-right: 0;
  }
}
