/*!
 * Blindklusiv Text-to-Speech Button Styles
 * WCAG 2.2 AA konform
 */

.tts-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #015258 0%, #02636d 100%);
  color: #fff;
  border: 2px solid #015258;
  border-radius: 6px;
  font-family: Calibri, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(1, 82, 88, 0.2);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.tts-button:hover {
  background: linear-gradient(135deg, #02636d 0%, #015258 100%);
  box-shadow: 0 4px 12px rgba(1, 82, 88, 0.35);
  transform: translateY(-2px);
}

.tts-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(1, 82, 88, 0.2);
}

.tts-button:focus {
  outline: 3px solid #8A5B00;
  outline-offset: 2px;
}

.tts-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #ccc;
  border-color: #999;
  box-shadow: none;
}

/* Icon-Styling */
.tts-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.tts-button:hover svg {
  transform: scale(1.1);
}

/* Label */
.tts-label {
  font-size: 0.95rem;
  font-weight: 600;
}

/* States */
.tts-button.tts-speaking {
  background: linear-gradient(135deg, #8A5B00 0%, #a67c1a 100%);
  border-color: #8A5B00;
  animation: tts-pulse 1.5s infinite;
}

.tts-button.tts-speaking svg {
  animation: tts-spin 1.5s linear infinite;
}

.tts-button.tts-paused {
  background: linear-gradient(135deg, #d4a574 0%, #c29555 100%);
  border-color: #8A5B00;
}

.tts-button.tts-stopped {
  background: linear-gradient(135deg, #015258 0%, #02636d 100%);
  border-color: #015258;
}

/* Animations */
@keyframes tts-pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(138, 91, 0, 0.2);
  }
  50% {
    box-shadow: 0 2px 16px rgba(138, 91, 0, 0.4);
  }
}

@keyframes tts-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .tts-button {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  .tts-button svg {
    width: 16px;
    height: 16px;
  }

  .tts-label {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .tts-button {
    padding: 0.5rem;
    border-radius: 4px;
  }

  .tts-label {
    display: none;
  }

  .tts-button svg {
    width: 20px;
    height: 20px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .tts-button,
  .tts-button svg,
  .tts-button::before {
    animation: none !important;
    transition: none !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .tts-button {
    background: linear-gradient(135deg, #02636d 0%, #015258 100%);
    box-shadow: 0 2px 8px rgba(1, 82, 88, 0.4);
  }

  .tts-button:hover {
    box-shadow: 0 4px 12px rgba(1, 82, 88, 0.5);
  }
}

/* Accessibility: High Contrast */
@media (prefers-contrast: more) {
  .tts-button {
    border-width: 3px;
    font-weight: 700;
  }

  .tts-button:focus {
    outline-width: 4px;
  }
}

/* Print Styles */
@media print {
  .tts-button {
    display: none;
  }
}
