/* Community Voices - Button Styles Only */

/* Navigation Buttons */
.community-voices-slider-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  gap: 20px;
}

.community-voices-slider-nav button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  border: 2px solid #024e9e;
  color: #024e9e;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 3px 3px 0px #024e9e;
}

.community-voices-slider-nav button:hover {
  background: #f5ffe9;
  transform: translateY(-2px);
}

.community-voices-slider-nav button:focus {
  outline: 2px solid #024e9e;
  outline-offset: 2px;
}

.community-voices-slider-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.community-voices-slider-nav .slider-page-indicator {
  font-size: 16px;
  color: #024e9e;
  font-weight: 500;
}

/* Mobile Navigation - REMOVED: Only keep page indicator */
.community-voices-mobile-nav {
  display: none !important;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .community-voices-slider {
    position: relative;
    padding: 0 70px;
  }

  .community-voices-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 0;
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    left: 0;
    right: 0;
  }

  .community-voices-slider-nav button {
    width: 50px;
    height: 50px;
    font-size: 20px;
    pointer-events: auto;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #024e9e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .community-voices-slider-nav .slider-prev {
    left: 5px;
    margin-left: 0;
  }

  .community-voices-slider-nav .slider-next {
    right: 5px;
    margin-right: 0;
  }

  .community-voices-slider-nav .slider-page-indicator {
    display: none;
  }

  /* Mobile navigation completely removed - only page indicator remains in main nav */
}

/* Avatar selector in form */
.community-voices-avatar-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.community-voices-avatar-selector legend {
  margin: 0;
  font-weight: 600;
  color: #024e9e;
  font-size: 16px;
  display: flex;
  align-items: center;
  height: 40px;
  flex-shrink: 0;
}

.community-voices-avatars {
  display: flex;
  gap: 8px;
  align-items: center;
}

.community-voices-avatar-option {
  width: 40px;
  height: 40px;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.community-voices-avatar-option:hover {
  border-color: #024e9e;
  transform: scale(1.1);
}

.community-voices-avatar-option.active {
  border-color: #024e9e;
  border-width: 3px;
  box-shadow: 0 0 8px rgba(2, 78, 158, 0.3);
}

.community-voices-avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* Variation selector - same pattern as avatar selector */
.community-voices-variation-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.community-voices-variation-selector legend {
  margin: 0;
  font-weight: 600;
  color: #024e9e;
  font-size: 16px;
  display: flex;
  align-items: center;
  height: 40px;
  flex-shrink: 0;
}

.community-voices-variations {
  display: flex;
  gap: 8px;
  align-items: center;
}

.community-voices-variation-option {
  width: 40px;
  height: 40px;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.community-voices-variation-option:hover {
  border-color: #024e9e;
  transform: scale(1.1);
}

.community-voices-variation-option.active {
  border-color: #024e9e;
  border-width: 3px;
  box-shadow: 0 0 8px rgba(2, 78, 158, 0.3);
}

.community-voices-variation-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* General Avatar Styles */
.community-voices-avatar {
  width: 40px;
  height: 40px;
  display: inline-block;
  vertical-align: middle;
}

/* Avatar in admin table */
.testimonial-avatar-cell {
  width: 40px;
  height: 40px;
  text-align: center;
}

.testimonial-avatar-cell img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
}

/* Speech Bubble Layout for Testimonials */
.community-voices-testimonial {
  display: flex;
  align-items: flex-start;
  margin-bottom: 50px;
  gap: 30px;
}

.community-voices-testimonial.speech-right {
  flex-direction: row;
}

.community-voices-testimonial.speech-left {
  flex-direction: row-reverse;
}

.community-voices-testimonial-avatar {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  margin: 0;
}

.community-voices-testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #024e9e;
}

.community-voices-testimonial-content {
  flex: 1;
  position: relative;
}

.community-voices-testimonial-text {
  background: #024e9e;
  color: white;
  padding: 15px 20px;
  border-radius: 0 !important;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  position: relative;
  box-shadow: 0 1px 4px rgba(2, 78, 158, 0.2);
}

