html, body {
  background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
  font-family: 'Pretendard', sans-serif;
  min-height: 100vh;
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
}

.front-today-container {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: 24px 16px 32px 16px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.08);
  min-height: calc(100vh - 200px);
  margin-bottom: 20px;
}

/* 헤더 영역 */
.front-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 15px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

.front-today-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #3b3b4f;
  margin: 0;
}

.user-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.user-info, .guest-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name, .guest-text {
  font-size: 0.9em;
  color: #6b7280;
  font-weight: 500;
}

.premium-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
}

.premium-badge-link {
  text-decoration: none;
  transition: transform 0.2s ease;
}

.premium-badge-link:hover {
  transform: scale(1.05);
}

.free-badge {
  background: #e5e7eb;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
}

.points-badge {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  margin-left: 4px;
}

.user-actions {
  display: flex;
  gap: 12px;
}

/* PWA 설치 버튼 스타일 */
.pwa-install-section {
  margin: 10px 0;
  text-align: center;
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.pwa-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

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

.pwa-icon {
  font-size: 1.1rem;
}

.pwa-text {
  font-family: 'Pretendard', sans-serif;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .pwa-install-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

.archive-link, .logout-link, .login-link, .about-link {
  font-size: 0.85em;
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

 .archive-link:hover, .logout-link:hover, .login-link:hover, .about-link:hover {
   color: #7c3aed;
 }

 .sns-share-btn {
   background: linear-gradient(135deg, #10b981, #059669);
   color: white;
   border: none;
   padding: 6px 12px;
   border-radius: 6px;
   font-size: 0.85em;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s;
   text-decoration: none;
   display: inline-block;
 }

 .sns-share-btn:hover {
   transform: translateY(-1px);
   box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
   color: white;
 }

.front-today-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.front-today-date-form, .front-today-lang-form, .front-today-category-form {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
}

.front-today-date-label, .front-today-lang-label, .front-today-category-label {
  font-weight: 600;
  font-size: 0.95em;
  color: #6366f1;
  min-width: 70px;
  text-align: right;
}

.front-today-date-input, .front-today-lang-select, .front-today-category-select {
  font-size: 0.95em;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #e0e7ff;
  background: #f8fafc;
  min-width: 140px;
  color: #374151;
  outline: none;
  transition: all 0.2s;
  position: relative;
  z-index: 10;
}

.front-today-date-input:focus, .front-today-lang-select:focus, .front-today-category-select:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.guest-category-select {
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
}

.category-limit-notice {
  text-align: center;
  padding: 12px;
  background: #fef3c7;
  border-radius: 8px;
  border: 1px solid #fde68a;
}

.category-limit-notice p {
  margin: 0;
  font-size: 0.9em;
  color: #92400e;
}

.date-limit-notice {
  text-align: center;
  padding: 12px;
  background: #fef3c7;
  border-radius: 8px;
  border: 1px solid #fde68a;
  margin-bottom: 16px;
}

.date-limit-notice p {
  margin: 0;
  font-size: 0.9em;
  color: #92400e;
}

.premium-link {
  font-size: 0.85em;
  color: #f59e0b;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.premium-link:hover {
  color: #d97706;
}

.category-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-category-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1.5px solid #e0e7ff;
  border-radius: 8px;
  min-width: 140px;
}

.category-name {
  font-size: 0.95em;
  color: #374151;
  font-weight: 500;
}

.category-note {
  font-size: 0.8em;
  color: #9ca3af;
  font-style: italic;
}

.category-upgrade-notice {
  text-align: center;
  padding: 8px;
  background: #fef3c7;
  border-radius: 6px;
  border: 1px solid #fde68a;
}

.category-upgrade-notice p {
  margin: 0;
  font-size: 0.85em;
  color: #92400e;
}

.category-hint {
  margin-top: 8px !important;
  font-size: 0.9em !important;
  color: #6366f1 !important;
  font-weight: 500;
}

.front-selected-category-detail {
  margin-top: 18px;
  padding: 20px;
  border-radius: 15px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

.front-result-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  border: 1px solid #e2e8f0;
}

.front-preview-textarea {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  font-size: 1.05em;
  color: #374151;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
  min-height: 60px;
}

/* 아카이브 버튼 */
.archive-actions {
  margin-bottom: 16px;
}

.archive-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.archive-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

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

.archive-icon {
  font-size: 1.1em;
}

.archived-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: default;
}

.archived-icon {
  font-size: 1.1em;
}

.unarchive-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}

.unarchive-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

 .unarchive-icon {
   font-size: 0.9em;
 }

 .front-no-writing {
   text-align: center;
   color: #9ca3af;
   font-size: 1.1em;
   padding: 40px 20px;
 }

 /* SNS 공유 섹션 */
 .share-section {
   margin-top: 20px;
   padding: 16px;
   background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
   border-radius: 12px;
   border: 1px solid #e2e8f0;
 }

 .share-buttons {
   display: flex;
   gap: 12px;
   justify-content: center;
   margin-bottom: 12px;
 }

 .share-btn {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 10px 16px;
   border: none;
   border-radius: 8px;
   font-size: 0.9em;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s;
   text-decoration: none;
   color: white;
 }

   .sns-share {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
  }

  .sns-share:hover {
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  }

 .share-icon {
   font-size: 1.1em;
 }

 .share-text {
   font-weight: 600;
 }

 .share-notice {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   padding: 8px 12px;
   background: #fef3c7;
   border-radius: 6px;
   border: 1px solid #fde68a;
 }

 .notice-icon {
   font-size: 1em;
 }

 .notice-text {
   font-size: 0.85em;
   color: #92400e;
   font-weight: 500;
 }

 /* 공유 URL 섹션 */
 .share-url-section {
   margin-top: 16px;
   padding: 16px;
   background: #fff;
   border-radius: 8px;
   border: 1px solid #e2e8f0;
 }

 .share-url-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 12px;
 }

 .share-url-title {
   font-size: 0.9em;
   font-weight: 600;
   color: #374151;
 }

 .copy-btn {
   display: flex;
   align-items: center;
   gap: 4px;
   padding: 6px 12px;
   background: #6366f1;
   color: white;
   border: none;
   border-radius: 6px;
   font-size: 0.8em;
   font-weight: 500;
   cursor: pointer;
   transition: all 0.2s;
 }

   .copy-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .copy-btn:hover {
    background: #5b21b6;
    transform: translateY(-1px);
  }

 .share-url-content {
   margin-bottom: 12px;
 }

   .share-preview {
    width: 100%;
    padding: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-family: Arial, sans-serif;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
  }

  .share-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }



 .share-instructions {
   margin-bottom: 16px;
 }

 .share-instructions p {
   margin: 4px 0;
   font-size: 0.85em;
   color: #6b7280;
   line-height: 1.4;
 }

 .shared-url-input-section {
   margin-bottom: 16px;
 }

 .shared-url-label {
   display: block;
   font-size: 0.85em;
   font-weight: 600;
   color: #374151;
   margin-bottom: 8px;
 }

 .shared-post-url-input {
   width: 100%;
   padding: 10px 12px;
   border: 1px solid #d1d5db;
   border-radius: 6px;
   font-size: 0.85em;
   background: #fff;
   color: #374151;
   font-family: 'Courier New', monospace;
 }

 .shared-post-url-input:focus {
   outline: none;
   border-color: #6366f1;
   box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
 }

 .verify-btn {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   width: 100%;
   padding: 12px 16px;
   background: linear-gradient(135deg, #10b981, #059669);
   color: white;
   border: none;
   border-radius: 8px;
   font-size: 0.9em;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s;
 }

 .verify-btn:hover {
   transform: translateY(-1px);
   box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
 }

 .verify-icon {
   font-size: 1.1em;
 }

 .extra-category-notice {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 8px 12px;
   background: linear-gradient(135deg, #fbbf24, #f59e0b);
   border-radius: 6px;
   border: 1px solid #f59e0b;
   margin-top: 8px;
 }

 .extra-category-icon {
   font-size: 1em;
 }

 .extra-category-text {
   font-size: 0.85em;
   color: #92400e;
   font-weight: 600;
 }

/* 개선된 오디오 플레이어 */
.audio-player {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.audio-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7, #c084fc);
  border-radius: 16px 16px 0 0;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
  position: relative;
  overflow: hidden;
}

.play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #a855f7, #c084fc);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
}

.play-btn:hover::before {
  opacity: 1;
}

.play-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
}

