/* Ultimate Tabata Player Styles */
:root {
  /* Dark theme variables */
  --primary-color: #8A2BE2; /* Vibrant purple */
  --secondary-color: #00E5FF; /* Bright cyan */
  --accent-color: #FF4081; /* Pink accent */
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --card-color: rgba(30, 30, 30, 0.95);
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --error-color: #FF5252;
  --success-color: #00E676;
  --button-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  --container-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(ellipse at top, #2b2b5a, #121212);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  transition: all 0.5s ease;
  padding: 2rem 1rem;
}

.container {
  background: var(--card-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--container-shadow);
  max-width: 500px;
  width: 100%;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, transparent 30%, rgba(138, 43, 226, 0.05) 70%);
  opacity: 0.1;
  z-index: -1;
  animation: pulse-bg 15s infinite alternate;
}

@keyframes pulse-bg {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(5%, 5%);
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  letter-spacing: -0.5px;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  border-radius: 3px;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle:hover::before {
  opacity: 1;
}

.theme-toggle:hover {
  transform: translateY(-3px) rotate(15deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.theme-toggle:active {
  transform: translateY(0) rotate(0);
}

.track-select-container {
  position: relative;
  margin-bottom: 2.5rem;
}

select {
  width: 100%;
  padding: 1.2rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-size: 1.1rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.5px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

select:hover, select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

select option {
  background-color: var(--surface-color);
  color: var(--text-primary);
  padding: 12px;
  font-family: 'Poppins', sans-serif;
}

select option:checked,
select option:hover {
  background-color: var(--primary-color);
  color: white;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
  select {
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), 
                      linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 20px) center, calc(100% - 15px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }
  
  select:focus {
    background-image: linear-gradient(45deg, var(--primary-color) 50%, transparent 50%), 
                      linear-gradient(135deg, transparent 50%, var(--primary-color) 50%);
    background-position: calc(100% - 15px) center, calc(100% - 20px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }
}

.select-arrow {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.track-select-container:hover .select-arrow {
  transform: translateY(-50%) scale(1.1);
  color: var(--primary-color);
}

#nowPlaying {
  margin-bottom: 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.8rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  position: relative;
}

#nowPlaying::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 43, 226, 0.1), transparent);
  transform: translateX(-100%);
  animation: shimmer 3s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.progress-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.8rem;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
  transition: width 0.1s linear;
  position: relative;
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-container:hover .progress-bar::after {
  opacity: 1;
}

.time {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 500;
  padding: 0 0.5rem;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.btn {
  width: 70px;
  height: 70px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--button-shadow);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--button-shadow);
}

.btn span {
  font-size: 2rem;
  transition: all 0.2s ease;
  z-index: 2;
}

.btn-play {
  background: linear-gradient(135deg, var(--primary-color), #6A11CB);
  color: white;
}

.btn-play:hover {
  background: linear-gradient(135deg, #9D50BB, #6A11CB);
}

.btn-pause {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-pause:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-stop {
  background: linear-gradient(135deg, var(--error-color), #B71C1C);
  color: white;
}

.btn-stop:hover {
  background: linear-gradient(135deg, #FF5252, #B71C1C);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
}

.volume-container span {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.2s;
}

.volume-container span:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), -100vw 0 0 100vw var(--primary-color);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #9D50BB;
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), -100vw 0 0 100vw var(--primary-color);
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #9D50BB;
}

.volume-slider::-moz-range-progress {
  background-color: var(--primary-color);
  height: 6px;
  border-radius: 6px;
}

/* Confetti container */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1.8rem;
    max-width: 100%;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .btn {
    width: 60px;
    height: 60px;
  }
  
  .btn span {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .controls {
    gap: 1.5rem;
  }
  
  .btn {
    width: 55px;
    height: 55px;
  }
}

/* Light theme */
.light-theme {
  --primary-color: #8A2BE2; /* Keep the same vibrant purple */
  --secondary-color: #0091EA; /* Darker blue for better contrast */
  --accent-color: #D81B60; /* Darker pink for better contrast */
  --background-color: #f5f5f5;
  --surface-color: #ffffff;
  --card-color: rgba(255, 255, 255, 0.95);
  --text-primary: #212121;
  --text-secondary: #616161;
  --error-color: #D32F2F;
  --success-color: #00C853;
  --button-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  --container-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  --border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme {
  background: radial-gradient(ellipse at top, #e0e6ff, #f5f5f5);
}

.light-theme .container {
  background: var(--card-color);
  box-shadow: var(--container-shadow);
  border: 1px solid var(--border-color);
}

.light-theme .container::before {
  background: radial-gradient(circle at center, transparent 30%, rgba(138, 43, 226, 0.03) 70%);
}

.light-theme .theme-toggle {
  background: rgba(0, 0, 0, 0.05);
  color: #212121;
}

.light-theme .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
}

.light-theme select {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-theme select option {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.light-theme #nowPlaying {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.light-theme .progress-container {
  background: rgba(0, 0, 0, 0.1);
}

.light-theme .volume-container {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.light-theme .volume-slider {
  background: rgba(0, 0, 0, 0.1);
}

.light-theme .btn-pause {
  background: rgba(0, 0, 0, 0.1);
  color: #212121;
  border: 2px solid rgba(0, 0, 0, 0.05);
}

.light-theme .btn-pause:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: var(--button-shadow);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--button-shadow);
  }
}

.pulse {
  animation: pulse 1.5s infinite;
}

/* Transition for theme changes */
body, .container, select, .btn, .progress-container, .progress-bar, .volume-slider, #nowPlaying, .volume-container {
  transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Footer styles */
.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 1rem;
  color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  padding: 1rem;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.footer p {
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.footer a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  position: relative;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.footer a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.footer a:hover::after {
  width: 100%;
}

.footer .heart {
  color: var(--accent-color);
  display: inline-block;
  transform-origin: center;
  animation: heartbeat 1.5s infinite;
  margin: 0 0.3rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.3);
  }
  30% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.3);
  }
  60% {
    transform: scale(1);
  }
}

/* Light theme adjustments for footer */
.light-theme .footer {
  color: #212121;
  background-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.light-theme .footer p {
  text-shadow: none;
}

.light-theme .footer a {
  color: var(--primary-color);
  text-shadow: none;
}

.light-theme .footer .heart {
  color: var(--accent-color);
  filter: none;
}

/* Random button styles */
.btn-random {
  background: linear-gradient(135deg, var(--secondary-color), #00B8D4);
  color: white;
}

.btn-random:hover {
  background: linear-gradient(135deg, #00E5FF, #00B8D4);
}
