:root {
  color-scheme: dark;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Color Palette - Dark by default */
  --bg-main: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: rgba(22, 33, 56, 0.65);
  --bg-card-hover: rgba(30, 44, 75, 0.8);
  --border-card: rgba(255, 255, 255, 0.08);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;

  --accent-primary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #ec4899 100%);
  --accent-gold: #f59e0b;
  --card-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-main: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-card: rgba(0, 0, 0, 0.08);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-accent: #0284c7;

  --accent-primary: #2563eb;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #db2777 100%);
  --card-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-bottom: 40px;
}

/* Background Animated Blobs */
.background-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 380px;
  height: 380px;
  background: #38bdf8;
  top: -60px;
  left: -80px;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: #a855f7;
  bottom: 5%;
  right: -100px;
  animation-duration: 25s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: #ec4899;
  top: 40%;
  left: 35%;
  opacity: 0.12;
  animation-duration: 18s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* App Container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  position: relative;
  z-index: 1;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-card);
}

.header-left h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.25rem;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-card);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.action-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 30px;
  padding: 0.6rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.action-pill-btn:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.action-pill-btn .btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.action-pill-btn .btn-label {
  letter-spacing: 0.01em;
}

/* Countdown Hero */
.countdown-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.target-date-display {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.target-date-display strong {
  color: var(--text-main);
  font-weight: 600;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.countdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-md);
  padding: 1.5rem 0.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.countdown-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.7;
}

.countdown-card:hover {
  transform: translateY(-3px);
}

.counter-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.countdown-card.highlight-seconds .counter-val {
  color: #38bdf8;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.counter-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.time-breakdown-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.time-breakdown-sub span {
  font-weight: 600;
  color: var(--text-accent);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Card Generic */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(14px);
  margin-bottom: 2rem;
}

/* Progress Section */
.career-progress-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.career-progress-section h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-percent {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: #10b981;
}

.progress-track {
  width: 100%;
  height: 18px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 30px;
  overflow: visible;
  position: relative;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-card);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6);
  border-radius: 30px;
  position: relative;
  transition: width 1s ease-out;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.progress-rocket {
  position: absolute;
  right: -14px;
  top: -12px;
  font-size: 1.3rem;
  user-select: none;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
  transform: rotate(-10deg);
}

.progress-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

#careerMilestoneMsg {
  font-weight: 600;
  color: var(--text-accent);
}

/* Stats Section */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.05);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.stat-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Oracle / Humor Section */
.oracle-section {
  position: relative;
  overflow: hidden;
  border-left: 4px solid #f59e0b;
}

.oracle-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
}

#quoteText {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  min-height: 60px;
}

.oracle-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.quote-author {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer & Signature */
.app-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3.5rem;
}

.signature-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.creator-signature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 50px;
  padding: 0.6rem 1.4rem 0.6rem 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  text-align: left;
  outline: none;
  color: inherit;
}

.creator-signature-card:hover {
  transform: translateY(-3px) scale(1.02);
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.25);
}

.signature-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.signature-details {
  display: flex;
  flex-direction: column;
}

.signature-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-accent);
  text-transform: uppercase;
}

.signature-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.signature-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.signature-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  margin-left: 6px;
}

.footer-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.sub-credit {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.2rem;
}

/* Toast Notification for Author Badge */
.signature-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1.5px solid #38bdf8;
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90%;
  backdrop-filter: blur(14px);
}

.signature-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.97); }
  to { transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.icon-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.icon-close:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  appearance: auto;
}

.form-group select option {
  background-color: #131b2e;
  color: #f1f5f9;
  padding: 8px 12px;
}

[data-theme="light"] .form-group select option {
  background-color: #ffffff;
  color: #0f172a;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.75rem;
}

/* Canvas Confetti */
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Responsive adjustments for Mobile */
@media (max-width: 768px) {
  .app-container {
    padding: 1.2rem 1rem;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .counter-val {
    font-size: 2.3rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .header-left h1 {
    font-size: 1.4rem;
  }

  .card {
    padding: 1.25rem;
  }

  .oracle-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
