/* =============================================
   TIMER PAGE STYLES
   Armwrestling Academy Berlin - Training Timer
   ============================================= */

/* CSS Custom Properties */
:root {
  /* Farben von style.css */
  --color-primary: #d41414;
  --color-secondary: #1a1a1a;
  --color-accent: #ff3333;
  --color-dark: #000000;
  --color-light: #ffffff;
  --color-gray: #333333;
  --color-gray-light: #f5f5f5;
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --transition: all 0.3s ease;

  /* Timer-spezifische Farben */
  --timer-bg: #0a0a0a;
  --timer-phase-setup: #f0ad4e;
  --timer-phase-training: #d41414;
  --timer-phase-rest: #28a745;
  --timer-phase-done: #17a2b8;

  /* Timer-Groessen */
  --timer-clock-size: clamp(4rem, 15vw, 8rem);
  --timer-ms-size: clamp(1.5rem, 5vw, 3rem);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Page Base */
.timer-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--timer-bg);
  color: var(--color-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-body);
}

/* Zurueck-Link */
.timer-back-link {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-light);
  opacity: 0.6;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.timer-back-link:hover {
  opacity: 1;
  color: var(--color-primary);
}

.timer-back-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Timer Container */
.timer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  gap: 30px;
}

/* Timer Header */
.timer-header {
  text-align: center;
}

.timer-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-light);
  margin-bottom: 5px;
}

.timer-subtitle {
  font-size: 1rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Timer Display */
.timer-display {
  text-align: center;
  width: 100%;
}

/* Timer Clock */
.timer-clock {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0;
  margin-bottom: 20px;
}

.timer-minutes,
.timer-seconds {
  font-size: var(--timer-clock-size);
  line-height: 1;
}

.timer-separator {
  font-size: var(--timer-clock-size);
  line-height: 1;
}

.timer-separator.blink {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Millisekunden hochgestellt */
.timer-milliseconds {
  font-size: var(--timer-ms-size);
  vertical-align: super;
  opacity: 0.8;
}

/* Phasen-Anzeige */
.timer-phase {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 4vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 4px;
  padding: 15px 30px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: inline-block;
  transition: all 0.3s ease;
}

/* Phasen-Farben */
.timer-phase[data-phase="idle"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-light);
}

.timer-phase[data-phase="setup"] {
  background: rgba(240, 173, 78, 0.2);
  color: var(--timer-phase-setup);
  box-shadow: 0 0 30px rgba(240, 173, 78, 0.3);
}

.timer-phase[data-phase="countdown"] {
  background: rgba(255, 100, 50, 0.25);
  color: #ff6432;
  box-shadow: 0 0 40px rgba(255, 100, 50, 0.4);
  animation: pulse-countdown 0.3s ease-in-out infinite;
}

@keyframes pulse-countdown {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.timer-phase[data-phase="training"] {
  background: rgba(212, 20, 20, 0.2);
  color: var(--timer-phase-training);
  box-shadow: 0 0 30px rgba(212, 20, 20, 0.3);
  animation: pulse-training 0.5s ease-in-out infinite;
}

@keyframes pulse-training {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.timer-phase[data-phase="rest"] {
  background: rgba(40, 167, 69, 0.2);
  color: var(--timer-phase-rest);
  box-shadow: 0 0 30px rgba(40, 167, 69, 0.3);
}

.timer-phase[data-phase="done"] {
  background: rgba(23, 162, 184, 0.2);
  color: var(--timer-phase-done);
  box-shadow: 0 0 30px rgba(23, 162, 184, 0.3);
}

/* Einheiten-Zaehler */
.timer-unit-counter {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--color-light);
  opacity: 0.8;
}

.timer-current-unit {
  color: var(--color-primary);
  font-weight: 700;
}

/* Fortschrittsbalken */
.timer-progress {
  width: 100%;
  max-width: 500px;
}

.timer-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.timer-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 4px;
  transition: width 0.1s linear;
}

.timer-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
}

/* Steuerungs-Buttons */
.timer-controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.timer-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--color-primary);
  background: transparent;
  color: var(--color-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.timer-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.timer-btn:hover:not(:disabled) {
  background: var(--color-primary);
  transform: scale(1.1);
}

.timer-btn:active:not(:disabled) {
  transform: scale(0.95);
}

/* Play-Button groesser */
.timer-btn-play {
  width: 90px;
  height: 90px;
  border-width: 4px;
}

.timer-btn-play svg {
  width: 44px;
  height: 44px;
}

/* Deaktivierte Buttons */
.timer-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Audio-Kontrolle */
.timer-audio-control {
  position: fixed;
  top: 20px;
  right: 20px;
}

.timer-btn-audio {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--color-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.timer-btn-audio svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

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

.timer-btn-audio[data-muted="true"] {
  opacity: 0.5;
}

/* Info-Panels */
.timer-info-wrapper {
  display: flex;
  gap: 15px;
  width: 100%;
  max-width: 600px;
  margin-top: 10px;
}

.timer-info {
  flex: 1;
  min-width: 0;
}

.timer-info summary {
  cursor: pointer;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  text-align: center;
  padding: 10px;
  transition: color 0.3s ease;
  list-style: none;
}

.timer-info summary::-webkit-details-marker {
  display: none;
}

.timer-info summary:hover {
  color: var(--color-primary);
}

.timer-info-content {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.timer-info-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timer-info-content li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
}

.timer-info-content li:last-child {
  border-bottom: none;
}

.timer-info-content strong {
  color: var(--color-primary);
}

.timer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.timer-links a:hover {
  color: var(--color-primary);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media screen and (max-width: 480px) {
  .timer-container {
    padding: 80px 15px 30px;
    gap: 20px;
  }

  .timer-back-link {
    top: 15px;
    left: 15px;
  }

  .timer-audio-control {
    top: 15px;
    right: 15px;
  }

  .timer-info-wrapper {
    flex-direction: column;
  }

  .timer-btn {
    width: 60px;
    height: 60px;
  }

  .timer-btn-play {
    width: 80px;
    height: 80px;
  }

  .timer-btn svg {
    width: 28px;
    height: 28px;
  }

  .timer-btn-play svg {
    width: 38px;
    height: 38px;
  }

  .timer-controls {
    gap: 15px;
  }
}

/* Landscape-Modus auf Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .timer-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 20px;
    gap: 15px;
    max-width: 100%;
  }

  .timer-header {
    display: none;
  }

  .timer-display {
    flex: 1;
    min-width: 300px;
  }

  .timer-progress {
    order: 3;
    width: 100%;
  }

  .timer-controls {
    flex: 0;
  }

  .timer-info {
    display: none;
  }
}

