/* === 문제 보내기 모달 === */

.cs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: cs-fade-in 0.2s ease;
}

@keyframes cs-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cs-modal {
  background: var(--night-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px var(--shadow);
}

.cs-modal::-webkit-scrollbar {
  width: 4px;
}
.cs-modal::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

/* 대상 선택 탭 */
.cs-target-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.cs-target-tab {
  flex: 1;
  padding: 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--sand-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s, border-color 0.2s;
}
.cs-target-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.cs-target-tab:hover {
  color: var(--sand);
}

/* 그룹 목록 */
.cs-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
}
.cs-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--night-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color 0.2s;
}
.cs-group-item:hover {
  border-color: var(--gold-muted);
}
.cs-group-item-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cs-group-item-emoji {
  font-size: 1.2rem;
}
.cs-group-item-name {
  font-size: 0.88rem;
  color: var(--sand);
}
.cs-group-item-btn {
  background: var(--gold);
  color: var(--night);
  border: none;
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.cs-group-item-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 사용자 검색 */
.cs-user-search {
  margin-top: 0.5rem;
}
.cs-user-search-input {
  background: var(--night-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.75rem;
  color: var(--sand);
  font-size: 0.88rem;
  width: 100%;
  margin-bottom: 0.5rem;
}
.cs-user-search-input:focus {
  outline: none;
  border-color: var(--gold);
}
.cs-user-search-results {
  max-height: 180px;
  overflow-y: auto;
}
.cs-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.3rem;
  border-bottom: 1px solid var(--border);
}
.cs-user-row:last-child {
  border-bottom: none;
}
.cs-user-name {
  font-size: 0.88rem;
  color: var(--sand);
}
.cs-user-send-btn {
  background: var(--gold);
  color: var(--night);
  border: none;
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.cs-user-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 빈 상태 */
.cs-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--sand-dark);
  font-size: 0.85rem;
}

/* 문제 미리보기 */
.cs-preview {
  background: var(--night-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--sand-dark);
  line-height: 1.4;
}
.cs-preview-label {
  font-size: 0.75rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

/* 모바일 */
@media (max-width: 600px) {
  .cs-modal {
    max-height: 85vh;
  }
}
