/* Modern Dark Theme for PersonaPPT */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #2d1b69 100%);
  color: #ffffff;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

/* Header Styling */
header {
  text-align: center;
  margin-bottom: 60px;
}

header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, #ffffff 0%, #a855f7 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

header small {
  font-size: 1.2rem;
  color: #94a3b8;
  display: block;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
}

/* Main Card */
.card {
  background: rgba(15, 20, 25, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Form Elements */
.row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.col {
  flex: 1;
  min-width: 300px;
}

label {
  display: block;
  margin: 0 0 12px 0;
  font-weight: 600;
  font-size: 1.1rem;
  color: #f1f5f9;
}

input[type="file"] {
  width: 100%;
  padding: 16px;
  border: 2px dashed rgba(168, 85, 247, 0.3);
  border-radius: 16px;
  background: rgba(15, 20, 25, 0.5);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

input[type="file"]:hover {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(15, 20, 25, 0.8);
}

/* Option Groups */
.audiences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.audience {
  background: rgba(30, 41, 59, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.audience:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

.audience input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #a855f7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 16px 32px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.4);
}

.btn:disabled {
  background: rgba(71, 85, 105, 0.5);
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.secondary {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

/* 🎯 카드 스타일 진행률 애니메이션 (옵션 3) */
.progress-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90%;
  max-width: 480px;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: cardSlideIn 0.5s ease-out;
}

.progress-card-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 999;
  animation: overlayFadeIn 0.3s ease-out;
}

.progress-header {
  text-align: center;
  margin-bottom: 24px;
}

.progress-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.progress-subtitle {
  font-size: 1rem;
  color: #94a3b8;
  margin: 0;
}

/* 5단계 도트 표시기 */
.step-indicators {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0;
  position: relative;
}

.step-indicators::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-50%);
  z-index: 1;
}

.step-indicator {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.3);
  border: 2px solid rgba(148, 163, 184, 0.5);
  transition: all 0.3s ease;
  position: relative;
  margin-bottom: 8px;
}

.step-dot.completed {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.step-dot.active {
  background: #a855f7;
  border-color: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
  animation: stepPulse 2s ease-in-out infinite;
}

.step-dot.active::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: 50%;
  animation: stepRipple 2s ease-out infinite;
}

.step-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  opacity: 0.7;
  transition: all 0.3s ease;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-indicator.active .step-label,
.step-indicator.completed .step-label {
  color: #ffffff;
  opacity: 1;
  font-weight: 500;
}

/* 진행률 정보 카드 */
.progress-info-card {
  background: rgba(30, 35, 45, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.progress-mode {
  font-size: 1.1rem;
  font-weight: 600;
  color: #a855f7;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-mode .icon {
  font-size: 1.2rem;
}

/* 메인 진행률 바 */
.progress-bar-container {
  margin: 16px 0;
}

.progress-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7 0%, #22c55e 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
  width: 0%;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}

.progress-percentage {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  text-align: right;
  margin-top: 8px;
}

/* 통계 정보 */
.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.progress-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-stat-label {
  font-size: 0.85rem;
  color: #94a3b8;
}

.progress-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

/* 현재 작업 표시 */
.current-task {
  text-align: center;
  margin: 20px 0 0 0;
  padding: 16px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 8px;
}

.current-task-label {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0 0 4px 0;
}

.current-task-text {
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

/* 기존 작은 progress 애니메이션 (버튼 내부용) */
.ppt-progress {
  display: inline-block;
  width: 32px;
  height: 24px;
  position: relative
}

.ppt-progress .slide {
  position: absolute;
  width: 18px;
  height: 12px;
  background: #22c55e;
  border-radius: 3px;
  opacity: 0.4
}

.ppt-progress .slide:nth-child(1) {
  left: 0;
  top: 0;
  animation: slideTransform 2s ease-in-out infinite;
  animation-delay: 0s
}

.ppt-progress .slide:nth-child(2) {
  left: 4px;
  top: 3px;
  animation: slideTransform 2s ease-in-out infinite;
  animation-delay: 0.3s
}

.ppt-progress .slide:nth-child(3) {
  left: 8px;
  top: 6px;
  animation: slideTransform 2s ease-in-out infinite;
  animation-delay: 0.6s
}

.ppt-progress .arrow {
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  color: #22c55e;
  font-size: 12px;
  animation: pulse 1.5s ease-in-out infinite
}

/* 애니메이션 키프레임 */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes stepPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes stepRipple {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes progressShimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes slideTransform {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1)
  }

  50% {
    opacity: 1;
    transform: scale(1.1)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1)
  }

  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2)
  }
}

