/* 기본 스타일 */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #f8f9fa;
  --accent-color: #007bff;
  --success-color: #28a745;
  --warning-color: #dc3545;
  --border-radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  line-height: 1.6;
}

/* 레이아웃 */
.container-fluid {
  padding: 0;
}

.left-panel, .right-panel {
  min-height: 100vh;
  padding: 2rem;
}

.left-panel {
  background: #f8f9fa;
  color: #2c3e50;
}

.right-panel {
  background-color: white;
  border-left: 1px solid #e9ecef;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  height: fit-content;
}

/* 헤더 */
.header {
  margin-bottom: 2rem;
  text-align: center;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

/* 팀 섹션 */
.team-section {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.team-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.participant-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* 참가자 그리드 */
.participants-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 팀별 섹션 */
.team-section-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid #e9ecef;
}

.team-header-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.team-name-item {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  color: var(--primary-color);
}

.participant-count-item {
  background: var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: white;
}

.participants-grid-item {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* 참가자 카드 */
.participant-card {
  background: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.participant-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  background: white;
  border-color: var(--accent-color);
}

.participant-card.selected {
  background: white;
  border: 2px solid var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* 다운로드 버튼 */
.download-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  z-index: 10;
  opacity: 0.8;
}

.download-btn:hover {
  background: #0056b3;
  opacity: 1;
  transform: scale(1.1);
}

/* 아바타 */
.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  background: var(--accent-color);
  color: white;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.participant-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.participant-sns {
  font-size: 0.9rem;
  color: #6c757d;
}

/* 폼 컨테이너 */
.form-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

/* 폼 요소들 */
.form-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.form-control {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 사진 업로드 영역 */
.photo-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.photo-upload-area:hover {
  border-color: var(--accent-color);
  background: #e3f2fd;
}

.upload-placeholder {
  color: #6c757d;
}

.upload-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* 사진 미리보기 */
.photo-preview {
  text-align: center;
}

.photo-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* 버튼 */
.btn {
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), #0056b3);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-save {
  background: linear-gradient(135deg, var(--success-color), #1e7e34);
  color: white;
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.btn-save:hover {
  background: linear-gradient(135deg, #1e7e34, var(--success-color));
}

/* 모달 */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 모달 접근성 개선 */
.modal.show {
  display: block !important;
}

.modal.show[aria-hidden="true"] {
  display: none !important;
}

/* 모달 z-index 조정 */
.modal {
  z-index: 1050;
}

.modal-backdrop {
  z-index: 1040;
}

/* 크롭 모달이 다른 모달보다 위에 표시되도록 */
#cropModal {
  z-index: 1060 !important;
}

#cropModal .modal-backdrop {
  z-index: 1055 !important;
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: var(--primary-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.5rem;
}

/* 크롭 컨테이너 */
.crop-container {
  max-height: 400px;
  overflow: hidden;
  border-radius: 8px;
}

.crop-container img {
  max-width: 100%;
  height: auto;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .left-panel {
    padding: 1rem;
  }
  
  .right-panel {
    display: none; /* 모바일에서 우측 패널 숨김 */
    position: static; /* 모바일에서 sticky 효과 비활성화 */
  }
  
  .title {
    font-size: 2rem;
  }
  
  .participants-grid {
    gap: 1.5rem;
  }
  
  .participants-grid-item {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }
  
  .participant-card {
    padding: 1rem;
  }
  
  .avatar {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .form-container {
    padding: 1.5rem;
  }
  
  .team-section-item {
    padding: 1rem;
  }
  
  .team-name-item {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .participants-grid-item {
    grid-template-columns: 1fr;
  }
  
  .team-header, .team-header-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* 로딩 스피너 */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* 유틸리티 클래스 */
.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.text-center {
  text-align: center !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