/* Speech bubble pointer for right speech */
.community-voices-testimonial.speech-right .community-voices-testimonial-text::after {
  content: '';
  position: absolute;
  left: -10px;
  top: 10px;
  width: 0;
  height: 0;
  border-right: 10px solid #024e9e;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

/* Speech bubble pointer for left speech */
.community-voices-testimonial.speech-left .community-voices-testimonial-text::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 10px;
  width: 0;
  height: 0;
  border-left: 10px solid #024e9e;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.community-voices-testimonial-name {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

/* Slider System */
.community-voices-slider {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}

.community-voices-slider-track {
  display: flex;
  transition: transform 0.3s ease;
  width: auto;
}

.community-voices-slider-page {
  width: 100% !important;
  flex-shrink: 0;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
  padding: 0 20px; /* Adds left and right spacing between slides */
  justify-content: center; /* Zentriere den Inhalt vertikal */
  align-items: center; /* Zentriere den Inhalt horizontal */
}

.community-voices-slider-row {
  display: flex;
  flex-direction: row;
  gap: 30px;
  margin-bottom: 30px;
  justify-content: center; /* Zentriere die Testimonials */
  width: 100%;
  max-width: 1200px; /* Maximale Breite für bessere Lesbarkeit */
}

/* Desktop Layout: 2 testimonials per row, 3 rows per page */
@media (min-width: 769px) {
  .community-voices-slider-page {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  /* Horizontal row with 2 testimonials side by side */
  .community-voices-slider-row {
    display: flex;
    flex-direction: row;
    gap: 30px;
    justify-content: center; /* Zentriere auch unvollständige Zeilen */
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .community-voices-testimonial {
    flex: 0 1 auto;
    max-width: 45%; /* Etwas größer für bessere Zentrierung */
    min-width: 300px; /* Mindestbreite für Lesbarkeit */
    box-sizing: border-box;
  }

  /* Für Zeilen mit nur einem Testimonial */
  .community-voices-slider-row .community-voices-testimonial:only-child {
    max-width: 60%; /* Einzelne Testimonials etwas breiter */
  }
}

/* Standardmäßig beide Slider verstecken */
.desktop-slider,
.mobile-slider {
  display: none;
}

/* Desktop Slider - nur auf Desktop anzeigen */
@media (min-width: 769px) {
  .desktop-slider {
    display: block !important;
  }
  .mobile-slider {
    display: none !important;
  }
}

/* Mobile Slider - nur auf Mobile anzeigen */
@media (max-width: 768px) {
  .mobile-slider {
    display: block !important;
  }
  .desktop-slider {
    display: none !important;
  }

  /* Force mobile slider track to work properly */
  .mobile-slider .community-voices-slider-track {
    display: flex !important;
  }

  .mobile-slider .community-voices-slider-page {
    display: flex !important;
    width: 100% !important;
    flex-shrink: 0 !important;
  }

  /* Mobile slider pages should all be visible for JS to work */
  .mobile-slider .community-voices-slider-page {
    display: flex !important;
    width: 100% !important;
    flex-shrink: 0 !important;
  }

  /* Initial transform will be set by JavaScript */
  .mobile-slider .community-voices-slider-track {
    transform: translateX(0%);
  }
}

/* Mobile Slider Styles */
.mobile-slider {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  margin: 20px 0; /* Abstand oben und unten */
  padding-bottom: 0; /* Navigation ist jetzt unten, kein extra Padding nötig */
  touch-action: pan-y; /* Allow vertical scrolling but prevent horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.mobile-slider .community-voices-slider-track {
  display: flex;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smoother easing */
  width: auto;
  will-change: transform; /* Optimize for animations */
}

.mobile-slider .community-voices-slider-page {
  width: 100%;
  flex-shrink: 0;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 20px;
  min-height: 400px; /* Erhöhte Mindesthöhe für konsistente Boxgröße */
}

.community-voices-mobile-testimonial-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px 0; /* Vertikaler Abstand */
  min-height: 360px; /* Konsistente Mindesthöhe für alle Container */
}

.mobile-testimonial {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  width: 100%;
  max-width: 400px;
  min-height: 320px; /* Konsistente Mindesthöhe für alle Testimonials */
  margin-bottom: 30px; /* Abstand zwischen Testimonials */
  box-sizing: border-box;
}

.mobile-testimonial .community-voices-testimonial-avatar {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  margin: 0;
}

.mobile-testimonial .community-voices-testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #024e9e;
}

.mobile-testimonial .community-voices-testimonial-text {
  background: #024e9e;
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  width: 100%;
  min-height: 120px; /* Konsistente Mindesthöhe für Textboxen */
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(2, 78, 158, 0.2);
  box-sizing: border-box;
}

.mobile-testimonial .community-voices-testimonial-name {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  text-align: center;
  width: 100%;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .mobile-slider .community-voices-slider-nav {
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
    width: 100%;
    height: auto;
    pointer-events: auto;
    z-index: 10;
  }

  .mobile-slider .community-voices-slider-nav button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid #024e9e;
    color: #024e9e;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0px #024e9e;
    pointer-events: auto;
  }

  .mobile-slider .community-voices-slider-nav button:hover {
    background: #f5ffe9;
    transform: translateY(-2px);
  }

  .mobile-slider .community-voices-slider-nav button:focus {
    outline: 2px solid #024e9e;
    outline-offset: 2px;
  }

  .mobile-slider .community-voices-slider-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }

  .mobile-slider .community-voices-slider-nav .slider-prev {
    margin-left: 0;
  }

  .mobile-slider .community-voices-slider-nav .slider-next {
    margin-right: 0;
  }

  .mobile-slider .community-voices-slider-nav .slider-page-indicator {
    position: static;
    font-size: 16px;
    color: #024e9e;
    font-weight: 500;
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: auto;
    white-space: nowrap;
    transform: none;
  }
}

