// Feedback Widget Styles
.feedback-widget {
  padding: 24px 0;
  border-top: 1px solid var(--leftnav-border);
  margin-top: 32px;

  .feedback-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--body-color);
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .feedback-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }

  .feedback-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    background: transparent;
    border: 1px solid var(--watch-btn-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--watch-btn-color);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 80px;
    
    &:hover {
      background: var(--watch-btn-hover-background);
      border-color: var(--primary-1);
      color: var(--primary-1);
      transform: translateY(-1px);
    }
    
    &:active {
      transform: translateY(0) scale(0.98);
    }

    &:focus {
      outline: 2px solid var(--primary-1);
      outline-offset: 2px;
    }
    
    &.feedback-selected {
      background: var(--primary-1);
      border-color: var(--primary-1);
      color: #ffffff;
      cursor: default;
      
      &:hover {
        background: var(--primary-1);
        border-color: var(--primary-1);
        color: #ffffff;
        transform: none;
      }
    }
  }

  .feedback-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;

    .feedback-emoji {
      font-size: 24px;
      line-height: 1;
    }

    .feedback-text {
      font-size: 16px;
      font-weight: 500;
      color: var(--body-color);
    }
  }

  .feedback-thanks {
    .feedback-message {
      margin-bottom: 0;
    }
  }

  .feedback-input-container {
    .feedback-textarea {
      width: 100%;
      min-height: 100px;
      padding: 12px 16px;
      border: 1px solid var(--watch-btn-border);
      border-radius: 6px;
      background: var(--body-background);
      color: var(--body-color);
      font-size: 14px;
      line-height: 1.5;
      resize: vertical;
      transition: border-color 0.2s ease;

      &::placeholder {
        color: #8c8c8c;
      }

      &:focus {
        outline: none;
        border-color: var(--primary-1);
        box-shadow: 0 0 0 2px rgba(52, 67, 244, 0.1);
      }
    }

    .feedback-char-counter {
      text-align: right;
      font-size: 12px;
      color: #8c8c8c;
      margin-top: 6px;

      .char-count {
        font-weight: 500;
      }
    }

    .feedback-form-buttons {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
    }

    .feedback-submit-btn,
    .feedback-cancel-btn {
      height: 36px;
      padding: 0 16px;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      border: 1px solid;

      &:focus {
        outline: 2px solid var(--primary-1);
        outline-offset: 2px;
      }
    }

    .feedback-submit-btn {
      background: var(--primary-1);
      border-color: var(--primary-1);
      color: #ffffff;

      &:hover {
        background: var(--secondary-2);
        border-color: var(--secondary-2);
        transform: translateY(-1px);
      }

      &:active {
        transform: translateY(0) scale(0.98);
      }

      &:disabled {
        background: var(--placeholder-color);
        border-color: var(--placeholder-color);
        cursor: not-allowed;
        transform: none;
      }
    }

    .feedback-cancel-btn {
      background: transparent;
      border-color: var(--watch-btn-border);
      color: var(--watch-btn-color);

      &:hover {
        background: var(--watch-btn-hover-background);
        border-color: var(--primary-1);
        color: var(--primary-1);
      }

      &:active {
        transform: scale(0.98);
      }
    }
  }

}

// Dark mode adjustments
[data-dark-mode] {
  .feedback-widget {
    .feedback-btn:hover {
      border-color: var(--primary-2);
      color: var(--primary-2);
    }

    .feedback-btn:focus {
      outline-color: var(--primary-2);
    }

    .feedback-btn.feedback-selected {
      background: var(--secondary-2);
      border-color: var(--secondary-2);
      color: var(--primary-2);
      
      &:hover {
        background: var(--secondary-2);
        border-color: var(--secondary-2);
        color: var(--primary-2);
      }
    }

    .feedback-input-container {
      .feedback-textarea:focus {
        border-color: var(--primary-2);
        box-shadow: 0 0 0 2px rgba(122, 240, 254, 0.1);
      }

      .feedback-submit-btn {
        background: var(--secondary-2);
        border-color: var(--secondary-2);
        color: var(--primary-2);

        &:hover {
          background: var(--primary-1);
          border-color: var(--primary-1);
          color: #ffffff;
        }
      }

      .feedback-cancel-btn:hover {
        border-color: var(--primary-2);
        color: var(--primary-2);
      }
    }
  }
}

// Mobile responsive
@media (max-width: 768px) {
  .feedback-widget {
    padding: 20px 0;

    .feedback-title {
      font-size: 18px;
      margin-bottom: 14px;
    }

    .feedback-buttons {
      flex-direction: column;
      gap: 10px;
    }

    .feedback-btn {
      width: 100%;
      height: 44px;
      font-size: 16px;
    }

    .feedback-input-container {
      .feedback-textarea {
        font-size: 16px; // Prevent zoom on iOS
      }

      .feedback-form-buttons {
        flex-direction: column;
      }

      .feedback-submit-btn,
      .feedback-cancel-btn {
        width: 100%;
        height: 44px;
        font-size: 16px;
      }
    }
  }
}

// Fade in animation for smooth transitions
.feedback-fade-in {
  animation: feedbackFadeIn 0.3s ease-in-out forwards;
}

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


// Animation for smooth transitions
.feedback-widget > div {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.feedback-widget .feedback-form,
.feedback-widget .feedback-thanks {
  &[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
  }
  
  &[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
  }
}