/* Feedback Widget Styles - OSE Vidensbank */
.feedback-widget {
  --feedback-primary: #dd6b20;
  --feedback-hover: #c05621;
  --feedback-text: #ffffff;
  --feedback-overlay: rgba(0, 0, 0, 0.5);
  --feedback-panel-bg: #ffffff;
  --feedback-panel-text: #212121;
  --feedback-input-bg: #f5f5f5;
  --feedback-input-border: #e0e0e0;
  --feedback-input-focus: #dd6b20;
  --feedback-success: #4CAF50;
  --feedback-error: #f44336;
}

[data-md-color-scheme="slate"] .feedback-widget {
  --feedback-panel-bg: #1e1e1e;
  --feedback-panel-text: #ffffff;
  --feedback-input-bg: #2d2d2d;
  --feedback-input-border: #424242;
}

/* Feedback Button */
.feedback-button {
  position: fixed;
  right: -40px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  background-color: var(--feedback-primary);
  color: var(--feedback-text);
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-family: var(--md-text-font-family);
}

.feedback-button:hover {
  background-color: var(--feedback-hover);
  right: -35px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.feedback-button:active {
  transform: translateY(-50%) rotate(-90deg) scale(0.95);
}

/* Overlay */
.feedback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--feedback-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
}

.feedback-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Feedback Panel */
.feedback-panel {
  position: fixed;
  right: -500px;
  top: 0;
  width: 500px;
  height: 100%;
  background-color: var(--feedback-panel-bg);
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1002;
  display: flex;
  flex-direction: column;
}

.feedback-panel.active {
  transform: translateX(-500px);
}

/* Panel Header */
.feedback-header {
  padding: 20px;
  border-bottom: 1px solid var(--feedback-input-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--feedback-panel-text);
  margin: 0;
}

.feedback-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--feedback-panel-text);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.feedback-close:hover {
  background-color: var(--feedback-input-bg);
}

/* Panel Content */
.feedback-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-field {
  display: flex;
  flex-direction: column;
}

.feedback-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--feedback-panel-text);
  margin-bottom: 6px;
}

.feedback-label .required {
  color: var(--feedback-error);
}

.feedback-label .optional {
  color: #888;
  font-weight: 400;
}

.feedback-input,
.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--feedback-input-bg);
  border: 1px solid var(--feedback-input-border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--feedback-panel-text);
  font-family: var(--md-text-font-family);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.feedback-input:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: var(--feedback-input-focus);
  box-shadow: 0 0 0 3px rgba(221, 107, 32, 0.1);
}

.feedback-textarea {
  min-height: 240px;
  resize: vertical;
}

.feedback-input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Submit Button */
.feedback-submit {
  background-color: var(--feedback-primary);
  color: var(--feedback-text);
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.feedback-submit:hover:not(:disabled) {
  background-color: var(--feedback-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.feedback-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.feedback-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-submit.loading {
  color: transparent;
}

.feedback-submit.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid var(--feedback-text);
  border-radius: 50%;
  border-top-color: transparent;
  animation: feedback-spinner 0.8s linear infinite;
}

/* Messages */
.feedback-message {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 16px;
  display: none;
}

.feedback-message.success {
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--feedback-success);
  border: 1px solid rgba(76, 175, 80, 0.3);
  display: block;
}

.feedback-message.error {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--feedback-error);
  border: 1px solid rgba(244, 67, 54, 0.3);
  display: block;
}

/* File Upload */
.feedback-file-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-file-input {
  display: none;
}

.feedback-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--feedback-input-bg);
  border: 1px dashed var(--feedback-input-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--feedback-panel-text);
}

.feedback-file-label:hover {
  border-color: var(--feedback-primary);
  background-color: rgba(221, 107, 32, 0.05);
}

.feedback-file-icon {
  font-size: 16px;
}

.feedback-file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--feedback-input-bg);
  border-radius: 4px;
  font-size: 13px;
}

.feedback-file-name {
  color: var(--feedback-panel-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.feedback-file-remove {
  background: none;
  border: none;
  color: var(--feedback-error);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
}

.feedback-file-remove:hover {
  opacity: 0.7;
}

.feedback-file-hint {
  font-size: 12px;
  color: #888;
}

/* Animations */
@keyframes feedback-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .feedback-button {
    right: -35px;
    padding: 10px 20px;
    font-size: 13px;
  }

  .feedback-panel {
    width: 100%;
    right: -100%;
  }

  .feedback-panel.active {
    transform: translateX(-100%);
  }
}

@media (max-width: 480px) {
  .feedback-button {
    right: -30px;
    padding: 8px 16px;
    font-size: 12px;
  }

  .feedback-header {
    padding: 16px;
  }

  .feedback-content {
    padding: 16px;
  }
}