/* Form Styles */
.community-voices-form-container {
  max-width: 100%;
  margin: 0 auto;
}

.community-voices-form-content {
  max-width: 100%;
}

.community-voices-form-description {
  margin-bottom: 20px;
}

.community-voices-form-description p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.community-voices-form {
  width: 100%;
}

/* Name Field */
.community-voices-name-field {
  margin-bottom: 20px;
}

.community-voices-name-field input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.community-voices-name-field input:focus {
  outline: none;
  border-color: #024e9e;
}

/* Testimonial Field */
.community-voices-testimonial-field {
  margin-bottom: 20px;
}

.community-voices-testimonial-field textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.community-voices-testimonial-field textarea:focus {
  outline: none;
  border-color: #024e9e;
}

.community-voices-testimonial-field textarea.error {
  border-color: #dc3545;
}

.character-count-container {
  margin-top: 8px;
  font-size: 14px;
  color: #666;
}

.character-count-container.success {
  color: #36a839;
}

.character-count-container.error {
  color: #dc3545;
  font-weight: 600;
}

/* Submit Button */
.community-voices-submit-button {
  margin-top: 20px;
  margin-bottom: 20px;
}

.community-voices-submit-button button {
  width: 100%;
  padding: 15px 25px;
  background: #024e9e;
  color: white;
  border: 2px solid #024e9e;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 3px 3px 0px rgba(2, 78, 158, 0.3);
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.community-voices-submit-button button:hover:not(:disabled) {
  background: #0366c9;
  border-color: #0366c9;
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px rgba(2, 78, 158, 0.3);
}

.community-voices-submit-button button:focus {
  outline: 2px solid #024e9e;
  outline-offset: 2px;
}

.community-voices-submit-button button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 2px 2px 0px rgba(2, 78, 158, 0.3);
}

.community-voices-submit-button button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.community-voices-submit-button button img {
  width: 15px;
  height: 15px;
  display: inline-block;
}

.community-voices-submit-button .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Message Display */
.community-voices-message {
  margin-top: 15px;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  display: none;
}

.community-voices-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.community-voices-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

/* Ensure form elements are not blocked */
.community-voices-form * {
  box-sizing: border-box;
}

.community-voices-form button[type="submit"] {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.community-voices-form button[type="submit"]:disabled {
  pointer-events: none !important;
  cursor: not-allowed !important;
}
