/* InsightCast - New Design System */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand Colors - From Figma */
  --primary-start: #00D26A;
  --primary-end: #00E6A0;
  --primary-hover: #00E6A0;
  --primary-button: #00C06B;
  --text-on-green: #ffffff;
  
  /* Backgrounds - From Figma */
  --bg-white: #FFFFFF;
  --bg-gray: #F9FAFB;
  --card-black: #111111;
  
  /* Text Colors - From Figma */
  --text-dark: #101828;
  --text-gray: #4A5565;
  --text-light: #99A1AF;
  --text-secondary: #364153;
  
  /* Borders - From Figma */
  --border-gray: #F3F4F6;
  --border-light: #E5E7EB;
  
  /* Layout - From Figma */
  --container-width: 370px;
  --container-padding: 23.99px;
  
  /* Player Height */
  --player-height: 220px;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--bg-white);
  color: var(--text-dark);
  padding-bottom: var(--player-height);
  line-height: 1.6;
}

/* ============================================
   1. Hero Section
   ============================================ */
.hero-section {
  background: linear-gradient(180deg, var(--primary-start) 0%, var(--primary-end) 100%);
  padding: 80px 24px 0 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 322px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding-bottom: 80px;
}

.hero-title {
  font-size: 48px;
  font-weight: 400;
  color: white;
  margin-bottom: 24px;
  line-height: 1em;
  letter-spacing: 0;
}

.hero-subtitle {
  font-size: 20px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 24px;
  font-weight: 400;
  line-height: 1.4em;
}

.hero-tagline {
  font-size: 16px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 40px;
  line-height: 1.5em;
  max-width: 322px;
  margin-left: auto;
  margin-right: auto;
}

.btn-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--primary-button);
  padding: 14px 28px;
  border-radius: 9999px;
  border: none;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  line-height: 1.42857em;
}

.btn-hero-cta:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.btn-hero-cta i {
  color: var(--primary-button);
  font-size: 14px;
}

/* ============================================
   2. How It Works Section (Single Card)
   ============================================ */
.how-it-works-section {
  background: var(--bg-white);
  padding: 64px 24px;
}

.how-it-works-container {
  max-width: 322px;
  margin: 0 auto;
}

.how-it-works-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 16px;
  padding: 33px 33px 32px 33px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
}

.how-it-works-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.icon-container {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  background: linear-gradient(180deg, var(--primary-start) 0%, var(--primary-end) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-container i {
  font-size: 16px;
  color: white;
}

.card-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 16px;
  line-height: 1.5em;
}

.card-description {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.625em;
}

/* Legacy styles for backward compatibility */
.how-it-works-content {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 48px;
}

.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.how-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  transition: all 0.2s;
  cursor: default;
}

.how-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.how-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-card-icon i {
  font-size: 32px;
  color: white;
}

.how-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.how-card-desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.6;
}

/* ============================================
   3. Recent Episodes Section
   ============================================ */
.episodes-section {
  background: var(--bg-gray);
  padding: 48px 24px;
  min-height: 400px;
}

.episodes-content {
  max-width: 800px;
  margin: 0 auto;
}

.episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.episodes-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

