/**
 * Public styles for the plugin
 */

/* Container styles */
.ksf-rating-form-container,
.ksf-ratings-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
}

/* Hospital search */
.ksf-hospital-search {
  margin-bottom: 30px;
}

.ksf-search-box {
  display: flex;
  margin-bottom: 10px;
}

.ksf-search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
}

.ksf-search-box button {
  padding: 8px 16px;
  background-color: #0073aa;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.ksf-search-results {
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background-color: #f9f9f9;
}

.ksf-hospital-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ksf-hospital-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  list-style-type: none;
}

.ksf-hospital-item:hover {
  background-color: #f0f0f0;
}

.ksf-hospital-item:last-child {
  border-bottom: none;
}

/* Selected hospital */
.ksf-selected-hospital {
  background-color: #f0f7ff;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #0073aa;
}

.ksf-selected-hospital h4 {
  margin-top: 0;
  margin-bottom: 5px;
}

.ksf-selected-hospital p {
  margin: 0;
}

/* Form fields */
.ksf-form-field {
  margin-bottom: 20px;
}

.ksf-form-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.ksf-form-field input[type="text"],
.ksf-form-field input[type="email"],
.ksf-form-field select,
.ksf-form-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.ksf-form-field textarea {
  min-height: 100px;
}

.ksf-field-description {
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
}

/* Checkbox container */
.ksf-checkbox-container {
  display: flex;
  align-items: flex-start;
}

.ksf-checkbox-container input[type="checkbox"] {
  margin-top: 3px;
  margin-right: 10px;
}

.ksf-checkbox-container label {
  font-weight: normal;
}

/* Star rating */
.ksf-star-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ksf-star-rating-text {
  margin-bottom: 10px;
  font-weight: 600;
}

.ksf-star-rating-stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.ksf-star-rating-selected {
  margin-top: 10px;
  font-style: italic;
  color: #666;
}

.ksf-star-rating input {
  display: none;
}

.ksf-star-rating label {
  cursor: pointer;
  width: 30px;
  height: 30px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
  color: transparent;
  display: inline-block;
  margin-right: 5px;
}

.ksf-star-rating input:checked ~ label,
.ksf-star-rating label:hover,
.ksf-star-rating label:hover ~ label {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="gold" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>');
}

/* Privacy notice */
.ksf-privacy-notice {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #666;
}

/* Terms field */
.ksf-terms-field {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 25px;
}

.ksf-terms-field a {
  color: #0073aa;
  text-decoration: underline;
}

.ksf-terms-field a:hover {
  text-decoration: none;
}

/* Submit button */
#ksf-rating-submit {
  background-color: #0073aa;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

#ksf-rating-submit:hover {
  background-color: #005f8b;
}

/* Messages */
.ksf-message {
  padding: 20px;
  border-radius: 4px;
  margin: 20px 0;
  font-size: 1.1em;
  font-weight: 500;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-left-width: 5px;
  border-left-style: solid;
  animation: ksf-message-fade-in 0.5s ease-in-out;
}

@keyframes ksf-message-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ksf-success {
  background-color: #d4edda;
  color: #155724;
  border-left-color: #28a745;
}

.ksf-success:before {
  content: "✓";
  display: inline-block;
  margin-right: 10px;
  font-weight: bold;
  font-size: 1.2em;
}

.ksf-error {
  background-color: #f8d7da;
  color: #721c24;
  border-left-color: #dc3545;
}

.ksf-error:before {
  content: "✗";
  display: inline-block;
  margin-right: 10px;
  font-weight: bold;
  font-size: 1.2em;
}

/* Ratings list */
.ksf-ratings-list {
  margin-top: 20px;
}

.ksf-rating-item {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ksf-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ksf-rating-title {
  margin: 0;
  font-size: 1.2em;
}

.ksf-rating-meta {
  font-size: 0.9em;
  color: #666;
  text-align: right;
}

.ksf-rating-stars {
  color: gold;
  font-size: 1.5em;
  margin-bottom: 15px;
}

.ksf-rating-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
}

.ksf-rating-detail {
  margin-bottom: 5px;
}

.ksf-detail-label {
  font-weight: 600;
  display: block;
}

.ksf-rating-experience {
  margin-top: 15px;
}

.ksf-rating-experience h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.ksf-experience-text {
  line-height: 1.6;
}

.ksf-rating-actions {
  margin-top: 15px;
  text-align: right;
}

.ksf-flag-spam-button {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9em;
}

.ksf-spam-report-form {
  margin-top: 10px;
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  text-align: left;
}

.ksf-spam-reason {
  width: 100%;
  min-height: 80px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.ksf-submit-spam-report,
.ksf-cancel-spam-report {
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  margin-right: 5px;
}

.ksf-submit-spam-report {
  background-color: #dc3545;
  color: white;
  border: none;
}

.ksf-cancel-spam-report {
  background-color: #6c757d;
  color: white;
  border: none;
}

.ksf-spam-reported {
  color: #6c757d;
  font-size: 0.9em;
  font-style: italic;
}

.ksf-no-ratings {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  color: #666;
}

/* Required field indicator */
.required {
  color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ksf-rating-header {
    flex-direction: column;
  }

  .ksf-rating-meta {
    text-align: left;
    margin-top: 5px;
  }

  .ksf-rating-details {
    grid-template-columns: 1fr;
  }
}

/* Honeypot-Feld für Spam-Schutz */
.ksf-honeypot-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Overlay für Erfolgsmeldung */
.ksf-message-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: ksf-overlay-fade-in 0.3s ease-in-out;
}

@keyframes ksf-overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ksf-message-popup {
  max-width: 500px;
  width: 90%;
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
  position: relative;
}

.ksf-message-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  background: none;
  border: none;
  padding: 0;
}

.ksf-message-popup-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.ksf-message-popup-success .ksf-message-popup-icon {
  color: #28a745;
}

.ksf-message-popup-error .ksf-message-popup-icon {
  color: #dc3545;
}

.ksf-message-popup-title {
  font-size: 24px;
  margin-bottom: 15px;
  font-weight: bold;
}

.ksf-message-popup-text {
  font-size: 16px;
  margin-bottom: 20px;
}

.ksf-message-popup-button {
  background-color: #0073aa;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
}

.ksf-message-popup-success .ksf-message-popup-button {
  background-color: #28a745;
}

.ksf-message-popup-error .ksf-message-popup-button {
  background-color: #dc3545;
}