.play-btn:active {
  transform: translateY(0) scale(0.95);
}

.play-icon, .pause-icon {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 50px;
}

.wave-bar {
  width: 3px;
  height: 25px;
  background: linear-gradient(to top, #cbd5e1, #94a3b8);
  border-radius: 2px;
  animation: wave 1.5s ease-in-out infinite;
  opacity: 0.6;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; }
.wave-bar:nth-child(8) { animation-delay: 0.7s; }
.wave-bar:nth-child(9) { animation-delay: 0.8s; }
.wave-bar:nth-child(10) { animation-delay: 0.9s; }

@keyframes wave {
  0%, 100% { height: 25px; opacity: 0.6; }
  50% { height: 50px; opacity: 1; }
}

.audio-player.playing .wave-bar {
  background: linear-gradient(to top, #8b5cf6, #a855f7);
}

.audio-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-container {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a855f7, #c084fc);
  width: 0%;
  border-radius: 4px;
  transition: width 0.1s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid #8b5cf6;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress-container:hover .progress-handle {
  opacity: 1;
}

.time-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  color: #64748b;
  font-weight: 500;
}

.current-time, .duration {
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  color: #8b5cf6;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.audio-player audio {
  display: none;
}

.fade-in {
  animation: fadeIn 0.4s ease-in-out;
}

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

/* 모바일 최적화 */
@media (max-width: 600px) {
  .front-header {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .front-today-title {
    font-size: 1.5rem;
  }

  .user-status {
    align-items: center;
  }

  .front-today-container {
    max-width: 100%;
    border-radius: 0;
    padding: 20px 16px 32px 16px;
    margin: 0;
    min-height: calc(100vh - 150px);
    margin-bottom: 20px;
  }

  .front-today-header {
    gap: 14px;
  }

  .front-today-date-label, .front-today-lang-label, .front-today-category-label {
    font-size: 0.9em;
    min-width: 60px;
  }

  .front-today-date-input, .front-today-lang-select, .front-today-category-select {
    font-size: 0.9em;
    padding: 8px 12px;
    min-width: 120px;
  }

  .date-limit-notice, .category-upgrade-notice {
    padding: 10px;
  }

  .date-limit-notice p, .category-upgrade-notice p {
    font-size: 0.85em;
  }

  .selected-category-display {
    padding: 8px 12px;
    min-width: 120px;
  }

  .category-name {
    font-size: 0.9em;
  }

  .category-note {
    font-size: 0.75em;
  }

  .front-result-card {
    padding: 16px 12px;
  }

  .front-preview-textarea {
    font-size: 1em;
    padding: 14px;
    margin-bottom: 14px;
  }

  .audio-player {
    padding: 16px;
    gap: 12px;
  }

  .play-btn {
    width: 48px;
    height: 48px;
  }

  .play-icon, .pause-icon {
    width: 20px;
    height: 20px;
  }

  .audio-wave {
    height: 40px;
  }

  .wave-bar {
    width: 2px;
    height: 20px;
  }

  @keyframes wave {
    0%, 100% { height: 20px; opacity: 0.6; }
    50% { height: 40px; opacity: 1; }
  }

  .time-display {
    font-size: 0.8em;
  }

  .current-time, .duration {
    padding: 3px 6px;
  }

  .share-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .share-btn {
    padding: 12px 16px;
    font-size: 1em;
  }

  .shared-post-url-input {
    font-size: 0.8em;
    padding: 8px 10px;
  }

  .shared-url-label {
    font-size: 0.8em;
  }
}

