/* ========================================
   FEEDBACK WIDGET - MAIN STYLES
   ======================================== */

/* Reset e Base */
.portalfeedback .feedback-widget *,
.portalfeedback .feedback-modal-overlay *,
.portalfeedback .welcome-content * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========================================
   WIDGET FLUTUANTE
   ======================================== */

.portalfeedback .feedback-widget {
  position: fixed;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.portalfeedback .feedback-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  border: none;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.portalfeedback .feedback-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.portalfeedback .feedback-button:active {
  transform: scale(0.95);
}

/* ========================================
   MODAL OVERLAY (BASE)
   ======================================== */

.portalfeedback .feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 62, 80, 0.8);
  z-index: 10000;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   MODAL DE BOAS-VINDAS
   ======================================== */

.portalfeedback .welcome-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portalfeedback .welcome-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #ecf0f1;
}

.portalfeedback .welcome-icon {
  font-size: 60px;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portalfeedback .welcome-header h2 {
  color: #2c3e50;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.portalfeedback .welcome-header p {
  color: #7f8c8d;
  font-size: 16px;
  margin: 0;
}

.portalfeedback .consultation-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 1px solid #2196f3;
  border-radius: 15px;
  padding: 25px;
  margin: 25px 0;
  text-align: center;
}

.portalfeedback .consultation-dates {
  color: #1565c0;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 10px;
}

.portalfeedback .consultation-duration {
  color: #1976d2;
  font-size: 14px;
}

.portalfeedback .portal-description {
  color: #34495e;
  line-height: 1.6;
  margin: 25px 0;
}

.portalfeedback .portal-description h5 {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 15px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.portalfeedback .portal-description ul {
  list-style: none;
  padding-left: 0;
  margin: 15px 0;
}

.portalfeedback .portal-description li {
  padding: 8px 0;
  border-bottom: 1px solid #ecf0f1;
}

.portalfeedback .portal-description li:last-child {
  border-bottom: none;
}

.portalfeedback .feedback-instruction {
  background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
  border: 1px solid #bdc3c7;
  border-radius: 15px;
  padding: 20px;
  margin: 25px 0;
  color: #2c3e50;
}

.portalfeedback .welcome-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

.portalfeedback .btn-primary,
.portalfeedback .btn-secondary {
  padding: 12px 30px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 14px;
}

.portalfeedback .btn-primary {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
}

.portalfeedback .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.portalfeedback .btn-secondary {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  color: white;
}

.portalfeedback .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

/* ========================================
   MODAL DE FEEDBACK
   ======================================== */

.portalfeedback .feedback-content {
  background: white;
  border-radius: 20px;
  padding: 35px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease-out;
}

.portalfeedback .feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #ecf0f1;
}

.portalfeedback .feedback-header h4 {
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.portalfeedback .btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #95a5a6;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.portalfeedback .btn-close:hover {
  background: #ecf0f1;
  color: #2c3e50;
}

/* ========================================
   SISTEMA DE ESTRELAS
   ======================================== */

.portalfeedback .overall-rating {
  text-align: center;
  background: linear-gradient(135deg, #ecf0f1 0%, #f8f9fa 100%);
  padding: 25px;
  border-radius: 15px;
  margin: 20px 0;
  border: 1px solid #bdc3c7;
}

.portalfeedback .overall-rating label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  display: block;
}

.portalfeedback .rating-stars {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 20px 0;
}

.portalfeedback .star {
  font-size: 30px;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.portalfeedback .star:hover,
.portalfeedback .star.active {
  color: #ffd700;
  transform: scale(1.1);
}

.portalfeedback .rating-description {
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 10px;
}

/* ========================================
   CATEGORIAS DE FEEDBACK
   ======================================== */

.portalfeedback .feedback-categories {
  margin: 25px 0;
}

.portalfeedback .feedback-categories > label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  display: block;
}

.portalfeedback .category-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.portalfeedback .category-item:hover {
  border-color: #3498db;
  background: #f0f4ff;
}

.portalfeedback .category-item.selected {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border-color: transparent;
}

.portalfeedback .category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.portalfeedback .category-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
  gap: 10px;
}

.portalfeedback .category-title i {
  font-size: 20px;
}

.portalfeedback .category-chevron {
  transition: transform 0.3s ease;
  font-size: 14px;
}

.portalfeedback .category-item.selected .category-chevron {
  transform: rotate(180deg);
}

