/* Try Korean Right Now widget — A1 (Daily Words) + A2 (OCR Demo) */
/* M-W2 Stage A — BUILD 253 */

.try-korean {
  background: linear-gradient(135deg, #f8f5ff 0%, #fff0f5 100%);
  padding: 4rem 1.5rem;
  position: relative;
}

[data-theme="dark"] .try-korean,
.try-korean.dark {
  background: linear-gradient(135deg, #1a1530 0%, #2a1525 100%);
}

.try-korean__container {
  max-width: 1200px;
  margin: 0 auto;
}

.try-korean__header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.try-korean__header h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0 0 0.5rem;
  color: var(--text-primary, #1a1a2e);
  font-weight: 700;
}

.try-korean__header p {
  font-size: 1.1rem;
  color: var(--text-secondary, #5a5a6e);
  margin: 0;
}

.try-korean__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .try-korean__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.try-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 4px 24px rgba(20, 10, 60, 0.06), 0 1px 3px rgba(20, 10, 60, 0.04);
  border: 1px solid rgba(120, 80, 200, 0.08);
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .try-card,
.try-korean.dark .try-card {
  background: #1f1a35;
  border-color: rgba(150, 110, 230, 0.18);
}

.try-card__heading {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
}

.try-card__sub {
  font-size: 0.9rem;
  color: var(--text-secondary, #5a5a6e);
  margin: 0 0 1.25rem;
}

/* --- A1: Daily Words --- */
.daily-words__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.daily-words__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(120, 80, 200, 0.04);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.daily-words__item:hover {
  background: rgba(120, 80, 200, 0.08);
}

[data-theme="dark"] .daily-words__item,
.try-korean.dark .daily-words__item {
  background: rgba(180, 140, 240, 0.08);
}

.daily-words__hangul {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
}

.daily-words__rom-meaning {
  font-size: 0.85rem;
  line-height: 1.4;
}

.daily-words__rom {
  color: var(--text-secondary, #5a5a6e);
  font-style: italic;
  display: block;
}

.daily-words__meaning {
  color: var(--text-primary, #1a1a2e);
  display: block;
  margin-top: 0.1rem;
}

.daily-words__speak {
  background: transparent;
  border: 1px solid rgba(120, 80, 200, 0.25);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  padding: 0;
}

.daily-words__speak:hover {
  background: rgba(120, 80, 200, 0.1);
  transform: scale(1.05);
}

.daily-words__date {
  font-size: 0.8rem;
  color: var(--text-secondary, #8a8a9e);
  margin: 0 0 0.75rem;
  text-align: right;
}

/* --- A2: OCR Demo --- */
.ocr-demo__stage {
  position: relative;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ocr-demo__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s ease;
}

.ocr-demo__stage.processing .ocr-demo__image {
  filter: brightness(0.85) blur(1px);
}

.ocr-demo__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
  opacity: 0;
  pointer-events: none;
}

.ocr-demo__stage.processing .ocr-demo__scan {
  opacity: 1;
  animation: ocr-scan 1.2s ease-in-out;
}

@keyframes ocr-scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.ocr-demo__trigger {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.ocr-demo__trigger:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.ocr-demo__trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ocr-demo__result {
  background: rgba(120, 80, 200, 0.04);
  border-left: 3px solid #8b5cf6;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

[data-theme="dark"] .ocr-demo__result,
.try-korean.dark .ocr-demo__result {
  background: rgba(180, 140, 240, 0.08);
}

.ocr-demo__result strong {
  color: var(--text-primary, #1a1a2e);
  display: block;
  margin-bottom: 0.25rem;
}

.ocr-demo__result-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
}

.ocr-demo__result-words {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ocr-demo__result-words li {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

[data-theme="dark"] .ocr-demo__result-words li,
.try-korean.dark .ocr-demo__result-words li {
  background: rgba(255, 255, 255, 0.08);
}

/* --- Card footer CTA --- */
.try-card__cta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.try-card__cta a {
  flex: 1;
  text-align: center;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 140px;
}

.try-card__cta-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #fff;
}

.try-card__cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.try-card__cta-secondary {
  background: rgba(120, 80, 200, 0.08);
  color: var(--text-primary, #1a1a2e);
}

.try-card__cta-secondary:hover {
  background: rgba(120, 80, 200, 0.15);
}

[data-theme="dark"] .try-card__cta-secondary,
.try-korean.dark .try-card__cta-secondary {
  background: rgba(180, 140, 240, 0.12);
  color: #e8e8f0;
}