/* Status Display */
.status {
  margin-top: 24px;
  font-size: 1rem;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(10px);
}

.status.working {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(4, 47, 46, 0.4);
}

.status.error {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(69, 10, 10, 0.4);
}

.status.success {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(5, 46, 22, 0.4);
}

/* File Upload Area */
.upload-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #a855f7;
}

/* Footer */
.footer {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-top: 20px;
  color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 40px 16px;
  }

  header h1 {
    font-size: 2.5rem;
  }

  header small {
    font-size: 1rem;
  }

  .card {
    padding: 24px;
    border-radius: 16px;
  }

  .audiences {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    margin: 4px 0;
  }

  /* 진행률 카드 반응형 */
  .progress-card {
    width: 95%;
    max-width: none;
    padding: 24px 20px;
  }

  .progress-title {
    font-size: 1.3rem;
  }

  .step-label {
    font-size: 0.7rem;
    min-height: 25px;
  }

  .progress-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .step-indicators {
    margin: 20px 0;
  }

  .step-dot {
    width: 14px;
    height: 14px;
  }
}

/* Button Container */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 640px) {
  .button-container {
    flex-direction: row;
    justify-content: center;
  }
}

/* Tab Navigation Styles */
.tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 32px 0;
  padding: 0 24px;
}

.tab {
  background: rgba(15, 20, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.tab:hover {
  background: rgba(25, 30, 35, 0.8);
  border-color: rgba(168, 85, 247, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

.tab.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border-color: rgba(168, 85, 247, 0.5);
  color: #ffffff;
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.3);
}

.tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
  border-radius: 12px;
  z-index: -1;
}

.tab span:first-child {
  font-size: 1.2rem;
}

/* Tab Content Styles */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Upload Section Styling */
.upload-section {
  margin-bottom: 24px;
}

/* Textarea Styles */
.textarea {
  width: 100%;
  background: rgba(15, 20, 25, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 1rem;
  font-family: inherit;
  color: #ffffff;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  margin-top: 8px;
}

.textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(25, 30, 35, 0.7);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

.textarea::placeholder {
  color: #64748b;
  font-style: italic;
}

.textarea:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(20, 25, 30, 0.6);
}

/* Mobile Responsive for Tabs */
@media (max-width: 768px) {
  .tabs {
    flex-direction: column;
    gap: 8px;
    margin: 24px 0;
    padding: 0 16px;
  }

  .tab {
    width: 100%;
    justify-content: center;
    padding: 16px 20px;
    font-size: 1.1rem;
  }

  .textarea {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
  }
}

/* Prompt Suggestion Buttons */
.prompt-suggestion {
  background: rgba(25, 30, 35, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #a855f7;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.prompt-suggestion:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.prompt-suggestion:active {
  transform: translateY(0);
}

/* 페르소나 프롬프트 편집 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}

.modal-content {
  background: linear-gradient(135deg, #1a1f2e 0%, #2d1b69 100%);
  margin: 5% auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
}

.prompt-section {
  margin-bottom: 24px;
}

.prompt-section label {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.9rem;
}

#prompt-textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.2s ease;
}

#prompt-textarea:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

#prompt-textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  border: none;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00b8e6 0%, #0088bb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* 페르소나 선택 버튼 스타일 개선 */
.audience {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-prompt-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  margin-left: auto;
}

.edit-prompt-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  transform: scale(1.05);
}

/* 모달이 열릴 때의 애니메이션 */
.modal.show {
  display: block;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 알림 애니메이션 */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}
