/* ===== 모달 스타일 ===== */
.modal {
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.6);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: none;
  opacity: 0;
  visibility: hidden;
}

.modal.show {
  opacity: 1;
  visibility: visible;
  display: block;
}

.modal-content {
  background-color: #fff;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 30px rgba(0,0,0,0.2);
  width: 80%;
  max-width: 800px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: modalAppear 0.3s ease-in-out;
  box-sizing: border-box;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 모든 모달 컨텐츠 가운데 정렬 */
#payment-modal .modal-content,
#youtube-modal .modal-content,
#email-modal .modal-content,
#terms-modal .modal-content,
#privacy-policy-modal .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--white);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.5);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.close-modal:hover {
  color: var(--white);
  background-color: rgba(0, 0, 0, 0.8);
}

#modal-details {
  margin: 20px 0;
  padding-right: 10px;
  overflow: visible;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* 플랜 상세 정보 스타일 */
.plan-detail-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-detail-header h3 {
  font-size: 24px;
  margin: 0;
}

.plan-badge {
  background-color: var(--purple-light);
  color: var(--purple-dark);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.plan-subtitle {
  font-size: 17px;
  margin-bottom: 15px;
  color: #333;
}

.plan-features-list {
  padding-left: 20px;
}

.plan-features-list li {
  margin-bottom: 12px;
  font-size: 16px;
  position: relative;
}

.plan-features-list li:before {
  content: '✓';
  color: var(--purple);
  font-weight: bold;
  display: inline-block;
  width: 20px;
  margin-left: -20px;
}

.plan-detail-content {
  border-top: 1px solid #eee;
  padding-top: 20px;
}

/* 결제 모달 스타일 */
.payment-step-info {
  background: rgba(139, 69, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.payment-step-info p {
  margin: 5px 0;
}

.payment-step-info strong {
  color: var(--purple-dark);
  font-size: 1.1rem;
}

/* 라디오 버튼 그룹 스타일 */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.radio-label:hover {
  border-color: var(--purple-light);
  background-color: rgba(213, 140, 236, 0.05);
}

.radio-label input[type="radio"] {
  margin-right: 12px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.radio-label input[type="radio"]:checked + .radio-text {
  color: var(--purple-dark);
  font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
  border-color: var(--purple);
  background-color: rgba(213, 140, 236, 0.1);
}

.radio-text {
  font-size: 16px;
  color: #333;
  transition: all 0.3s ease;
}

/* 플랫폼 입력 필드 공통 스타일 */
.platform-input {
  margin-top: -6px;
  padding-left: 2.5rem;
  padding-right: 1rem;
}

#other-input input + input {
  margin-top: 10px;
}

.platform-input input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--purple-light);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.platform-input input:focus {
  outline: none;
  border-color: var(--purple-dark);
  box-shadow: 0 0 0 3px rgba(213, 140, 236, 0.2);
}

.platform-notice {
  background: linear-gradient(135deg, #fff3e0 0%, #e3f2fd 100%);
  border: 2px solid #2196f3;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.platform-notice p {
  margin: 0;
  color: #1565c0;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
}

.platform-notice strong {
  color: #0d47a1;
  font-weight: 700;
  font-size: 1.1em;
}

/* 유튜브 모달 스타일 */
.youtube-modal-content {
  max-width: 900px;
  width: 90%;
}

.youtube-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.youtube-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 이메일 폼 스타일 */
.email-modal-content {
  max-width: 500px;
  width: 90%;
  box-sizing: border-box;
  margin: 10% auto;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
}

#emailForm {
  margin-top: 20px;
}

#emailForm .form-group {
  margin-bottom: 15px;
}

#emailForm label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

#emailForm input,
#emailForm textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

#emailForm textarea {
  resize: vertical;
  min-height: 100px;
}

#emailForm button {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
}

/* 개인정보처리방침 및 이용약관 모달 */
.privacy-modal-content {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.privacy-content,
.terms-content {
  line-height: 1.6;
  color: #333;
}

.privacy-content h3,
.terms-content h3 {
  color: var(--purple-dark);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.privacy-content p,
.terms-content p {
  margin-bottom: 1rem;
}

/* 알림 스타일 */
.top-alert {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--gradient);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(156,136,255,0.3);
  z-index: 1000;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.top-alert.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.top-alert.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

.slide-alert {
  position: fixed;
  top: 20px;
  right: -400px;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  border: 2px solid #3498db;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  font-size: 14px;
  font-weight: 500;
  max-width: 350px;
  min-width: 250px;
  transition: all 0.3s ease-in-out;
  word-wrap: break-word;
  line-height: 1.4;
  opacity: 0;
}

.slide-alert.show {
  right: 20px;
  opacity: 1;
}

.slide-alert.hide {
  right: -400px;
  opacity: 0;
}

.coming-soon-alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--purple-dark);
  color: white;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  animation: fadeInOut 2s ease-in-out forwards;
}

.alert-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  transition: color 0.2s;
}

