/* ==========================================================================
   ELITE GOAL TRACKER CSS
   Glassmorphism, Dark Mode, Quant Terminal Vibes
   ========================================================================== */

.goals-container {
  margin-left: 20px;
  padding: 32px;
  min-height: 100vh;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(192, 132, 252, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(192, 132, 252, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 132, 252, 0); }
}

@keyframes progressFill {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: var(--target-offset, 0); }
}

.fade-in { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Helpers */
.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted { color: rgba(255, 255, 255, 0.6); }

/* Form Elements */
.goals-input, .goals-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  width: 100%;
  font-family: inherit;
  transition: all 0.3s ease;
}
.goals-input:focus, .goals-select:focus {
  outline: none;
  border-color: #c084fc;
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Buttons */
.goals-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.goals-btn--primary {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: white;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}
.goals-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}
.goals-btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.goals-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.goals-btn--success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}
.goals-btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.6);
}
.goals-btn--ghost:hover { color: white; }

/* Header */
.goals-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 24px;
}
.goals-header__title { font-size: 2.5rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: -1px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.goals-header__subtitle { color: #c084fc; margin: 0; font-size: 1rem; }
.goals-header__stats { display: flex; gap: 24px; }
.goals-stat-card { text-align: center; }
.goals-stat-val { display: block; font-size: 1.5rem; font-weight: 700; color: white; }
.goals-stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }

/* Filters */
.goals-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 16px;
}
.goals-filters__pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.goals-filter-pill {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.goals-filter-pill:hover { background: rgba(255,255,255,0.05); color: white; }
.goals-filter-pill.active { background: rgba(192, 132, 252, 0.2); color: #c084fc; border-color: #c084fc; }
.goals-filters__divider { width: 1px; height: 20px; background: rgba(255,255,255,0.1); margin: 0 4px; }
.goals-filters__tools { display: flex; gap: 12px; align-items: center; }
.goals-search { position: relative; }
.goals-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); }
.goals-search input { padding-left: 36px; width: 200px; }

/* Top Priority Section */
.goals-top-priority { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 24px; }
.goals-top-card {
  background: rgba(20, 15, 25, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(251, 191, 36, 0.3); /* Gold accent */
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 32px;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.goals-top-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.1), transparent 50%);
  pointer-events: none;
}
.goals-top-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.goals-top-card__visual { position: relative; width: 160px; height: 160px; flex-shrink: 0; }
.goals-top-card__info { flex-grow: 1; }
.goals-top-card__title { font-size: 1.8rem; margin: 0 0 8px 0; display: flex; align-items: center; gap: 12px; }
.goals-top-card__why { font-style: italic; color: rgba(255,255,255,0.6); margin-bottom: 16px; font-size: 0.95rem; border-left: 2px solid #c084fc; padding-left: 12px; }
.goals-top-card__meta { display: flex; gap: 16px; margin-bottom: 20px; font-size: 0.85rem; }
.goals-badge { padding: 4px 10px; border-radius: 8px; font-weight: 600; text-transform: uppercase; font-size: 0.7rem; }
.bg-gold { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.bg-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

/* SVG Progress Ring */
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring__bg { fill: none; stroke: rgba(255, 255, 255, 0.05); stroke-width: 8; }
.progress-ring__fill { fill: none; stroke: url(#gradient-purple); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.progress-ring__fill--success { stroke: #22c55e; }
.progress-ring__fill--danger { stroke: #ef5350; }
.progress-ring-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.progress-ring-text .pct { display: block; font-size: 2rem; font-weight: 800; }
.progress-ring-text .lbl { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; }

/* Main Grid Cards */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-top: 16px; }
.goals-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.goals-card:hover { transform: translateY(-4px); border-color: rgba(192, 132, 252, 0.3); background: rgba(255, 255, 255, 0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.goals-card--ontrack { border-left: 4px solid #22c55e; }
.goals-card--atrisk { border-left: 4px solid #fbbf24; }
.goals-card--behind { border-left: 4px solid #ef5350; }
.goals-card--achieved { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); }
.goals-card__header { display: flex; justify-content: space-between; align-items: flex-start; }
.goals-card__title { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px 0; display: flex; gap: 8px; line-height: 1.3; }
.goals-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.goals-tag { background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 6px; font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.goals-card__progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.goals-card__progress-fill { height: 100%; background: #c084fc; border-radius: 3px; transition: width 1s ease-out; }
.goals-card__stats { display: flex; justify-content: space-between; font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 4px; }
.goals-card__footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.pace-badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.pace--ontrack { color: #22c55e; } .pace--atrisk { color: #fbbf24; } .pace--behind { color: #ef5350; }

/* Modals */
.goals-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.goals-modal__overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); }
.goals-modal__content {
  position: relative;
  background: #0d0b12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  padding: 32px;
  animation: fadeInUp 0.3s ease-out forwards;
}
.goals-wizard { max-width: 800px; padding: 0; display: flex; flex-direction: column; }
.goals-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: color 0.3s; }
.goals-modal__close:hover { color: white; }

/* Wizard Specifics */
.goals-wizard__header { padding: 32px 32px 16px 32px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.goals-wizard__header h2 { margin: 0 0 16px 0; color: #c084fc; }
.goals-wizard__progress { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.goals-wizard__progress-bar { width: 12.5%; height: 100%; background: #c084fc; transition: width 0.4s ease; }
.goals-wizard__body { padding: 32px; flex-grow: 1; overflow-y: auto; min-height: 350px; }
.goals-wizard__footer { padding: 16px 32px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; background: rgba(0,0,0,0.2); }
.wizard-subtitle { color: rgba(255,255,255,0.5); margin-top: -10px; margin-bottom: 24px; }
.wizard-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.wizard-cat-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 16px; cursor: pointer; text-align: center; transition: all 0.3s; }
.wizard-cat-card:hover, .wizard-cat-card.selected { background: rgba(192, 132, 252, 0.1); border-color: #c084fc; transform: translateY(-2px); }
.wizard-cat-card h3 { margin: 0 0 8px 0; font-size: 1.1rem; }
.wizard-cat-card p { margin: 0; font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* Detail Modal Styles */
.goals-detail { max-width: 800px; }
.detail-hero { text-align: center; margin-bottom: 32px; }
.detail-emoji { font-size: 4rem; display: block; margin-bottom: 16px; }
.detail-title { font-size: 2rem; font-weight: 800; margin: 0 0 8px 0; }
.detail-why { font-style: italic; color: #c084fc; font-size: 1.1rem; }
.detail-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: rgba(255,255,255,0.03); padding: 24px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); margin-bottom: 24px; }
.detail-timeline { margin-top: 32px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; }
.history-item { display: flex; gap: 16px; margin-bottom: 16px; }
.history-dot { width: 12px; height: 12px; background: #c084fc; border-radius: 50%; margin-top: 4px; box-shadow: 0 0 10px rgba(192, 132, 252, 0.5); }
.history-content { flex-grow: 1; }
.history-date { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.history-note { font-size: 0.9rem; margin-top: 4px; }

/* SVG Definitions hiding */
.svg-defs { width: 0; height: 0; position: absolute; }