:root {
  --bg-dark: #0A0E27;
  --bg-card: #141832;
  --electric-blue: #00D9FF;
  --acid-green: #39FF14;
  --purple: #8B5CF6;
  --text-white: #FFFFFF;
  --text-gray: #A0AEC0;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0d1235 50%, #0A0E27 100%);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

.screen {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Home Screen */
.home-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  background: 
    radial-gradient(circle at 50% 30%, rgba(0, 217, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(57, 255, 20, 0.05) 0%, transparent 40%),
    linear-gradient(135deg, var(--bg-dark) 0%, #0d1235 100%);
}

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo-wrapper {
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.5)); }
  50% { filter: drop-shadow(0 0 40px rgba(57, 255, 20, 0.6)); }
}

.logo-container {
  position: relative;
}

.app-title {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--acid-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(0, 217, 255, 0.3);
}

.tagline {
  font-size: 1.2rem;
  color: var(--text-gray);
  font-style: italic;
  margin-bottom: 20px;
}

.gradient-btn {
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--purple) 50%, var(--acid-green) 100%);
  border: none;
  padding: 18px 48px;
  border-radius: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-white);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
  font-family: inherit;
}

.gradient-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(0, 217, 255, 0.5);
}

.gradient-btn.small {
  padding: 10px 24px;
  font-size: 1rem;
}

.secondary-btn {
  background: transparent;
  border: 2px solid var(--electric-blue);
  padding: 16px 44px;
  border-radius: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--electric-blue);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.secondary-btn:hover {
  background: rgba(0, 217, 255, 0.1);
}

.home-footer {
  position: absolute;
  bottom: 100px;
}

.home-footer a {
  color: var(--text-gray);
  font-size: 0.85rem;
  text-decoration: none;
}

.home-footer a:hover {
  color: var(--electric-blue);
}

/* Tab Navigation */
.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--bg-dark) 0%, rgba(10, 14, 39, 0.95) 100%);
  display: flex;
  justify-content: space-around;
  padding: 12px 0 24px;
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  backdrop-filter: blur(10px);
}

.tab-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  padding: 8px 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.tab-button.active {
  color: var(--electric-blue);
}

.tab-button.active .tab-icon {
  transform: scale(1.2);
}

.tab-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.tab-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Selection Screen */
.selection-screen {
  padding-top: 60px;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  color: var(--electric-blue);
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

.selection-header {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-gray);
  font-style: italic;
  margin-bottom: 30px;
}

.duration-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 40px;
}

.duration-btn {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.duration-btn:hover {
  border-color: var(--electric-blue);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.duration-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-white);
}

.duration-subtext {
  font-size: 0.9rem;
  color: var(--text-gray);
  font-style: italic;
}

.presets-section {
  margin-bottom: 30px;
}

.presets-title {
  font-size: 1rem;
  color: var(--text-gray);
  margin-bottom: 16px;
  text-align: center;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.preset-btn {
  background: var(--bg-card);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.preset-btn:hover {
  border-color: var(--acid-green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
}

.preset-icon {
  font-size: 1.5rem;
}

.preset-name {
  font-size: 0.9rem;
  color: var(--text-white);
}

.surprise-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--purple) 0%, var(--electric-blue) 100%);
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-white);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.surprise-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

/* Workout Screen */
.workout-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  padding-bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 217, 255, 0.05) 0%, transparent 60%);
}

.pause-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-workout-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  color: #ff6464;
  cursor: pointer;
  transition: all 0.3s ease;
}

.workout-name {
  font-size: 1.5rem;
  color: var(--electric-blue);
  margin-bottom: 40px;
}

.timer-display {
  margin-bottom: 40px;
}

.timer-text {
  font-size: 6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--acid-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(0, 217, 255, 0.3);
}

.instruction-display {
  margin-bottom: 40px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instruction-text {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--acid-green);
  animation: pulse-instruction 0.8s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(57, 255, 20, 0.5);
}

@keyframes pulse-instruction {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.9; }
}

.instruction-display.paused .instruction-text {
  animation: none;
  opacity: 0.5;
}

.rest-quote {
  font-size: 1.2rem;
  color: var(--text-gray);
  font-style: italic;
}

.rep-info {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
}

.rep-counter, .set-counter {
  font-size: 1.2rem;
  color: var(--text-gray);
}

