/* ==========================================================================
   TeachCode Update & "What's New" System Styles
   Clean, Minimal, Gemini / ChatGPT Modern Aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Dashboard Navigation Updates Button & Badge
   -------------------------------------------------------------------------- */
.btn-updates-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-full, 9999px);
  color: var(--text-secondary, #94a3b8);
  font-family: var(--font-family-base, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal, 0.25s ease);
  backdrop-filter: blur(8px);
  user-select: none;
}

.btn-updates-nav:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary, #f8fafc);
  transform: translateY(-1px);
}

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

.btn-updates-nav.has-update {
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--text-primary, #f8fafc);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
}

.updates-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
  animation: pulseBadge 2.2s infinite ease-in-out;
}

.updates-badge.hidden {
  display: none !important;
}

@keyframes pulseBadge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.7);
  }
}

/* --------------------------------------------------------------------------
   2. Top Dashboard Notification Banner
   -------------------------------------------------------------------------- */
.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 24px 0 24px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(12px);
  animation: slideDownBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
}

.update-banner.hidden {
  display: none !important;
}

@keyframes slideDownBanner {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.update-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.update-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  color: #a855f7;
  font-size: 1rem;
  flex-shrink: 0;
}

.update-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.update-banner-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-banner-desc {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.update-banner-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.update-banner-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f8fafc);
}

/* --------------------------------------------------------------------------
   3. "What's New" Modal & Update Panel
   -------------------------------------------------------------------------- */
.modal-card.update-modal-card {
  max-width: 520px;
  width: 92%;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #161e2e 0%, #0f1523 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-lg, 18px);
}

.update-modal-card .modal-header {
  padding: 22px 24px 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.015);
}

.modal-icon.update-icon {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.whats-new-body {
  padding: 24px;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

/* Version Pill & Metadata */
.update-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.update-version-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full, 9999px);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
}

.update-release-date {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Feature message */
.update-headline {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin-bottom: 6px;
  font-family: var(--font-family-display, 'Outfit', sans-serif);
}

.update-summary {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 20px;
}

/* Changes Checklist */
.update-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-bottom: 12px;
}

.update-changes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.update-change-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary, #f8fafc);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  line-height: 1.4;
  transition: background var(--transition-fast, 0.15s ease);
}

.update-change-item:hover {
  background: rgba(255, 255, 255, 0.045);
}

.update-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Required Update Warning Box */
.update-required-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md, 12px);
  color: #fca5a5;
  font-size: 0.85rem;
  line-height: 1.45;
}

.update-required-banner i {
  color: #ef4444;
  font-size: 1.1rem;
  margin-top: 2px;
}

.update-required-title {
  font-weight: 700;
  color: #fecaca;
  margin-bottom: 2px;
}

/* Up-to-date State */
.update-status-card {
  text-align: center;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.update-status-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.update-status-icon-wrap.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.update-status-icon-wrap.loading {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.update-status-icon-wrap.error {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.update-status-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.update-status-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary, #94a3b8);
  max-width: 320px;
}

/* Modal Actions Footer */
.update-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-update-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-normal, 0.25s ease);
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-update-action:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

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

/* Spinner */
.update-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   4. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .update-banner {
    margin: 12px 14px 0 14px;
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .update-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-card.update-modal-card {
    width: 95%;
  }

  .whats-new-body {
    padding: 18px;
  }
}

/* --------------------------------------------------------------------------
   5. Logo Branding in Header
   -------------------------------------------------------------------------- */
.brand-logo-header {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
  transition: transform 0.25s ease;
}

.brand-logo-header:hover {
  transform: scale(1.08) rotate(3deg);
}

/* --------------------------------------------------------------------------
   6. Cinematic Intro Video Splash Overlay (Autoplays on EXE launch)
   -------------------------------------------------------------------------- */
.intro-splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s ease;
}

.intro-splash-overlay.hidden {
  display: none !important;
}

.intro-splash-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-video-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.intro-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-overlay-bar {
  position: absolute;
  bottom: 32px;
  left: 36px;
  right: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: auto;
}

.intro-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 13, 20, 0.7);
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.intro-brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

.intro-skip-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: rgba(22, 30, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  color: #f8fafc;
  font-family: var(--font-family-base, sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.intro-skip-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(168, 85, 247, 0.8));
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}
