/** @format */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: #fafafa;
  min-height: 100vh;
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Desktop Layout */
.desktop-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.timer-section {
  flex: 1;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 100vh;
  position: relative;
}

.settings-section {
  flex: 0 0 400px;
  background: #f8f8f8;
  padding: 40px;
  overflow-y: auto;
  border-left: 1px solid #e0e0e0;
  min-height: 100vh;
}

.settings-section h2 {
  font-size: 1.5rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

/* Mobile Layout */
.mobile-container {
  display: none;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.slides-container {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.3s ease-out;
}

.slide {
  flex: 0 0 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: white;
  position: relative;
}

.slide.settings-slide {
  background: #f8f8f8;
  justify-content: flex-start;
  padding-top: 60px;
  overflow-y: auto;
}

.swipe-indicator {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.slide-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.3s ease;
}

.dot.active {
  background: #333;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 40px;
  color: #333;
  letter-spacing: -0.5px;
}

.timer-display {
  margin-bottom: 40px;
  position: relative;
  width: 400px;
  height: 400px;
  margin: 0 auto 40px;
}

.mobile-container .timer-display {
  width: 250px;
  height: 250px;
}

/* Background Video Styles */
.background-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
  /* Debug styling - remove after testing */
  border: 2px solid red;
}

.background-video-container.has-video {
  opacity: 0.15;
  /* Debug styling - make more visible for testing */
  opacity: 0.8;
}

.background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  /* Temporarily remove border-radius for testing */
  /* border-radius: 50%; */
  /* Debug styling */
  border: 2px solid blue;
  z-index: 3;
}

.background-video iframe {
  width: 100% !important;
  height: 100% !important;
  /* Temporarily remove border-radius for testing */
  /* border-radius: 50%; */
}

/* Make sure the iframe itself has proper positioning */
iframe.background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120% !important;
  height: 120% !important;
  z-index: 3;
  /* Temporarily remove border-radius for testing */
  /* border-radius: 50%; */
  /* Debug styling */
  border: 2px solid green !important;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: 5;
  pointer-events: none;
}

/* Mobile background video positioning */
.mobile-background {
  pointer-events: none;
}

.analog-clock {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  z-index: 10;
}

.clock-face {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
}

.time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: #333;
  z-index: 10;
  background: white;
  padding: 40px;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  min-width: 180px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.mobile-container .time {
  font-size: 2.5rem;
  padding: 25px;
  min-width: 120px;
}

.phase {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  background: white;
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 20;
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.progress-ring circle {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
}

.progress-ring .background {
  stroke: #f0f0f0;
  stroke-width: 6;
  fill: none;
}

.progress-ring .progress-fill {
  fill: #ff4444;
  stroke: none;
  transition: d 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(255, 68, 68, 0.2));
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
  margin-top: 20px;
  position: relative;
  z-index: 10;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
}

.btn-primary {
  background: #333;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #555;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: #f8f8f8;
  color: #333;
  border: 1px solid #e8e8e8;
}

.btn-secondary:hover:not(:disabled) {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.settings {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
  padding: 24px;
  background: #fafafa;
  border-radius: 12px;
}

.setting-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.setting-group label {
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
}

.setting-group input {
  width: 80px;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  background: white;
  transition: border-color 0.2s ease;
}

.setting-group input:focus {
  outline: none;
  border-color: #333;
}

.session-info {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  text-align: center;
  margin-top: 20px;
  background: white;
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: inline-block;
}

/* Animation for timer completion */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.time.complete {
  animation: pulse 0.5s ease-in-out;
  color: #ff4444;
}

/* Responsive design */
@media (max-width: 768px) {
  .desktop-container {
    display: none;
  }

  .mobile-container {
    display: block;
  }

  .controls {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .btn {
    width: 200px;
    padding: 15px 24px;
  }

  .setting-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .setting-group input {
    width: 100%;
  }

  .settings {
    margin-bottom: 20px;
  }

  .music-section {
    margin-top: 20px;
  }
}

@media (min-width: 769px) {
  .desktop-container {
    display: flex;
  }

  .mobile-container {
    display: none;
  }
}

/* Music Controls Styling */
.music-section {
  margin-top: 30px;
  padding: 24px;
  background: #fafafa;
  border-radius: 12px;
  border-top: 1px solid #e8e8e8;
}

.music-controls h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.playlist-input {
  margin-bottom: 20px;
}

.playlist-input label {
  display: block;
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.playlist-input input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  transition: border-color 0.2s ease;
  margin-bottom: 12px;
}

.playlist-input input:focus {
  outline: none;
  border-color: #333;
}

.playlist-input input::placeholder {
  color: #999;
}

.music-player {
  text-align: center;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.player-controls .btn {
  min-width: 80px;
  font-size: 0.85rem;
}

#volumeControl {
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  transition: background 0.2s ease;
}

#volumeControl::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  transition: background 0.2s ease;
}

#volumeControl::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  border: none;
}

#volumeControl:hover::-webkit-slider-thumb {
  background: #555;
}

.now-playing {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}

.song-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.current-song,
.next-song {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.current-song .label,
.next-song .label {
  font-size: 0.8rem;
  color: #999;
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
}

.now-playing span {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.video-toggle {
  margin: 12px 0;
  text-align: center;
}

.video-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
}

.video-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #333;
}

/* Mobile-specific adjustments for music controls */
.mobile-container .music-section {
  background: transparent;
  border: none;
  padding: 20px 0;
}

.mobile-container .player-controls {
  flex-direction: column;
  gap: 10px;
}

.mobile-container .player-controls .btn {
  width: 180px;
}

.mobile-container #volumeControlMobile {
  width: 200px;
}

/* Settings section styling for desktop */
.settings-section .settings {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.settings-section .music-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: none;
}