.episodes-count {
  background: #e5e7eb;
  color: var(--text-gray);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.episode-card {
  background: var(--card-black);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.episode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.episode-card.playing {
  box-shadow: 0 0 0 2px var(--primary-start), 0 8px 24px rgba(0,210,106,0.2);
}

.episode-thumbnail {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.episode-thumbnail i {
  font-size: 24px;
  color: white;
  z-index: 1;
}

/* Gradient Colors - From Figma */
.gradient-purple-pink {
  background: linear-gradient(135deg, rgba(173, 70, 255, 1) 0%, rgba(246, 51, 154, 1) 100%);
}

.gradient-blue-cyan {
  background: linear-gradient(135deg, rgba(43, 127, 255, 1) 0%, rgba(0, 184, 219, 1) 100%);
}

.gradient-orange-red {
  background: linear-gradient(135deg, rgba(255, 105, 0, 1) 0%, rgba(251, 44, 54, 1) 100%);
}

.gradient-green-emerald {
  background: linear-gradient(135deg, rgba(0, 201, 80, 1) 0%, rgba(0, 188, 125, 1) 100%);
}

.gradient-indigo-purple {
  background: linear-gradient(135deg, rgba(97, 95, 255, 1) 0%, rgba(173, 70, 255, 1) 100%);
}

.gradient-pink-rose {
  background: linear-gradient(135deg, rgba(246, 51, 154, 1) 0%, rgba(255, 32, 86, 1) 100%);
}

.gradient-teal-green {
  background: linear-gradient(135deg, rgba(0, 187, 167, 1) 0%, rgba(0, 201, 80, 1) 100%);
}

.episode-info {
  flex: 1;
  min-width: 0;
}

.episode-title {
  font-size: 15px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-meta {
  font-size: 13px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
}

.episode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-episode-info {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1f2937;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-episode-info:hover {
  background: #374151;
  color: white;
}

.btn-episode-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary-start);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,210,106,0.3);
}

.btn-episode-play:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.episode-card.playing .btn-episode-play {
  box-shadow: 0 4px 16px rgba(0,210,106,0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* New Episode Card Design */
.episodes-container {
  max-width: 322px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.5em;
}

.episode-count-badge {
  background: var(--border-light);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
}

.episode-card-new {
  background: var(--card-black);
  border-radius: 16px;
  padding: 0 16px;
  height: 88px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.episode-card-new:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.episode-card-new.playing {
  box-shadow: 0px 4px 6px -4px rgba(0, 210, 106, 0.2), 0px 10px 15px -3px rgba(0, 210, 106, 0.2), 0px 0px 0px 2px rgba(0, 210, 106, 1);
}

.episode-thumbnail {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.episode-thumbnail i {
  font-size: 22px;
  color: white;
}

.episode-info-new {
  flex: 1;
  min-width: 0;
}

.episode-title-new {
  font-size: 16px;
  font-weight: 400;
  color: white;
  margin: 0 0 4px 0;
  line-height: 1.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-date-new {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.42857em;
}

.episode-actions-new {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.info-btn-new {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1f2937;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.info-btn-new:hover {
  background: #374151;
  color: white;
}

.play-btn-new {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary-start);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,210,106,0.3);
}

.play-btn-new:hover {
  background: var(--primary-hover);
  transform: scale(1.08);
}

.play-btn-new:disabled {
  background: #4b5563;
  cursor: not-allowed;
  box-shadow: none;
}

.episode-card-new.playing .play-btn-new {
  animation: pulse 2s infinite;
}

/* ============================================
   4. Bottom Player Bar
   ============================================ */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border-gray);
  box-shadow: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 50;
  padding: 16px 24px;
}

.player-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Controls Row - Figma Design */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  padding-top: 16px;
}

.player-control-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.player-control-btn:hover:not(:disabled) {
  color: var(--text-gray);
  transform: scale(1.1);
}

.player-control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.player-control-btn i {
  font-size: 20px;
}

.player-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-start);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 4px 6px -4px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.player-play-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.player-play-btn:disabled {
  background: #e5e7eb;
  cursor: not-allowed;
}

.player-play-btn i {
  font-size: 24px;
}

/* Progress Row - Figma Design */
.player-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.player-time {
  font-size: 14px;
  color: var(--text-gray);
  min-width: 40px;
  font-family: Arial, sans-serif;
}

.player-progress-container {
  flex: 1;
  height: 16px;
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.player-progress-track {
  position: absolute;
  width: 100%;
  height: 16px;
  background: #ECECF0;
  border-radius: 100px;
}

.player-progress-fill {
  position: absolute;
  height: 16px;
  background: #030213;
  border-radius: 100px;
  transition: width 0.1s linear;
  z-index: 1;
}

.player-progress-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border: 1px solid #030213;
  border-radius: 50%;
  box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
  z-index: 2;
  transition: left 0.1s linear;
  cursor: grab;
}

.player-progress-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

/* Episode Title - Figma Design */
.player-title-row {
  text-align: center;
  margin-bottom: 16px;
  padding: 0 24px;
}

.player-episode-title {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 400;
  font-family: Arial, sans-serif;
  line-height: 1.43;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Navigation Bar - Figma Design */
.player-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  border-top: 1px solid var(--border-gray);
  padding-top: 12px;
}

.player-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s;
}

.player-nav-btn:hover {
  color: var(--text-gray);
}

.player-nav-btn i {
  font-size: 20px;
}

.player-nav-btn span {
  font-size: 12px;
  font-weight: 400;
  font-family: Arial, sans-serif;
  line-height: 1.33;
}

/* Active states - Figma Design */
.player-nav-home {
  color: var(--primary-start);
}

.player-nav-home:hover {
  color: var(--primary-hover);
}

.player-nav-playing,
.player-nav-bookmark {
  color: var(--text-light);
}

/* ============================================
   Modal Styles
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: var(--text-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #e5e7eb;
  color: var(--text-dark);
}

.modal-body {
  padding: 24px;
}

.modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-gray);
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-dark);
}

.tab-btn.active {
  color: var(--primary-start);
  border-bottom-color: var(--primary-start);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-gray);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-dark);
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-start);
  box-shadow: 0 0 0 3px rgba(0,210,106,0.1);
}

.form-textarea {
  min-height: 200px;
  resize: vertical;
}

.form-helper {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 6px;
}

.btn-modal-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-modal-submit:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(0,210,106,0.3);
  transform: translateY(-2px);
}

.btn-modal-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-gray);
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 600;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 210, 106, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 210, 106, 0.4);
}

.loading-spinner {
  text-align: center;
  padding: 48px;
  color: var(--text-gray);
}

.loading-spinner i {
  font-size: 32px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Modal Footer */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-gray);
  display: flex;
  justify-content: flex-end;
  background: #f9fafb;
  border-radius: 0 0 20px 20px;
}

.btn-delete-episode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ef4444;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-episode:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-delete-episode:active {
  transform: translateY(0);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  :root {
    --player-height: 200px;
  }

  .hero-title {
    font-size: 40px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .hero-tagline {
    font-size: 16px;
  }

  .btn-hero-cta {
    padding: 16px 28px;
    font-size: 15px;
  }

  .section-title {
    font-size: 24px;
  }

  .how-it-works-grid {
    grid-template-columns: 1fr;
  }

  .episode-thumbnail {
    width: 56px;
    height: 56px;
  }

  .episode-title {
    font-size: 14px;
  }

  .player-controls-row {
    gap: 16px;
  }

  .btn-player-main {
    width: 48px;
    height: 48px;
  }

  .player-nav-bar {
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 60px 20px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .btn-episode-play {
    width: 40px;
    height: 40px;
  }

  .btn-episode-info {
    width: 32px;
    height: 32px;
  }

  .player-bar {
    padding: 12px 16px;
  }
}
