/* 프리미엄 UI 스타일 */

/* 프리미엄 배지 */
.premium-badge {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  vertical-align: middle;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* 사용 횟수 표시 */
.usage-display {
  margin: 20px 0;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.free-status, .premium-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-icon {
  font-size: 24px;
}

.status-text {
  flex: 1;
  font-size: 16px;
  color: var(--fg);
}

.status-text strong {
  color: var(--brand);
  font-weight: 600;
}

.status-warning {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.upgrade-link {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #5ac8fa, #4a9fd9);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.upgrade-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90, 200, 250, 0.3);
}

.upgrade-link:active {
  transform: translateY(0);
}

/* 모드 섹션 힌트 */
.mode-section-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 16px 0;
  text-align: center;
}

.badge-legend {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.free-legend {
  background: rgba(76, 175, 80, 0.9);
  color: white;
}

.premium-legend {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
}

/* 모드 배지 */
.mode-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 2;
  white-space: nowrap;
}

.premium-badge-small {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.free-badge-small {
  background: rgba(76, 175, 80, 0.9);
  color: white;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

/* 잠긴 모드 버튼 */
.mode-btn.locked {
  opacity: 0.6;
  position: relative;
  cursor: pointer !important;
}

.mode-btn.locked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.1);
  border-radius: 12px;
  pointer-events: none;
}

.lock-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  z-index: 1;
}

.mode-btn.locked:hover {
  border-color: #FFD700;
  transform: translateY(-2px);
}

/* 업그레이드 모달 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--fg);
}

.modal-header {
  text-align: center;
  margin-bottom: 32px;
}

.premium-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.modal-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 8px 0;
  padding: 0;
  border: none;
}

.modal-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

/* 기능 목록 */
.premium-features {
  margin-bottom: 32px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease-out;
  animation-fill-mode: both;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.15s; }
.feature-item:nth-child(3) { animation-delay: 0.2s; }
.feature-item:nth-child(4) { animation-delay: 0.25s; }
.feature-item:nth-child(5) { animation-delay: 0.3s; }
.feature-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feature-text strong {
  display: block;
  font-size: 16px;
  color: var(--fg);
  margin-bottom: 4px;
}

.feature-text p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* 가격 */
.pricing {
  text-align: center;
  margin-bottom: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(90, 200, 250, 0.1), rgba(74, 159, 217, 0.1));
  border-radius: 12px;
  border: 2px solid rgba(90, 200, 250, 0.2);
}

.price-tag {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.price-amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--brand);
}

.price-period {
  font-size: 14px;
  color: var(--muted);
}

.price-note {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* 버튼 */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-premium {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.btn-premium:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--border);
  color: var(--fg);
  font-size: 14px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--border-light);
}

.modal-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* 성공 토스트 */
.success-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #10b981;
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

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

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 24px;
}

.toast-text {
  font-size: 15px;
  font-weight: 500;
}

/* 해상도 설정 섹션 */
.resolution-section {
  margin: 24px 0;
}

.resolution-hint {
  margin: 8px 0 12px 0;
  padding: 8px 12px;
  background: rgba(90, 200, 250, 0.1);
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  font-size: 13px;
  color: var(--brand);
  font-weight: 500;
}

.resolution-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resolution-option {
  position: relative;
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.resolution-option:hover {
  border-color: var(--brand);
  background: rgba(90, 200, 250, 0.05);
}

.resolution-option input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--brand);
}

.resolution-option input[type="radio"]:checked + .option-content {
  color: var(--brand);
}

.resolution-option input[type="radio"]:checked ~ .option-content .option-icon {
  filter: grayscale(0);
}

.option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fg);
  transition: color 0.2s;
}

.option-icon {
  font-size: 24px;
  margin-bottom: 4px;
  filter: grayscale(0.5);
  transition: filter 0.2s;
}

.option-label {
  font-size: 16px;
  font-weight: 600;
  color: inherit;
}

.option-desc {
  font-size: 13px;
  color: var(--muted);
}

.resolution-option .mode-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* 반응형 */
@media (max-width: 768px) {
  .modal-content {
    padding: 24px;
    width: 95%;
  }
  
  .resolution-option {
    padding: 12px;
  }
  
  .option-icon {
    font-size: 20px;
  }
  
  .option-label {
    font-size: 15px;
  }
  
  .option-desc {
    font-size: 12px;
  }
  
  .premium-icon {
    font-size: 48px;
  }
  
  .modal-header h2 {
    font-size: 24px;
  }
  
  .price-amount {
    font-size: 32px;
  }
  
  .feature-text strong {
    font-size: 15px;
  }
  
  .feature-text p {
    font-size: 13px;
  }
  
  .success-toast {
    width: 90%;
    padding: 12px 16px;
  }
  
  .toast-text {
    font-size: 14px;
  }
}

/* 스크롤바 스타일 (모달용) */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--card-bg);
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
