/**
 * Tech Word of the Day — ISSMCSP Dark Theme
 * Flip card widget. Clean, clickable, daily-rotating term.
 */

/* ==================== SECTION ==================== */
.techword-section {
  padding: 6rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ==================== FLIP CARD CONTAINER ==================== */
.tw-card {
  width: 100%;
  min-height: 320px;
  perspective: 1000px;
  position: relative;
}

.tw-front, .tw-back {
  width: 100%;
  min-height: 320px;
  background: var(--bg-card, #161620);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 1.2rem;
  padding: 2.5rem;
  backface-visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0; left: 0;
}

.tw-back {
  transform: rotateY(180deg);
  overflow-y: auto;
  max-height: 600px;
}

.tw-card.tw-flipped .tw-front {
  transform: rotateY(180deg);
}

.tw-card.tw-flipped .tw-back {
  transform: rotateY(0deg);
}

/* ==================== FRONT FACE ==================== */
.tw-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.8rem;
  cursor: default;
}

.tw-date-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted, #4a4a58);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.03);
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
}

.tw-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--accent-primary, #00e5cc);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  background: rgba(0,229,204,0.08);
  padding: 0.3rem 1rem;
  border-radius: 2rem;
  border: 1px solid rgba(0,229,204,0.15);
}

.tw-term-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.tw-emoji {
  font-size: 3.5rem;
  animation: tw-bounce 2s ease-in-out infinite;
}

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

.tw-term-name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text-primary, #e0e0e8), var(--accent-primary, #00e5cc));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tw-category-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.3rem 0.8rem;
  border-radius: 0.4rem;
  background: rgba(255,107,53,0.08);
  color: var(--accent-secondary, #ff6b35);
  border: 1px solid rgba(255,107,53,0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.tw-reveal-btn {
  margin-top: 0.8rem;
  padding: 0.7rem 2rem;
  background: linear-gradient(135deg, var(--accent-primary, #00e5cc), #00a8a0);
  color: var(--bg-primary, #0a0a0f);
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(0,229,204,0.2);
  font-family: 'Inter', sans-serif;
}

.tw-reveal-btn:hover {
  box-shadow: 0 6px 30px rgba(0,229,204,0.4);
  transform: translateY(-2px);
}

.tw-hint {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted, #4a4a58);
  font-family: 'JetBrains Mono', monospace;
}

/* ==================== BACK FACE ==================== */
.tw-flip-back {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  color: var(--text-muted, #4a4a58);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tw-flip-back:hover {
  border-color: var(--accent-primary, #00e5cc);
  color: var(--accent-primary, #00e5cc);
}

.tw-back-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tw-back-header .tw-emoji {
  font-size: 2rem;
  animation: none;
}

.tw-back-header .tw-term-name {
  font-size: 1.8rem;
}

.tw-definition {
  margin-bottom: 1.2rem;
  line-height: 1.7;
  color: var(--text-primary, #e0e0e8);
  font-size: 0.95rem;
}

.tw-definition p { margin: 0; }

.tw-aka {
  margin-bottom: 1rem;
}

.tw-aka-label {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(0,229,204,0.06);
  border: 1px solid rgba(0,229,204,0.15);
  border-radius: 0.4rem;
  font-size: 0.8rem;
  color: var(--accent-primary, #00e5cc);
  font-family: 'JetBrains Mono', monospace;
}

.tw-real-world, .tw-fun-fact {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0,0,0,0.15);
  border-radius: 0.6rem;
  border-left: 3px solid;
}

.tw-real-world {
  border-left-color: var(--accent-secondary, #ff6b35);
}

.tw-fun-fact {
  border-left-color: #a78bfa;
}

.tw-sub-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #4a4a58);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.tw-real-world p, .tw-fun-fact p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #7a7a88);
  line-height: 1.55;
}

/* ==================== ACTIONS ==================== */
.tw-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tw-action-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid;
  font-family: 'Inter', sans-serif;
}

.tw-kidsplain-btn {
  background: rgba(143,109,255,0.08);
  border-color: rgba(143,109,255,0.2);
  color: #a78bfa;
}

.tw-kidsplain-btn:hover {
  background: rgba(143,109,255,0.15);
  border-color: #8f6dff;
}

.tw-subscribe-btn {
  background: transparent;
  border-color: var(--accent-primary, #00e5cc);
  color: var(--accent-primary, #00e5cc);
  font-weight: 700;
}

.tw-subscribe-btn:hover {
  background: rgba(0,229,204,0.08);
  box-shadow: 0 0 15px rgba(0,229,204,0.1);
}

.tw-subscribe-tease {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0,229,204,0.04), rgba(143,109,255,0.04));
  border: 1px solid rgba(0,229,204,0.1);
  border-radius: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted, #4a4a58);
  line-height: 1.55;
  text-align: center;
}

.tw-subscribe-tease strong {
  color: var(--accent-primary, #00e5cc);
}

/* ==================== TOAST ==================== */
.tw-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  animation: tw-slideUp 0.4s ease-out;
  opacity: 1;
  transition: opacity 0.3s;
  max-width: 420px;
}

@keyframes tw-slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.tw-toast-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-card, #161620);
  border: 1px solid var(--accent-primary, #00e5cc);
  border-radius: 0.8rem;
  padding: 1.2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.tw-toast-content > span {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tw-toast-content strong {
  color: var(--text-primary, #e0e0e8);
  display: block;
  margin-bottom: 0.2rem;
}

.tw-toast-content p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted, #4a4a58);
  line-height: 1.5;
}

.tw-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #4a4a58);
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.tw-toast-close:hover { color: var(--text-primary, #e0e0e8); }

/* ==================== SECTION HEADER ==================== */
.techword-section .section-header .tw-accent {
  color: var(--accent-primary, #00e5cc);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .tw-front, .tw-back {
    padding: 1.5rem;
    min-height: 280px;
  }

  .tw-term-display {
    flex-direction: column;
    gap: 0.3rem;
  }

  .tw-emoji {
    font-size: 2.5rem;
  }

  .tw-term-name {
    font-size: 2.2rem;
  }

  .tw-actions {
    flex-direction: column;
  }

  .tw-action-btn {
    width: 100%;
    text-align: center;
  }

  .tw-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}