.alert-close-btn:hover {
  color: #f0f0f0;
}

/* ===== 범용 플랫폼 선택 모달 스타일 ===== */
#universal-platform-modal {
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#universal-platform-modal.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

.platform-modal-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 30px;
  border: none;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: white;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#universal-platform-modal.show .platform-modal-content {
  opacity: 1;
}

.platform-modal-header h2 {
  margin: 0 0 10px 0;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(45deg, #fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.platform-modal-header p {
  margin: 0 0 25px 0;
  font-size: 1rem;
  opacity: 0.9;
}

.platform-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 25px 0;
}

.platform-option {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 20px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.platform-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.platform-option.selected {
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffd700;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.platform-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.platform-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
}

.platform-desc {
  font-size: 0.8rem;
  opacity: 0.8;
  display: block;
}

.platform-input-section {
  margin: 25px 0;
}

.platform-input-row {
  margin-bottom: 15px;
}

.platform-input-row:last-child {
  margin-bottom: 0;
}

.platform-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.platform-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.platform-input:focus {
  outline: none;
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* 플랫폼 안내 섹션 스타일 */
.platform-notice-section {
  margin: 25px 0;
}

.platform-notice-improved {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(10px);
  text-align: left;
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.notice-icon {
  font-size: 1.5rem;
}

.notice-header strong {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.notice-content p {
  margin: 10px 0;
  line-height: 1.6;
  font-size: 1rem;
}

.notice-highlight {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.notice-support {
  color: #f0f0f0;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.platform-modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 25px;
  flex-wrap: wrap;
}

.platform-modal-actions .btn {
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.platform-modal-actions .btn.single-action {
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
  min-width: 200px;
  padding: 15px 30px;
  font-size: 1.1rem;
}

.platform-modal-actions .btn.single-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

/* 업그레이드 안내 스타일 */
.upgrade-platform-notice {
  background: linear-gradient(135deg, #fff3e0 0%, #e3f2fd 100%);
  border: 2px solid #2196f3;
  border-radius: 15px;
  padding: 25px;
  margin: 20px 0;
  text-align: center;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.upgrade-platform-notice p {
  margin: 10px 0;
  color: #1565c0;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
}

.upgrade-platform-notice strong {
  color: #0d47a1;
  font-weight: 700;
  font-size: 1.1em;
}

.upgrade-platform-notice .btn {
  margin-top: 15px;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: 600;
}

/* 범용 플랫폼 모달 반응형 디자인 */
@media (max-width: 768px) {
  .platform-modal-content {
    padding: 20px;
    width: 95%;
  }
  
  .platform-modal-header h2 {
    font-size: 1.5rem;
  }
  
  .platform-selection {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .platform-option {
    padding: 15px 12px;
  }
  
  .platform-icon {
    font-size: 1.5rem;
  }
  
  .platform-name {
    font-size: 0.9rem;
  }
  
  .platform-desc {
    font-size: 0.75rem;
  }
  
  .platform-modal-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .platform-modal-actions .btn {
    width: 100%;
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  .platform-modal-content {
    padding: 15px;
  }
  
  .platform-modal-header h2 {
    font-size: 1.3rem;
  }
  
  .platform-modal-header p {
    font-size: 0.9rem;
  }
  
  .platform-option {
    padding: 12px 10px;
  }
  
  .platform-notice-improved {
    padding: 15px;
  }
  
  .notice-header strong {
    font-size: 1.1rem;
  }
  
  .notice-content p {
    font-size: 0.9rem;
  }
}

/* 완료 알림창 스타일 */
.completion-alert {
  position: fixed;
  top: 20px;
  right: -450px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 10002;
  max-width: 400px;
  min-width: 350px;
  transition: all 0.4s ease-in-out;
  opacity: 0;
  backdrop-filter: blur(10px);
}

.completion-alert.show {
  right: 20px;
  opacity: 1;
}

.completion-alert-content {
  padding: 25px;
}

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

.alert-icon {
  font-size: 1.8rem;
  margin-right: 10px;
}

.alert-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  flex: 1;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.alert-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.alert-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.alert-body p {
  margin: 12px 0;
  line-height: 1.6;
  font-size: 1rem;
}

.alert-highlight {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.alert-content {
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.alert-support {
  color: #f0f0f0;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 완료 알림창 반응형 */
@media (max-width: 768px) {
  .completion-alert {
    right: -100%;
    left: 10px;
    max-width: calc(100% - 20px);
    min-width: auto;
  }
  
  .completion-alert.show {
    right: auto;
    left: 10px;
  }
  
  .completion-alert-content {
    padding: 20px;
  }
  
  .alert-header h3 {
    font-size: 1.1rem;
  }
  
  .alert-body p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .completion-alert-content {
    padding: 15px;
  }
  
  .alert-header h3 {
    font-size: 1rem;
  }
  
  .alert-body p {
    font-size: 0.9rem;
  }
  
  .alert-highlight {
    font-size: 1rem;
  }
}