:root {
  --bg-dark: #0B0F1A;
  --bg-card: rgba(20, 30, 50, 0.6);
  --primary: #4DA3FF;
  --secondary: #8A6CFF;
  --success: #3CFF91;
  --warning: #FFB347;
  --text-primary: #E6EAF2;
  --text-secondary: #9CA3AF;
  --border-color: rgba(77, 163, 255, 0.2);

  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

#app-container {
  width: 100%;
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.5s ease-in;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(77, 163, 255, 0.2);
}

#welcome-screen {
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0B0F1A 0%, #1a1f3a 100%);
  position: relative;
  overflow: hidden;
}

#welcome-screen::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(77, 163, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  top: -200px;
  right: -200px;
  animation: pulse 4s ease-in-out infinite;
}

#welcome-screen::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(138, 108, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -150px;
  left: -150px;
  animation: pulse 5s ease-in-out infinite;
}

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

.welcome-content {
  text-align: center;
  z-index: 1;
  max-width: 600px;
  padding: 20px;
}

.logo-section {
  margin-bottom: 48px;
}

.brand-logo {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.welcome-card {
  margin: 0 auto;
  max-width: 500px;
}

.welcome-card h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.welcome-card p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(77, 163, 255, 0.4);
}

.btn-secondary {
  background: rgba(77, 163, 255, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-secondary:hover {
  background: rgba(77, 163, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: rgba(255, 82, 82, 0.1);
  color: #ff5252;
  border: 1px solid #ff5252;
}

.btn-danger:hover {
  background: rgba(255, 82, 82, 0.2);
}

.btn-large {
  padding: 16px 48px;
  font-size: 1.1rem;
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.glow {
  box-shadow: 0 0 20px rgba(77, 163, 255, 0.3);
}

#goal-setup-screen {
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.setup-container {
  max-width: 700px;
  width: 100%;
  text-align: center;
}

.setup-container h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

#goal-setup-form {
  text-align: left;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(20, 30, 50, 0.4);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

#dashboard-screen {
  display: none;
}

#dashboard-screen.active {
  display: flex;
}

.sidebar {
  width: 260px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  padding: 24px 0;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo-small {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  list-style: none;
  padding: 24px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(77, 163, 255, 0.1);
  color: var(--primary);
}

.nav-item.active {
  background: rgba(77, 163, 255, 0.15);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.nav-icon {
  font-size: 1.3rem;
}

.main-content {
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
  width: calc(100% - 260px);
}

.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.header-stats {
  display: flex;
  gap: 16px;
}

.stat-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.discipline-card {
  text-align: center;
}

.discipline-card h3 {
  margin-bottom: 24px;
  font-size: 1.3rem;
}

.score-display {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.2) 0%, rgba(138, 108, 255, 0.2) 100%);
  border: 4px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 30px rgba(77, 163, 255, 0.3);
}

.score-number {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(77, 163, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 8px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.mission-card h3 {
  margin-bottom: 16px;
}

.tasks-list {
  min-height: 200px;
  margin-bottom: 16px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(77, 163, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.task-item:hover {
  background: rgba(77, 163, 255, 0.1);
}

.task-item.completed {
  opacity: 0.6;
}

.task-item.completed .task-text {
  text-decoration: line-through;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.task-checkbox.checked {
  background: var(--primary);
}

.task-checkbox.checked::after {
  content: '✓';
  color: white;
  font-weight: bold;
}

.task-text {
  flex: 1;
  color: var(--text-primary);
}

.timer-card {
  text-align: center;
}

.timer-card h3 {
  margin-bottom: 24px;
}

.timer-display {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.timer-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.1) 0%, rgba(138, 108, 255, 0.1) 100%);
  border: 5px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(77, 163, 255, 0.3);
}

.timer-circle.active {
  animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% {
    box-shadow: 0 0 40px rgba(77, 163, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 60px rgba(77, 163, 255, 0.6);
  }
}

#timer-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.timer-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.timer-stats {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.motivation-card {
  grid-column: span 2;
}

.motivation-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-primary);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.achievements-card {
  grid-column: span 2;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.achievement-badge {
  background: rgba(77, 163, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.achievement-badge:hover {
  background: rgba(77, 163, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-4px);
}

.achievement-badge.locked {
  opacity: 0.4;
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  filter: grayscale(100%);
}

.achievement-badge.unlocked .achievement-icon {
  filter: grayscale(0%);
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.achievement-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.roadmap-container {
  max-width: 1000px;
}

.milestone-card {
  margin-bottom: 32px;
  position: relative;
  padding-left: 32px;
}

.milestone-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: -32px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, transparent 100%);
}

.milestone-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.milestone-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  position: absolute;
  left: -24px;
}

.milestone-title {
  font-size: 1.4rem;
  color: var(--primary);
}

.milestone-tasks {
  padding-left: 16px;
}

.milestone-task {
  padding: 8px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(77, 163, 255, 0.1);
}

.projection-container {
  max-width: 1200px;
}

.projection-summary {
  margin-bottom: 32px;
  text-align: center;
}

.projection-summary h3 {
  margin-bottom: 16px;
  font-size: 1.5rem;
}

#projection-summary-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.chart-container {
  padding: 32px;
  min-height: 400px;
}

.chart-container canvas {
  max-height: 400px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.stat-card {
  text-align: center;
  padding: 32px;
}

.stat-card h4 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
}

.stat-big {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.goal-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.goal-card.active {
  border-color: var(--success);
  box-shadow: 0 8px 32px rgba(60, 255, 145, 0.2);
}

.goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.goal-title {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.goal-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.goal-progress {
  width: 100%;
  height: 6px;
  background: rgba(77, 163, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.goal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
  transition: width 0.5s ease;
}

.settings-container {
  max-width: 600px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.settings-section button {
  width: 100%;
  margin-bottom: 12px;
}

.achievement-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.achievement-popup.show {
  display: flex;
}

.achievement-content {
  max-width: 500px;
  text-align: center;
  animation: slideUp 0.5s ease;
}

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

.achievement-content h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.achievement-content h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.achievement-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  max-width: 500px;
  width: 90%;
}

.modal-content h3 {
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(20, 30, 50, 0.4);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 20px;
}

.modal-input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
    width: calc(100% - 220px);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .motivation-card,
  .achievements-card {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 70px;
  }

  .sidebar-header h2 {
    font-size: 1.5rem;
  }

  .nav-item span:not(.nav-icon) {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

  .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
    padding: 20px;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    font-size: 3rem;
  }

  .goals-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main-content {
    margin-left: 0;
    width: 100%;
    padding-top: 70px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    padding: 12px 0;
  }

  .sidebar-header {
    display: none;
  }

  .nav-menu {
    display: flex;
    justify-content: space-around;
    padding: 0;
  }

  .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    font-size: 0.75rem;
  }

  .nav-icon {
    font-size: 1.2rem;
  }
}