.portalfeedback .category-rating {
  display: none;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.portalfeedback .category-item.selected .category-rating {
  display: block;
}

.portalfeedback .category-item:not(.selected) .category-rating {
  border-top-color: #e9ecef;
}

.portalfeedback .category-rating small {
  display: block;
  margin-bottom: 10px;
  opacity: 0.9;
}

/* ========================================
   FORMULÁRIO
   ======================================== */

.portalfeedback .form-group {
  margin-bottom: 20px;
}

.portalfeedback .form-label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  display: block;
}

.portalfeedback .form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #bdc3c7;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s ease;
  resize: vertical;
}

.portalfeedback .form-control:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.portalfeedback .form-control::placeholder {
  color: #95a5a6;
}

/* ========================================
   BOTÕES DO FORMULÁRIO
   ======================================== */

.portalfeedback .form-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.portalfeedback .btn-cancel {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.portalfeedback .btn-submit {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.portalfeedback .btn-cancel:hover,
.portalfeedback .btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.portalfeedback .btn-submit:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   MENSAGENS DE FEEDBACK
   ======================================== */

.portalfeedback .success-message,
.portalfeedback .error-message {
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  display: none;
  align-items: center;
  gap: 10px;
}

.portalfeedback .success-message {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #c3e6cb;
}

.portalfeedback .error-message {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.portalfeedback .success-message.show,
.portalfeedback .error-message.show {
  display: flex;
}

.portalfeedback .response-message {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1565c0;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  border: 1px solid #2196f3;
  display: none;
  align-items: center;
  gap: 10px;
}

.portalfeedback .response-message.show {
  display: flex;
}

/* ========================================
   LOADING STATE
   ======================================== */

.portalfeedback .loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.portalfeedback .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

@media (max-width: 768px) {
  /* Widget Button */
  .portalfeedback .feedback-widget {
    top: auto;
    bottom: 80px;
    right: 15px;
    transform: none;
  }

  .portalfeedback .feedback-button {
    width: 55px;
    height: 55px;
    font-size: 22px;
  }

  /* Modal Content */
  .portalfeedback .welcome-content,
  .portalfeedback .feedback-content {
    width: 95%;
    padding: 25px 20px;
    margin: 10px;
    border-radius: 15px;
    max-height: 95vh;
  }

  .portalfeedback .welcome-header h2 {
    font-size: 24px;
  }

  .portalfeedback .welcome-icon {
    font-size: 50px;
  }

  /* Star Rating */
  .portalfeedback .rating-stars {
    gap: 8px;
  }

  .portalfeedback .star {
    font-size: 35px;
    padding: 5px;
  }

  /* Buttons */
  .portalfeedback .welcome-buttons,
  .portalfeedback .form-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .portalfeedback .welcome-buttons button,
  .portalfeedback .form-buttons button {
    width: 100%;
    text-align: center;
  }

  /* Categories */
  .portalfeedback .category-item {
    padding: 15px;
  }

  .portalfeedback .category-title {
    font-size: 14px;
  }

  /* Form */
  .portalfeedback .form-control {
    padding: 10px;
    font-size: 16px; /* Evita zoom no iOS */
  }
}

@media (max-width: 480px) {
  .portalfeedback .welcome-content,
  .portalfeedback .feedback-content {
    padding: 20px 15px;
  }

  .portalfeedback .consultation-info,
  .portalfeedback .feedback-instruction {
    padding: 15px;
  }

  .portalfeedback .star {
    font-size: 32px;
  }
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

/* Focus states */
.portalfeedback .feedback-button:focus,
.portalfeedback .btn-primary:focus,
.portalfeedback .btn-secondary:focus,
.portalfeedback .btn-submit:focus,
.portalfeedback .btn-cancel:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

.portalfeedback .star:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
  border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .portalfeedback .feedback-button,
  .portalfeedback .btn-primary,
  .portalfeedback .btn-secondary {
    border: 2px solid;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   UTILITIES
   ======================================== */

.portalfeedback .text-center {
  text-align: center;
}

.portalfeedback .mt-10 {
  margin-top: 10px;
}

.portalfeedback .mt-20 {
  margin-top: 20px;
}

.portalfeedback .mb-10 {
  margin-bottom: 10px;
}

.portalfeedback .mb-20 {
  margin-bottom: 20px;
}

.portalfeedback .hidden {
  display: none !important;
}

.portalfeedback .visible {
  display: block !important;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .portalfeedback .feedback-widget,
  .portalfeedback .feedback-modal-overlay {
    display: none !important;
  }
}