/**
 * 모달 및 팝업 스타일
 */

/* ============================================
   불러오기 모달 (Load Modal)
   ============================================ */
.load-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.load-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.load-modal-content {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: calc(100% - 1rem);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 1001;
}

@media (min-width: 640px) {
  .load-modal-content {
    width: 100%;
    border-radius: 1rem;
  }
}

.load-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.load-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.load-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s, color 0.2s;
}

.load-modal-close:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.load-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  /* 모바일에서 스크롤 개선 */
  -webkit-overflow-scrolling: touch;
  /* 스크롤 영역 명확히 표시 */
  min-height: 0;
  /* 스크롤바 스타일 개선 (웹킷 브라우저) */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #cbd5e1 #f1f5f9; /* Firefox */
}

/* 웹킷 브라우저 스크롤바 스타일 */
.load-modal-body::-webkit-scrollbar {
  width: 8px;
}

.load-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.load-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.load-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.load-list-container {
  min-height: 200px;
  /* 스크롤 가능한 영역임을 명확히 표시 */
  position: relative;
}

.load-list-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.load-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.load-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.load-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.load-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.load-item p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 0.5rem 0;
}

.load-item-delete {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.load-item-delete:hover {
  background-color: #fee2e2;
}

/* 불러오기 모달 반응형 디자인 */
@media (max-width: 640px) {
  .load-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .load-modal-header {
    padding: 1rem;
  }

  .load-modal-title {
    font-size: 1.25rem;
  }

  .load-modal-body {
    padding: 1rem;
    /* 모바일에서 스크롤 강제 활성화 */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: calc(90vh - 120px); /* 헤더 높이 고려 */
  }

  .load-item {
    padding: 0.75rem;
  }

  .load-item h4 {
    font-size: 0.875rem;
  }

  .load-item p {
    font-size: 0.75rem;
  }
}

/* ============================================
   의뢰 제한 팝업 (Limit Popup)
   ============================================ */
.limit-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.limit-popup-overlay.limit-popup-show {
  opacity: 1;
}

.limit-popup-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.limit-popup-overlay.limit-popup-show .limit-popup-content {
  transform: scale(1);
}

.limit-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
}

.limit-popup-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: white;
}

.limit-popup-close {
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.limit-popup-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.limit-popup-body {
  padding: 24px;
}

.limit-popup-message {
  font-size: 16px;
  color: #374151;
  margin: 0 0 20px 0;
  line-height: 1.6;
  text-align: center;
}

.limit-popup-time-info {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.limit-popup-time-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.limit-popup-time-item:not(:last-child) {
  border-bottom: 1px solid #e5e7eb;
}

.limit-popup-time-label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.limit-popup-time-value {
  font-size: 18px;
  color: #1f2937;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.limit-popup-note {
  font-size: 13px;
  color: #9ca3af;
  margin: 16px 0 0 0;
  text-align: center;
}

.limit-popup-api-info {
  font-size: 14px;
  color: #4b5563;
  margin: 0 0 12px 0;
  text-align: center;
  line-height: 1.6;
}

.limit-popup-api-info strong {
  color: var(--primary-color);
  font-weight: 600;
}

.limit-popup-policy {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 20px 0;
  text-align: center;
  line-height: 1.6;
}

.limit-popup-policy strong {
  color: #1f2937;
  font-weight: 600;
}

.limit-popup-solution {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0 0 0;
}

.limit-popup-solution-title {
  font-size: 14px;
  color: #92400e;
  font-weight: 600;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.limit-popup-solution-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: #78350f;
  line-height: 1.8;
}

.limit-popup-solution-list li {
  margin: 8px 0;
}

.limit-popup-solution-list strong {
  color: #92400e;
  font-weight: 600;
}

.limit-popup-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
}

.limit-popup-button {
  background: linear-gradient(135deg, #ff6b6b 0%, #e85a5a 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 120px;
}

.limit-popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.35);
}

.limit-popup-button:active {
  transform: translateY(0);
}

/* 의뢰 제한 팝업 반응형 디자인 */
@media (max-width: 640px) {
  .limit-popup-content {
    width: 95%;
    max-width: none;
  }

  .limit-popup-header {
    padding: 16px 20px;
  }

  .limit-popup-title {
    font-size: 18px;
  }

  .limit-popup-body {
    padding: 20px;
  }

  .limit-popup-time-info {
    padding: 16px;
  }

  .limit-popup-time-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .limit-popup-time-value {
    font-size: 16px;
  }

  .limit-popup-footer {
    padding: 12px 20px;
  }

  .limit-popup-button {
    width: 100%;
    padding: 14px;
  }

  .limit-popup-api-info {
    font-size: 13px;
  }

  .limit-popup-policy {
    font-size: 12px;
  }

  .limit-popup-solution {
    padding: 14px;
  }

  .limit-popup-solution-title {
    font-size: 13px;
  }

  .limit-popup-solution-list {
    font-size: 12px;
  }
}