.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: rgba(0, 217, 255, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--electric-blue) 0%, var(--acid-green) 100%);
  transition: width 0.3s ease;
}

.paused-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.paused-overlay span {
  font-size: 3rem;
  font-weight: 700;
  color: var(--electric-blue);
}

.paused-overlay p {
  color: var(--text-gray);
  font-style: italic;
}

/* Completion Screen */
.completion-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding-bottom: 0;
}

.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  top: -20px;
  border-radius: 50%;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.completion-content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.completion-title {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--acid-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 20px;
  padding: 24px 40px;
  min-width: 280px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--text-gray);
}

.stat-value {
  font-weight: 600;
  color: var(--text-white);
}

.stat-check {
  color: var(--acid-green);
}

.completion-message {
  font-size: 1.2rem;
  color: var(--text-gray);
  font-style: italic;
}

.completion-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Library Screen */
.library-screen {
  padding-top: 20px;
}

.screen-title {
  font-size: 2rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--acid-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.library-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 1rem;
  color: var(--text-gray);
  margin-bottom: 12px;
}

.workout-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workout-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.workout-card:hover {
  border-color: var(--electric-blue);
}

.workout-card.expanded {
  border-color: var(--acid-green);
}

.workout-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workout-target {
  font-size: 1.5rem;
}

.workout-card-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workout-card-name {
  font-weight: 600;
}

.workout-card-duration {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.workout-card-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workout-quote {
  font-style: italic;
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* Progress Screen */
.progress-screen {
  padding-top: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
}

.stat-card h4 {
  color: var(--electric-blue);
  margin-bottom: 16px;
  font-size: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.stat-item span:first-child {
  color: var(--text-gray);
}

.stat-number {
  font-weight: 600;
  color: var(--text-white);
}

.chart-section {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
}

.chart-section h4 {
  color: var(--electric-blue);
  margin-bottom: 20px;
}

.bar-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 100px;
}

.bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.bar {
  width: 30px;
  min-height: 4px;
  background: linear-gradient(to top, var(--electric-blue), var(--acid-green));
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 0.75rem;
  color: var(--text-gray);
}

.achievements-section h4 {
  color: var(--electric-blue);
  margin-bottom: 16px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.achievement-card.unlocked {
  border-color: var(--acid-green);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

.achievement-card.locked {
  opacity: 0.5;
}

.achievement-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.achievement-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
}

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

/* Settings Screen */
.settings-screen {
  padding-top: 20px;
}

.settings-group {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.settings-group h4 {
  color: var(--electric-blue);
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-row:last-child {
  border-bottom: none;
}

.toggle {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  color: var(--text-gray);
}

.toggle.on {
  background: var(--acid-green);
  color: var(--bg-dark);
  font-weight: 600;
}

.sarcasm-selector {
  display: flex;
  gap: 10px;
}

.sarcasm-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px;
  border-radius: 10px;
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.sarcasm-btn.active {
  background: linear-gradient(135deg, var(--electric-blue), var(--acid-green));
  border-color: transparent;
  color: var(--bg-dark);
  font-weight: 600;
}

.about-section {
  background: var(--bg-card);
  border: 1px solid rgba(0, 217, 255, 0.2);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}

.about-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 20px;
  color: var(--electric-blue);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.about-content {
  padding: 0 20px 20px;
}

.about-content p {
  color: var(--text-gray);
  margin-bottom: 10px;
  line-height: 1.6;
}

.disclaimer {
  font-size: 0.85rem;
  color: var(--acid-green);
  font-style: italic;
}

.settings-footer {
  text-align: center;
  padding: 20px;
}

.settings-footer a {
  color: var(--text-gray);
  font-size: 0.85rem;
  text-decoration: none;
}

.settings-footer a:hover {
  color: var(--electric-blue);
}

/* Responsive */
@media (max-width: 480px) {
  .app-title {
    font-size: 3rem;
  }
  
  .timer-text {
    font-size: 4rem;
  }
  
  .instruction-text {
    font-size: 1.8rem;
  }
  
  .completion-title {
    font-size: 1.8rem;
  }
  
  .presets-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-card {
    min-width: auto;
    padding: 20px;
  }
  
  .completion-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .gradient-btn, .secondary-btn {
    width: 100%;
  }
}